Dragging & dropping a file creates an attachment element even when it's disabled
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Dragging & dropping a file creates an attachment element even when it's disabled
4         https://bugs.webkit.org/show_bug.cgi?id=176769
5
6         Reviewed by Tim Horton.
7
8         The bug that dropping a file always created an attachment element even when it's disabled by settings
9         was caused by WebContentReader::readFilenames always creating an attachment element. Fixed this by
10         checking the runtime flag. The fix is tested by drag-files-to-editable-element-as-URLs.html
11
12         To fix the bug that HTMLAttachmentElement is always exposed on the global object even when it's disabled
13         by settings, replaced the setting to enable attachment element by an equivalent runtime enabled flag,
14         and hid both the interface as well as the element behind it. Fixed various bugs in our code generator
15         to make this work.
16
17         Tests: editing/pasteboard/drag-files-to-editable-element-as-URLs.html
18                editing/pasteboard/drag-files-to-editable-element-as-attachment.html
19
20         * bindings/js/WebCoreBuiltinNames.h: Added symbols used in the generated code.
21         * dom/make_event_factory.pl:
22         (defaultItemFactory): Replaced "runtimeConditonal" option by "runtimeEnabled".
23         (generateImplementation):
24         * dom/make_names.pl:
25         (defaultTagPropertyHash):
26         (printConstructorInterior): Return a HTMLUnknownElement if the element is disabled by a runtime flag.
27         (printTypeHelpers): Make is<HTMLAttachmentElement>(~) returns false when the feature is disabled by
28         checking whether the given element is an instance of HTMLUnknownElement.
29         (printWrapperFunctions): Simplified this code by matching the code for settingsConditional.
30         * editing/mac/EditorMac.mm:
31         (WebCore::Editor::WebContentReader::readFilenames): Fixed the bug that this code was always creating
32         an attachment element even when the feature is disabled.
33         * html/HTMLAttachmentElement.idl: Hide this behind a runtime flag.
34         * html/HTMLTagNames.in: 
35         * page/RuntimeEnabledFeatures.h:
36         (WebCore::RuntimeEnabledFeatures::setAttachmentElementEnabled): Added.
37         (WebCore::RuntimeEnabledFeatures::attachmentElementEnabled const): Added.
38         * page/Settings.in: Removed attachmentElementEnabled.
39
40 2017-09-12  Youenn Fablet  <youenn@apple.com>
41
42         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
43         https://bugs.webkit.org/show_bug.cgi?id=176579
44
45         Reviewed by Alex Christensen.
46
47         No change of behavior.
48
49         Introducing another version of queryCacheMatch used for the NetworkProcess implementation of the Cache.
50         Exporting the copy of a response body to be used also there.
51
52         * Modules/cache/DOMCacheEngine.cpp:
53         (WebCore::DOMCacheEngine::matchURLs):
54         (WebCore::DOMCacheEngine::queryCacheMatch):
55         (WebCore::DOMCacheEngine::copyResponseBody):
56         * Modules/cache/DOMCacheEngine.h:
57
58 2017-09-12  Antti Koivisto  <antti@apple.com>
59
60         AnimationBase should point to Element instead of RenderElement
61         https://bugs.webkit.org/show_bug.cgi?id=176807
62
63         Reviewed by Andreas Kling.
64
65         This is a step towards making animation system operate on elements and styles instead renderers.
66
67         No functional changes.
68
69         * page/animation/AnimationBase.cpp:
70         (WebCore::AnimationBase::AnimationBase):
71         (WebCore::AnimationBase::renderer const):
72         (WebCore::AnimationBase::compositedRenderer const):
73         (WebCore::AnimationBase::updateStateMachine):
74         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
75         (WebCore::AnimationBase::timeToNextService):
76         (WebCore::AnimationBase::freezeAtTime):
77         (WebCore::AnimationBase::getElapsedTime const):
78         * page/animation/AnimationBase.h:
79         (WebCore::AnimationBase::clear):
80         (WebCore::AnimationBase::renderer const): Deleted.
81         * page/animation/ImplicitAnimation.cpp:
82         (WebCore::ImplicitAnimation::shouldSendEventForListener const):
83         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation const):
84         (WebCore::ImplicitAnimation::startAnimation):
85         (WebCore::ImplicitAnimation::pauseAnimation):
86         (WebCore::ImplicitAnimation::endAnimation):
87         (WebCore::ImplicitAnimation::sendTransitionEvent):
88         (WebCore::ImplicitAnimation::reset):
89         * page/animation/KeyframeAnimation.cpp:
90         (WebCore::KeyframeAnimation::getAnimatedStyle):
91         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
92         (WebCore::KeyframeAnimation::startAnimation):
93         (WebCore::KeyframeAnimation::pauseAnimation):
94         (WebCore::KeyframeAnimation::endAnimation):
95         (WebCore::KeyframeAnimation::shouldSendEventForListener const):
96         (WebCore::KeyframeAnimation::sendAnimationEvent):
97         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
98
99 2017-09-12  Per Arne Vollan  <pvollan@apple.com>
100
101         [Win] Add Modules/fetch to list of forwarding headers folders.
102         https://bugs.webkit.org/show_bug.cgi?id=176747
103
104         Reviewed by Brent Fulgham.
105
106         * PlatformWin.cmake:
107
108 2017-09-12  Jer Noble  <jer.noble@apple.com>
109
110         [MSE] Don't increase the reported totalFrameDelay for non-displayed frames (or frames coming in while paused).
111         https://bugs.webkit.org/show_bug.cgi?id=175900
112
113         Reviewed by Eric Carlson.
114
115         When seeking to a specific time, the decompression session necessarily needs to be fed samples from before that
116         time (i.e., all samples from the previous I-frame forward). These shouldn't contribute to the "total frame
117         delay" metric. Neither should samples delivered when the video is paused (like, during seeking), as a frame can't
118         be "late" if time is not moving forward.
119
120         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
121         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
122         * platform/cf/CoreMediaSoftLink.cpp:
123         * platform/cf/CoreMediaSoftLink.h:
124
125 2017-09-12  Sam Weinig  <sam@webkit.org>
126
127         Gtk build fix for "Finish off the FormData implementation" - https://bugs.webkit.org/show_bug.cgi?id=176659
128
129         * fileapi/Blob.cpp:
130         (WebCore::Blob::Blob):
131         * fileapi/Blob.h:
132         * fileapi/File.cpp:
133         (WebCore::File::File):
134         
135             Replace copy constructor with a tagged constructor.
136
137 2017-09-12  Dean Jackson  <dino@apple.com>
138
139         [WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
140         https://bugs.webkit.org/show_bug.cgi?id=176771
141         <rdar://problem/34386621>
142
143         Reviewed by Antoine Quint.
144
145         The OpenGL context in VideoTextureCopierCV wasn't being restored to
146         the state it had before rendering a video to a texture. Specifically
147         the vertex attribute values were never recorded by the state saver.
148
149         Update the existing test of VideoTextureCopierCV so that it is
150         explicitly doing something different from the WebCore code, which
151         means that state will have to be correctly restored for the test
152         to pass.
153
154         * platform/graphics/cv/VideoTextureCopierCV.cpp:
155         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
156         to record the vertex attribute state once we know the location of the position attribute.
157         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
158         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
159         (WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
160         applicable vertex attribute state information.
161         * platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
162         to the GC3D rather than a pointer.
163
164 2017-09-12  Dean Jackson  <dino@apple.com>
165
166         [WebGL] accelerated texImage2D for video doesn't respect flipY
167         https://bugs.webkit.org/show_bug.cgi?id=176491
168         <rdar://problem/33833511>
169
170         Reviewed by Jer Noble.
171
172         (Take 2 - this was rolled out due to a test failure, but the following
173         commit will fix that)
174
175         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
176         back to software or fail to upload texture data. Fix this by intercepting
177         the texImage2D call, checking the orientation of the video, and running
178         a small shader program to flip it if necessary.
179
180         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
181         none of our media decoders support video with alpha, so unfortunately
182         this will have no visible change.
183
184         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
185                fast/canvas/webgl/texImage2D-video-flipY-true.html
186
187         * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
188         which is used to check the orientation of the source video.
189         * platform/cocoa/CoreVideoSoftLink.h:
190
191         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
192         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
193         now handle flipped or premultiplied requests.
194         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
195         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.
196
197         * platform/graphics/cv/VideoTextureCopierCV.cpp:
198         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
199         simply framebuffer.
200         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
201         if they were created.
202         (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
203         and the vertex buffer for drawing. Also records the location of the uniforms.
204         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
205         framebuffer object, and render the video texture into that framebuffer using a
206         shader that can flip the coordinates.
207         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
208         the state of the user's GraphicsContext3D while we're intercepting calls.
209         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
210         * platform/graphics/cv/VideoTextureCopierCV.h:
211
212         * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
213         compilation and attribute access. This avoids going through ANGLE.
214         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
215         (WebCore::GraphicsContext3D::compileShader):
216         (WebCore::GraphicsContext3D::compileShaderDirect):
217         (WebCore::GraphicsContext3D::getAttribLocationDirect):
218
219 2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>
220
221         [css-grid] Stretching auto tracks should be done as part of the track sizing algorithm
222         https://bugs.webkit.org/show_bug.cgi?id=176783
223
224         Reviewed by Sergio Villar Senin.
225
226         CSS WG has agreed to modify the track sizing algorithm to include
227         a new step: https://drafts.csswg.org/css-grid/#algo-stretch
228         We used to do the stretch of the "auto" tracks at the end of
229         the track sizing algorithm, however this change integrates it
230         into the algorithm itself as the last step.
231         See: https://github.com/w3c/csswg-drafts/issues/1150
232
233         The patch moves the method
234         RenderGrid::applyStretchAlignmentToTracksIfNeeded() to
235         GridTrackSizingAlgorithm::stretchAutoTracks().
236         And then modifies the grid track sizing algorithm to execute
237         the new step.
238
239         This patch uses the WPT test updated to check the new behavior.
240
241         * rendering/GridTrackSizingAlgorithm.cpp:
242         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): Initialize
243         the list of auto tracks.
244         (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks): Add
245         early return if there are not flexible tracks.
246         (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks): Code moved from
247         RenderGrid::applyStretchAlignmentToTracksIfNeeded().
248         (WebCore::GridTrackSizingAlgorithm::setup): Reset list of auto tracks.
249         (WebCore::GridTrackSizingAlgorithm::run): Add new step
250         stretchAutoTracks().
251         (WebCore::GridTrackSizingAlgorithm::reset): Reset auto tracks.
252         * rendering/GridTrackSizingAlgorithm.h: Add m_autoSizedTracksIndex.
253         * rendering/RenderGrid.cpp:
254         (WebCore::RenderGrid::layoutBlock): Avoid applying stretch here.
255         (WebCore::RenderGrid::contentAlignmentNormalBehaviorGrid): Make public.
256         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Moved to
257         GridTrackSizingAlgorithm::stretchAutoTracks().
258         * rendering/RenderGrid.h:
259
260 2017-09-12  Eric Carlson  <eric.carlson@apple.com>
261
262         Switch MediaPlayerPrivateAVFoundation to release logging
263         https://bugs.webkit.org/show_bug.cgi?id=176621
264         <rdar://problem/34335311>
265
266         Reviewed by Jer Noble.
267
268         * html/HTMLMediaElement.h:
269         * platform/graphics/MediaPlayer.cpp:
270         (WebCore::nullLogger):
271         (WebCore::MediaPlayer::mediaPlayerLogger):
272         * platform/graphics/MediaPlayer.h:
273         (WebCore::MediaPlayerClient::mediaPlayerLogIdentifier):
274         (WebCore::MediaPlayerClient::mediaPlayerLogger):
275         (WebCore::MediaPlayer::mediaPlayerLogIdentifier):
276         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
277         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
278         (WebCore::MediaPlayerPrivateAVFoundation::~MediaPlayerPrivateAVFoundation):
279         (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
280         (WebCore::MediaPlayerPrivateAVFoundation::tearDownVideoRendering):
281         (WebCore::MediaPlayerPrivateAVFoundation::load):
282         (WebCore::MediaPlayerPrivateAVFoundation::playabilityKnown):
283         (WebCore::MediaPlayerPrivateAVFoundation::prepareToPlay):
284         (WebCore::MediaPlayerPrivateAVFoundation::play):
285         (WebCore::MediaPlayerPrivateAVFoundation::pause):
286         (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime const):
287         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance):
288         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
289         (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const):
290         (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const):
291         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
292         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
293         (WebCore::MediaPlayerPrivateAVFoundation::timeChanged):
294         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
295         (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration):
296         (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
297         (WebCore::MediaPlayerPrivateAVFoundation::mainThreadCallback):
298         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
299         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
300         (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
301         (WebCore::MediaPlayerPrivateAVFoundation::logChannel const):
302         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
303         (WebCore::MediaPlayerPrivateAVFoundation::logClassName const):
304         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
305         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
306         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
307         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
308         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
309         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
310         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyImageGenerator):
311         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
312         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
313         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
314         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
315         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
316         (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
317         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
318         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const):
319         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
320         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
321         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
322         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
323         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
324         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
325         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus const):
326         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
327         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
328         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
329         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
330         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
331         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
332         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
333         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
334         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
335         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
336         (WebCore::MediaPlayerPrivateAVFoundationObjC::createOpenGLVideoOutput):
337         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyOpenGLVideoOutput):
338         (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
339         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
340         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues):
341         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
342         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
343         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
344         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
345         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
346         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
347         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
348         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
349         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
350         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
351         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
352         (WebCore::boolString): Deleted.
353
354 2017-09-12  Daniel Bates  <dabates@apple.com>
355
356         REGRESSION (r215784): The title of right-to-left pages are empty
357         https://bugs.webkit.org/show_bug.cgi?id=176746
358         <rdar://problem/34211419>
359
360         Reviewed by Brent Fulgham.
361
362         Left truncate a long right-to-left title.
363
364         Right-to-left text represents the visual ordering of text. Internally WebKit stores
365         right-to-left text identically to left-to-right text in memory. So, we can use the
366         same string operation to truncate right-to-left text as we do to truncate left-to-right
367         text.
368
369         * platform/text/StringWithDirection.h:
370         (WebCore::truncateFromEnd):
371
372 2017-09-12  Chris Fleizach  <cfleizach@apple.com>
373
374         AX: On generic container elements, WebKit should distinguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes
375         https://bugs.webkit.org/show_bug.cgi?id=170475
376         <rdar://problem/31439222>
377
378         Reviewed by Joanmarie Diggs.
379
380         Test: accessibility/title-tag-on-unimportant-elements-is-help-text.html
381
382         * accessibility/AccessibilityNodeObject.cpp:
383         (WebCore::AccessibilityNodeObject::helpText):
384         (WebCore::AccessibilityNodeObject::accessibilityDescription):
385         (WebCore::AccessibilityNodeObject::roleIgnoresTitle):
386         * accessibility/AccessibilityNodeObject.h:
387
388 2017-09-12  Brent Fulgham  <bfulgham@apple.com>
389
390         Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
391         https://bugs.webkit.org/show_bug.cgi?id=176578
392         <rdar://problem/33906231>
393
394         Reviewed by Alex Christensen.
395
396         Revise our "lookalike character" logic to include the Armenian Vo and Seh
397         characters, which can be mistaken for 'n' and 'v' when displayed in
398         certain fonts.
399
400         Tested by new API tests.
401
402         * platform/mac/WebCoreNSURLExtras.mm:
403         (WebCore::isArmenianLookalikeCharacter): Added utility function.
404         (WebCore::isArmenianScriptCharacter): Ditto.
405         (WebCore::isLookalikeCharacter): Handle Armenian-lookalike cases.
406
407 2017-09-12  Antti Koivisto  <antti@apple.com>
408
409         Remove RenderElement::isCSSAnimating boolean
410         https://bugs.webkit.org/show_bug.cgi?id=176779
411
412         Reviewed by Andreas Kling.
413
414         This optimization can be replaced with a simple style test that doesn't require keeping
415         two sources of truth in sync.
416
417         * page/animation/CSSAnimationController.cpp:
418         (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
419         (WebCore::CSSAnimationControllerPrivate::clear):
420
421             Can't test here as style might have become non-animating and we don't clear animation when that happens.
422             This is only called on renderer destruction so it is not an important optimization.
423
424         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
425         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
426         (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
427         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
428         (WebCore::CSSAnimationController::cancelAnimations):
429         (WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
430         (WebCore::CSSAnimationController::computeExtentOfAnimation const):
431         (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
432         (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
433
434             Test if the style has any animations. This is roughly equivalent of the old test.
435             (it is actually somewhat better as the boolean was never cleared on style changes)
436
437         * rendering/RenderElement.cpp:
438         (WebCore::RenderElement::RenderElement):
439         * rendering/RenderElement.h:
440         (WebCore::RenderElement::isCSSAnimating const): Deleted.
441         (WebCore::RenderElement::setIsCSSAnimating): Deleted.
442         * rendering/style/RenderStyle.h:
443         (WebCore::RenderStyle::hasAnimationsOrTransitions const):
444
445 2017-09-12  Ms2ger  <Ms2ger@igalia.com>
446
447         Disallow passing null data to uniform1uiv() and friends.
448         https://bugs.webkit.org/show_bug.cgi?id=176777
449
450         Reviewed by Sam Weinig.
451
452         This matches the specification as well as Gecko and Chromium.
453
454         Test: fast/canvas/webgl/webgl2/bindings.html
455
456         * html/canvas/WebGL2RenderingContext.idl:
457
458 2017-09-12  Sam Weinig  <sam@webkit.org>
459
460         [Cleanup] Follow up cleanup for DOMFormData implementation
461         https://bugs.webkit.org/show_bug.cgi?id=176740
462
463         Reviewed by Alex Christensen.
464
465         - Merges FormDataList into DOMFormData.
466         - Streamline / refactor FormData creation from DOMFormData.
467
468         * CMakeLists.txt:
469         * WebCore.xcodeproj/project.pbxproj:
470         * html/FormDataList.cpp: Removed.
471         * html/FormDataList.h: Removed.
472
473             Remove FormDataList.
474
475         * html/DOMFormData.cpp:
476         (WebCore::DOMFormData::DOMFormData):
477         (WebCore::DOMFormData::createFileEntry):
478         (WebCore::DOMFormData::append):
479         (WebCore::DOMFormData::set):
480         (WebCore::DOMFormData::Iterator::next):
481         * html/DOMFormData.h:
482         (WebCore::DOMFormData::items const):
483         (WebCore::DOMFormData::encoding const):
484
485             Merge FormDataList into DOMFormData. FormDataList's additional
486             appendData/appendBlob functions have been removed, and their
487             functionality inlined into DOMFormData's append functions. 
488
489             Adopted makeKeyValuePair in DOMFormData::Iterator::next().
490
491         * platform/network/FormData.cpp:
492         (WebCore::FormData::create):
493         (WebCore::FormData::createMultiPart):
494         (WebCore::normalizeStringData):
495         (WebCore::FormData::appendMultiPartFileValue):
496         (WebCore::FormData::appendMultiPartStringValue):
497         (WebCore::FormData::appendMultiPartKeyValuePairItems):
498         (WebCore::FormData::appendNonMultiPartKeyValuePairItems):
499         (WebCore::FormData::appendKeyValuePairItems): Deleted.
500         * platform/network/FormData.h:
501
502             Split-up appendKeyValuePairItems into separate multipart and non-multipart
503             functions, as the two edges of the branch didn't share much in common. Further
504             split out multipart file and multipart string appending, since they too did not
505             share that much in common and makes the code easier to follow. 
506
507             String value normalization has been moved entirely here (previously it was a member 
508             function of FormDataList) as FormData is the only user.
509
510         * xml/XMLHttpRequest.cpp:
511         (WebCore::XMLHttpRequest::send):
512         * loader/FormSubmission.cpp:
513         (WebCore::FormSubmission::create):
514         * Modules/fetch/FetchBody.cpp:
515         (WebCore::FetchBody::extract):
516         
517             Update for new FormData create functions which don't need the
518             encoding passed explicitly, since it is part of the DOMFormData.
519         
520         * html/BaseButtonInputType.cpp:
521         * html/BaseButtonInputType.h:
522         * html/BaseCheckableInputType.cpp:
523         * html/BaseCheckableInputType.h:
524         * html/FileInputType.cpp:
525         * html/FileInputType.h:
526         * html/FormAssociatedElement.h:
527         * html/HTMLButtonElement.cpp:
528         * html/HTMLButtonElement.h:
529         * html/HTMLFormControlElement.h:
530         * html/HTMLInputElement.cpp:
531         * html/HTMLInputElement.h:
532         * html/HTMLKeygenElement.cpp:
533         * html/HTMLKeygenElement.h:
534         * html/HTMLMeterElement.cpp:
535         * html/HTMLObjectElement.cpp:
536         * html/HTMLObjectElement.h:
537         * html/HTMLSelectElement.cpp:
538         * html/HTMLSelectElement.h:
539         * html/HTMLTextAreaElement.cpp:
540         * html/HTMLTextAreaElement.h:
541         * html/HiddenInputType.cpp:
542         * html/HiddenInputType.h:
543         * html/ImageInputType.cpp:
544         * html/ImageInputType.h:
545         * html/InputType.cpp:
546         * html/InputType.h:
547         * html/SubmitInputType.cpp:
548         * html/SubmitInputType.h:
549         * html/TextFieldInputType.cpp:
550         * html/TextFieldInputType.h:
551
552             Update to use DOMFormData directly, rather than the FormDataList, which 
553             has been removed.
554
555         * page/csp/ContentSecurityPolicy.cpp:
556
557             Remove unnecessary #include of unused (and now removed) FormDataList.h
558
559 2017-09-12  Zan Dobersek  <zdobersek@igalia.com>
560
561         [EME] Implement CDMInstanceClearKey::requestLicense()
562         https://bugs.webkit.org/show_bug.cgi?id=176773
563
564         Reviewed by Xabier Rodriguez-Calvar.
565
566         Implement the requestLicense() method for CDMInstanceClearKey. Per
567         the specification, the session ID must be a 32-bit numerical value.
568         A session ID value counter is thus kept in a static uint32_ object
569         and incremented upon each call of requestLicense(). Init data and
570         the session ID value are then embedded in the asynchronous dispatch
571         that invokes the callback. That invocation now also passes along the
572         init data, the session ID in string format, and Succeeded to now
573         indicate the operation was completed successfully.
574
575         No new tests -- expectations for the relevant tests are updated
576         to reflect the introduced changes.
577
578         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
579         (WebCore::CDMInstanceClearKey::requestLicense):
580
581 2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>
582
583         [css-grid] Use transferred size over content size for automatic minimum size
584         https://bugs.webkit.org/show_bug.cgi?id=176688
585
586         Reviewed by Sergio Villar Senin.
587
588         CSS WG has agreed to modify the spec so now the transferred size is used
589         (if it exists) independently if it's bigger or smaller
590         than the content size.
591         See: https://github.com/w3c/csswg-drafts/issues/1149
592
593         The spec text (https://drafts.csswg.org/css-grid/#min-size-auto):
594           "The automatic minimum size for a grid item in a given dimension is
595            its specified size if it exists, otherwise its transferred size
596            if that exists, else its content size"
597
598         This patch use the WPT tests updated to check the new behavior.
599
600         * rendering/GridTrackSizingAlgorithm.cpp:
601         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
602         Modified so it always returns the transferred size (if any).
603
604 2017-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
605
606         [Freetype] Doesn't support coloured fonts
607         https://bugs.webkit.org/show_bug.cgi?id=156579
608
609         Reviewed by Michael Catanzaro.
610
611         Covered by existing tests. This needs a large rebaseline that will be done in follow up commits.
612
613         * platform/graphics/FontCascade.h: Enable advance text rendering mode by default.
614         (WebCore::FontCascade::advancedTextRenderingMode const):
615         (WebCore::FontCascade::computeRequiresShaping const):
616         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
617         (WebCore::Font::platformInit): Do not get metrics from OS/2 table for non-scalable fonts.
618         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
619         (WebCore::harfBuzzGetGlyph): Use U8_APPEND_UNSAFE() instead of converting to a String and then encoding it with
620         UTF8Encoding().
621
622 2017-09-12  Frederic Wang  <fwang@igalia.com>
623
624         Remove unnecessary virtual keyword from JS test files
625         https://bugs.webkit.org/show_bug.cgi?id=176683
626
627         Reviewed by Simon Fraser.
628
629         JS bindings headers do not comply with the WebKit coding style since they use both the
630         "virtual" and "override" keywords. This patch modifies the generator script to only use
631         "override" and regenerates the bindings accordingly.
632
633         No new tests, behavior unchanged.
634
635         * bindings/scripts/CodeGeneratorJS.pm:
636         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
637         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h:
638         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h:
639         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
640         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
641         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
642
643 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
644
645         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
646         https://bugs.webkit.org/show_bug.cgi?id=176721
647         <rdar://problem/34373660>
648
649         Reviewed by Tim Horton.
650
651         Adds support for setting the drag lift preview frame in the case where DataTransfer.setDragImage is being used
652         to override the default drag preview. Currently, the frame of the drag preview we supply in this case is the
653         same as the bounds of the source element in root view coordinates, but this means that any custom drag image
654         the page supplies will be stretched to fill the frame of the source element. Instead, when handling a DHTML drag,
655         position the lift and cancel drag previews relative to the event location, respecting any drag offset specified
656         in setDragImage. The size of this preview matches the size of the drag image source (since this is all in root
657         view coordinates, this means the drag preview will also enlarge if the user pinches to zoom in). If a
658         disconnected image source element was provided, then we just fall back to the image size.
659
660         Additionally, renames DragItem's elementBounds to dragPreviewFrameInRootViewCoordinates to better reflect the
661         purpose of this variable. This patch also introduces API test plumbing to grab targeted drag previews from the
662         drag interaction delegate (i.e. WKContentView), and uses this in a new API test that checks the frame of the
663         resulting UITargetedDragPreview after initiating a drag in various circumstances (see changes in Tools/ for more
664         detail).
665
666         Test: DataInteractionTests.DragLiftPreviewDataTransferSetDragImage
667
668         * dom/DataTransfer.cpp:
669         (WebCore::DataTransfer::dragImageElement const):
670         * dom/DataTransfer.h:
671         * page/DragController.cpp:
672         (WebCore::dragLocForDHTMLDrag):
673
674         The logic to flip the y offset when computing the drag location is only relevant on Mac, but currently, this is
675         guarded by #if PLATFORM(COCOA), which causes the y offset to shift the drag image in the opposite direction on
676         iOS. To fix this, simply change the platform define to Mac.
677
678         (WebCore::DragController::doSystemDrag):
679         * platform/DragItem.h:
680         (WebCore::DragItem::encode const):
681         (WebCore::DragItem::decode):
682
683 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
684
685         [iOS WK2] Support tapping to add items to the current drag session in web content
686         https://bugs.webkit.org/show_bug.cgi?id=176421
687         <rdar://problem/31144674>
688
689         Reviewed by Tim Horton.
690
691         Refactors some drag initiation logic to handle starting a drag when data has already been written to the
692         pasteboard (in the case of iOS, WebItemProviderPasteboard). See annotated comments below for more detail.
693
694         Tests: DataInteractionTests.AdditionalLinkAndImageIntoContentEditable
695
696         * page/DragActions.h:
697         * page/DragController.cpp:
698         (WebCore::DragController::startDrag):
699
700         Add a HasNonDefaultPasteboardData argument here, and replace checks for !dataTransfer.pasteboard().hasData()
701         with checks for whether the argument is HasNonDefaultPasteboardData::No. These checks for Pasteboard::hasData()
702         currently prevent us from overwriting custom pasteboard data, in the case that the page has written pasteboard
703         data using the event's DataTransfer. However, in the case of adding additional drag items to the session, we
704         will already have pasteboard data, so these checks will prevent us from writing default data to the pasteboard.
705         See EventHandler::handleDrag for more detail.
706
707         * page/DragController.h:
708         * page/DragState.h:
709
710         Remove the draggedContentRange member from DragState. See below.
711
712         * page/EventHandler.cpp:
713         (WebCore::removeDraggedContentDocumentMarkersFromAllFramesInPage):
714
715         Simplify the handling of dragged content range markers. Instead of storing the DOM Range being dragged and
716         removing/repainting the range after dragging ends, just repaint the contentRenderer of the frame being dragged.
717         When the dragging session has completely ended, remove all dragged content ranges from the page's mainframe and
718         all of its subframes, and repaint everything.
719
720         (WebCore::EventHandler::dragCancelled):
721         (WebCore::EventHandler::didStartDrag):
722         (WebCore::EventHandler::dragSourceEndedAt):
723
724         Add a MayExtendDragSession argument, indicating whether or not the web process will attempt to continue the drag
725         session, in which case EventHandler::dragSourceEndedAt should not remove any existing dragged content range
726         document markers.
727
728         (WebCore::EventHandler::dispatchDragStartEvent):
729
730         Helper method to dispatch a `dragstart` event, return whether or not to proceed with the drag, and also compute
731         (as an outparam) whether or not custom pasteboard data was written during the event.
732
733         (WebCore::EventHandler::handleDrag):
734
735         If custom data was written during `dragstart`, pass along HasNonDefaultPasteboardData::Yes when calling
736         DragController::startDrag.
737
738         (WebCore::repaintContentsOfRange): Deleted.
739         * page/EventHandler.h:
740         * page/ios/EventHandlerIOS.mm:
741         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
742         * platform/Pasteboard.h:
743         * platform/ios/PasteboardIOS.mm:
744         (WebCore::Pasteboard::changeCount const):
745         * platform/ios/WebItemProviderPasteboard.mm:
746         (-[WebItemProviderPasteboard setItemProviders:]):
747
748         Stop clearing out the staged item provider registration list when setting item providers. After refactoring in
749         r221595, staged registration lists are now automatically cleared out when (1) the drag-and-drop interaction
750         state is cleared out in the UI process, or (2) when the registration list is taken by WKContentView (see
751         -takeRegistrationList) when generating an item provider.
752
753         * platform/mac/PasteboardMac.mm:
754         (WebCore::Pasteboard::changeCount const):
755
756         Add a changeCount method to Pasteboard on Cocoa platforms (Mac, iOS) which support changeCount natively. In
757         theory, there's no reason Windows, GTK and WPE ports can't also implement a similar mechanism in
758         PlatformPasteboard, but this isn't needed for anything yet. Upon dragstart, it is safe to assume that the
759         pasteboard has been cleared on these platforms, so checking for Pasteboard::hasData (as we do for all platforms
760         currently) is sufficient.
761
762 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
763
764         Unreviewed, rolling out r221762.
765
766         This change caused flakiness in a webgl LayoutTest.
767
768         Reverted changeset:
769
770         "[WebGL] accelerated texImage2D for video doesn't respect
771         flipY"
772         https://bugs.webkit.org/show_bug.cgi?id=176491
773         http://trac.webkit.org/changeset/221762
774
775 2017-09-11  Per Arne Vollan  <pvollan@apple.com>
776
777         [Win] Add Modules/cache to list of forwarding headers folders.
778         https://bugs.webkit.org/show_bug.cgi?id=176737
779
780         Reviewed by Alex Christensen.
781
782         * PlatformWin.cmake:
783
784 2017-09-11  Joanmarie Diggs  <jdiggs@igalia.com>
785
786         AX: [ATK] aria-autocomplete not exposed on comboboxes
787         https://bugs.webkit.org/show_bug.cgi?id=176724
788
789         Reviewed by Chris Fleizach.
790
791         Add a check to AccessibilityObject::supportsARIAAutoComplete() for
792         combobox because isARIATextControl() returns false for that role.
793
794         Add new combobox test cases to existing aria-autocomplete.html test.
795
796         * accessibility/AccessibilityObject.cpp:
797         (WebCore::AccessibilityObject::supportsARIAAutoComplete const):
798
799 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
800
801         Unreviewed, rolling out r221854.
802
803         The test added with this change fails on 32-bit JSC bots.
804
805         Reverted changeset:
806
807         "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
808         https://bugs.webkit.org/show_bug.cgi?id=176010
809         http://trac.webkit.org/changeset/221854
810
811 2017-09-11  Dean Jackson  <dino@apple.com>
812
813         [WebGL macOS] No need to multisample when blitting into WebGLLayer
814         https://bugs.webkit.org/show_bug.cgi?id=176666
815         <rdar://problem/27774626>
816
817         Reviewed by Sam Weinig.
818
819         We were seeing performance profiles suggesting WebGL was
820         doing 8x MSAA, even though we explicitly set it to only
821         use 4 samples in the GLPixelFormatObj used to create
822         the WebGL CGLContextObj. However, that same CGLPixelFormatObj
823         was also used for the WebGLLayer's CGLContextObj, meaning the
824         blit of the WebGL FBO into the WebGLLayer's backing store was
825         multisampling as well -- so an extra 4 samples on top of the
826         original 4, making it look like we were doing 8x.
827
828         This was obviously unnecessary, since we already have the
829         multisampled FBO and just want to copy it, as is, into the layer.
830
831         Now, instead of copying the CGLPixelFormatObj, we create
832         a new one and copy most of the attributes, leaving out
833         the multisample flags (and the depth buffer, since we're
834         only doing 2d blits).
835
836         Covered by existing WebGL tests, since there should be no
837         visible change.
838
839         * platform/graphics/cocoa/WebGLLayer.mm:
840         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Create a new
841         CGLPixelFormatObj that copies most of the values from
842         the corresponding object on the WebGL's backing CGLContextObj.
843
844 2017-09-11  Zan Dobersek  <zdobersek@igalia.com>
845
846         [EME] ClearKey: implement CDMInstanceClearKey state modifiers, callback dispatches
847         https://bugs.webkit.org/show_bug.cgi?id=176687
848
849         Reviewed by Xabier Rodriguez-Calvar.
850
851         Implement the state modification methods on the CDMInstanceClearKey class.
852         Initialization method is a no-op, but returns Succeeded. Distinctive
853         identifier and persistent state setters return Succeeded if the passed-in
854         value is false. setServerCertificate() still returns Failed due to server
855         certificates not being supported in this ClearKey implementation.
856
857         The license and session operation methods are also implemented, but for
858         now the implementations simply schedule a main thread dispatch that
859         invokes the callback with failure-indicating values. This avoids various
860         tests timing out, instead preferring that the tests for now fail with an
861         exception (in most cases NotSupportedError).
862
863         No new tests -- relevant tests have baselines updated.
864
865         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
866         (WebCore::CDMInstanceClearKey::CDMInstanceClearKey):
867         (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
868         (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
869         (WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
870         (WebCore::CDMInstanceClearKey::setServerCertificate):
871         (WebCore::CDMInstanceClearKey::requestLicense):
872         (WebCore::CDMInstanceClearKey::updateLicense):
873         (WebCore::CDMInstanceClearKey::loadSession):
874         (WebCore::CDMInstanceClearKey::closeSession):
875         (WebCore::CDMInstanceClearKey::removeSessionData):
876         * platform/encryptedmedia/clearkey/CDMClearKey.h:
877
878 2017-09-11  Alex Christensen  <achristensen@webkit.org>
879
880         Modernize BoxExtent into RectEdges
881         https://bugs.webkit.org/show_bug.cgi?id=176437
882
883         Reviewed by Simon Fraser.
884
885         And give it its own header.
886         No change in behavior.
887
888         * WebCore.xcodeproj/project.pbxproj:
889         * css/CSSProperty.cpp:
890         (WebCore::resolveToPhysicalProperty):
891         (WebCore::CSSProperty::resolveDirectionAwareProperty):
892         * platform/LengthBox.h:
893         (WebCore::LengthBox::LengthBox):
894         (WebCore::BoxExtent::BoxExtent): Deleted.
895         (WebCore::BoxExtent::at): Deleted.
896         (WebCore::BoxExtent::top): Deleted.
897         (WebCore::BoxExtent::right): Deleted.
898         (WebCore::BoxExtent::bottom): Deleted.
899         (WebCore::BoxExtent::left): Deleted.
900         (WebCore::BoxExtent::at const): Deleted.
901         (WebCore::BoxExtent::top const): Deleted.
902         (WebCore::BoxExtent::right const): Deleted.
903         (WebCore::BoxExtent::bottom const): Deleted.
904         (WebCore::BoxExtent::left const): Deleted.
905         (WebCore::BoxExtent::setAt): Deleted.
906         (WebCore::BoxExtent::setTop): Deleted.
907         (WebCore::BoxExtent::setRight): Deleted.
908         (WebCore::BoxExtent::setBottom): Deleted.
909         (WebCore::BoxExtent::setLeft): Deleted.
910         (WebCore::BoxExtent::before): Deleted.
911         (WebCore::BoxExtent::after): Deleted.
912         (WebCore::BoxExtent::start): Deleted.
913         (WebCore::BoxExtent::end): Deleted.
914         (WebCore::BoxExtent::before const): Deleted.
915         (WebCore::BoxExtent::after const): Deleted.
916         (WebCore::BoxExtent::start const): Deleted.
917         (WebCore::BoxExtent::end const): Deleted.
918         (WebCore::BoxExtent::setBefore): Deleted.
919         (WebCore::BoxExtent::setAfter): Deleted.
920         (WebCore::BoxExtent::setStart): Deleted.
921         (WebCore::BoxExtent::setEnd): Deleted.
922         (WebCore::BoxExtent::operator== const): Deleted.
923         (WebCore::BoxExtent::operator!= const): Deleted.
924         * platform/RectEdges.h: Added.
925         (WebCore::RectEdges::RectEdges):
926         (WebCore::RectEdges::at):
927         (WebCore::RectEdges::top):
928         (WebCore::RectEdges::right):
929         (WebCore::RectEdges::bottom):
930         (WebCore::RectEdges::left):
931         (WebCore::RectEdges::at const):
932         (WebCore::RectEdges::top const):
933         (WebCore::RectEdges::right const):
934         (WebCore::RectEdges::bottom const):
935         (WebCore::RectEdges::left const):
936         (WebCore::RectEdges::setAt):
937         (WebCore::RectEdges::setTop):
938         (WebCore::RectEdges::setRight):
939         (WebCore::RectEdges::setBottom):
940         (WebCore::RectEdges::setLeft):
941         (WebCore::RectEdges::before):
942         (WebCore::RectEdges::after):
943         (WebCore::RectEdges::start):
944         (WebCore::RectEdges::end):
945         (WebCore::RectEdges::before const):
946         (WebCore::RectEdges::after const):
947         (WebCore::RectEdges::start const):
948         (WebCore::RectEdges::end const):
949         (WebCore::RectEdges::setBefore):
950         (WebCore::RectEdges::setAfter):
951         (WebCore::RectEdges::setStart):
952         (WebCore::RectEdges::setEnd):
953         (WebCore::RectEdges::operator== const):
954         (WebCore::RectEdges::operator!= const):
955         * platform/graphics/ca/TileController.cpp:
956         (WebCore::TileController::setHasMargins):
957         * platform/graphics/ca/TileController.h:
958         * platform/text/WritingMode.h:
959         (WebCore::isHorizontalPhysicalSide):
960         * rendering/style/NinePieceImage.cpp:
961         (WebCore::NinePieceImage::isEmptyPieceRect):
962         * rendering/style/NinePieceImage.h:
963         (WebCore::imagePieceHorizontalSide):
964         (WebCore::imagePieceVerticalSide):
965         * rendering/style/RenderStyle.cpp:
966         (WebCore::RenderStyle::getShadowInsetExtent const):
967
968 2017-09-11  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
969
970         [WinCairo] Fix the wincairo build after r221839
971         https://bugs.webkit.org/show_bug.cgi?id=176681
972
973         Reviewed by Per Arne Vollan.
974
975         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
976         (WebCore::ResourceHandleCurlDelegate::setupPOST):
977
978 2017-09-11  Andy Estes  <aestes@apple.com>
979
980         [Mac] Upstream QTKit-related WebKitSystemInterface functions
981         https://bugs.webkit.org/show_bug.cgi?id=176472
982
983         Reviewed by Eric Carlson.
984
985         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
986         (WebCore::disableComponentsOnce):
987         (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
988         (WebCore::MediaPlayerPrivateQTKit::hasClosedCaptions const):
989         (WebCore::MediaPlayerPrivateQTKit::setClosedCaptionsVisible):
990         (WebCore::selectPreferredAlternateTrackForMediaType):
991         (WebCore::selectPreferredAlternates):
992         (WebCore::MediaPlayerPrivateQTKit::updateStates):
993         (WebCore::mimeModernTypesCache):
994         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache):
995         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
996         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins):
997         (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin const):
998         (WebCore::MediaPlayerPrivateQTKit::movieLoadType const):
999         (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData const):
1000         * platform/mac/WebCoreSystemInterface.h:
1001         * platform/mac/WebCoreSystemInterface.mm:
1002         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1003         (createMediaUIControl):
1004         (createControlWithMediaUIControlType):
1005         (createMediaUIBackgroundView):
1006         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
1007
1008 2017-09-08  Andy Estes  <aestes@apple.com>
1009
1010         Try to fix the Internal El Capitan build after r221773.
1011
1012         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1013         (WebCore::mimeModernTypesCache):
1014
1015 2017-09-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1016
1017         [WPE] Bump freetype version to 2.8.0
1018         https://bugs.webkit.org/show_bug.cgi?id=176501
1019
1020         Reviewed by Michael Catanzaro.
1021
1022         Enable back the changes done by r221670 that were disabled for WPE on r221719.
1023
1024         Covered by existing tests.
1025
1026         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1027         (WebCore::scaledFontWithoutMetricsHinting):
1028         (WebCore::Font::platformInit):
1029
1030 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1031
1032         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1033         https://bugs.webkit.org/show_bug.cgi?id=176010
1034
1035         Reviewed by Filip Pizlo.
1036
1037         * platform/network/curl/CurlJobManager.cpp:
1038         (WebCore::CurlJobList::finishJobs):
1039
1040 2017-09-10  Zan Dobersek  <zdobersek@igalia.com>
1041
1042         [GStreamer] Drop libgcrypt initialization in webkit_media_clear_key_decrypt_init()
1043         https://bugs.webkit.org/show_bug.cgi?id=176656
1044
1045         Reviewed by Michael Catanzaro.
1046
1047         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1048         (webkit_media_clear_key_decrypt_init): Don't re-initialize libgcrypt here
1049         since that's already done in the WebProcess main(), and the calls here
1050         only result in libgcrypt writing out 'Oops' warnings on stderr.
1051
1052 2017-09-10  Mark Lam  <mark.lam@apple.com>
1053
1054         Fix all ExceptionScope verification failures in JavaScriptCore.
1055         https://bugs.webkit.org/show_bug.cgi?id=176662
1056         <rdar://problem/34352085>
1057
1058         Reviewed by Filip Pizlo.
1059
1060         No new tests because this is covered by existing tests with the JSC_validateExceptionChecks=true enabled.
1061
1062         * bindings/js/JSCustomElementInterface.cpp:
1063         (WebCore::JSCustomElementInterface::tryToConstructCustomElement):
1064         * bindings/js/JSCustomElementRegistryCustom.cpp:
1065         (WebCore::whenDefinedPromise):
1066         * bindings/js/JSDOMConvertRecord.h:
1067         * bindings/js/JSDOMMapLike.cpp:
1068         (WebCore::createBackingMap):
1069         * bindings/js/JSDOMPromiseDeferred.cpp:
1070         (WebCore::DeferredPromise::callFunction):
1071         (WebCore::DeferredPromise::reject):
1072         * bindings/js/JSDOMPromiseDeferred.h:
1073         (WebCore::callPromiseFunction):
1074
1075 2017-09-10  Frederic Wang  <fwang@igalia.coml>
1076
1077         Make RenderLayerCompositor always use isRootLayer()
1078         https://bugs.webkit.org/show_bug.cgi?id=176591
1079
1080         Reviewed by Darin Adler.
1081
1082         RenderLayerCompositor contains a few comparisons of the form &layer == m_renderView.layer().
1083         This patch replaces them with "layer.isRootLayer()" which simply verifies that "layer" is
1084         associated to the one (and only one) RenderView of the RenderLayerCompositor. It makes things
1085         more readable and more consistent with the rest of the file.
1086
1087         No new tests, behavior unchanged.
1088
1089         * rendering/RenderLayerCompositor.cpp:
1090         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
1091         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
1092         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1093
1094 2017-09-09  Sam Weinig  <sam@webkit.org>
1095
1096         Finish off the FormData implementation
1097         https://bugs.webkit.org/show_bug.cgi?id=176659
1098
1099         Reviewed by Darin Adler.
1100
1101         * fileapi/Blob.cpp:
1102         * fileapi/Blob.h:
1103         * fileapi/File.cpp:
1104         * fileapi/File.h:
1105
1106             Add constructors / create functions for making File objects
1107             from an existing Blob or File with an override name.
1108
1109         * html/DOMFormData.cpp:
1110         * html/DOMFormData.h:
1111
1112             Add missing operations and iterator implementation
1113             and bring append up to spec by no ignoring empty names.
1114
1115         * html/DOMFormData.idl:
1116
1117             Bring IDL up to spec. Leave its exposure to just the window for
1118             now, as FormData currently depends on the Document/Page for replace
1119             file generation and therefore cannot operate in a worker.
1120
1121         * html/FormDataList.cpp:
1122         * html/FormDataList.h:
1123
1124             Changes FormDataList::Item to a String key and Variant<RefPtr<File>, String>
1125             data, matching spec concepts more cleanly. Normalization / encoding has also
1126             been made lazy, and now does not happen until creating a FormData from the
1127             FormDataList.
1128
1129             Since we now store Files, rather than Blobs, we follow the spec's 'create an 
1130             entry' algorithm to convert Blobs into Files with the same backing bytes. This
1131             was previously done as part of FormData::appendKeyValuePairItems.
1132
1133         * html/HTMLKeygenElement.cpp:
1134         (WebCore::HTMLKeygenElement::appendFormData):
1135
1136             Remove unnecessary conversion to utf8, the data is base64 encoded, allowing
1137             us to remove an overload of appendData that took a CString.
1138
1139         * inspector/InspectorNetworkAgent.cpp:
1140         (WebCore::buildObjectForResourceRequest):
1141
1142             Update for new signature of FormData::flatten() which now
1143             returns a Vector, rather than takes one in.
1144
1145         * platform/network/FormData.h:
1146         * platform/network/FormData.cpp:
1147         (WebCore::FormData::FormData):
1148         (WebCore::FormData::create):
1149         (WebCore::FormData::createMultiPart):
1150         
1151             Cleanup redundancy by using auto.
1152         
1153         (WebCore::FormData::appendKeyValuePairItems):
1154         
1155             Updated to handle new FormDataList item format (e.g. pairs of key / data) allowing
1156             us to remove two-by-two iteration. Some complexity was removed around Blobs, as
1157             FormDataList now always creates File. 
1158
1159             Since FormDataList no longer eagerly encodes / normalizes the keys and string data
1160             values, we now perform those operations here.
1161         
1162         (WebCore::FormData::expandDataStore):
1163         (WebCore::appendBlobResolved):
1164         (WebCore::FormData::resolveBlobReferences):
1165         (WebCore::FormData::generateFiles):
1166         (WebCore::FormData::hasGeneratedFiles const):
1167         (WebCore::FormData::hasOwnedGeneratedFiles const):
1168         (WebCore::FormData::removeGeneratedFilesIfNeeded):
1169
1170             Adopt auto and modern for-in loops.
1171
1172         (WebCore::FormData::flatten const):
1173         (WebCore::FormData::flattenToString const):
1174
1175             Update flatten to return a Vector, rather than take it in.
1176
1177 2017-09-10  Darin Adler  <darin@apple.com>
1178
1179         Refactor Document::updateTitleElement to use traits instead of function pointers
1180         https://bugs.webkit.org/show_bug.cgi?id=176671
1181
1182         Reviewed by Sam Weinig.
1183
1184         This template implementation seems slightly more readable and
1185         also likely to be slightly more efficient. Also takes a suggestion
1186         from Antti of factoring out the "select a new title element" into a
1187         function, which is a natural thing to do in this version.
1188
1189         * dom/Document.cpp:
1190         (WebCore::TitleTraits<HTMLTitleElement>::isInEligibleLocation): Added.
1191         (WebCore::TitleTraits<HTMLTitleElement>::findTitleElement): Added.
1192         (WebCore::TitleTraits<SVGTitleElement>::isInEligibleLocation): Added.
1193         (WebCore::TitleTraits<SVGTitleElement>::findTitleElement): Added.
1194         (WebCore::selectNewTitleElement): Added.
1195         (WebCore::findHTMLTitle): Deleted.
1196         (WebCore::isHTMLTitle): Deleted.
1197         (WebCore::isHTMLTitleEligible): Deleted.
1198         (WebCore::findSVGTitle): Deleted.
1199         (WebCore::isSVGTitle): Deleted.
1200         (WebCore::isSVGTitleEligible): Deleted.
1201         (WebCore::Document::updateTitleElement): Call selectNewTitleElement
1202         instead of having the logic here.
1203
1204 2017-09-07  Darin Adler  <darin@apple.com>
1205
1206         Fix double resolve assertion in FontFaceSet seen while running tests
1207         https://bugs.webkit.org/show_bug.cgi?id=176525
1208
1209         Reviewed by Brent Fulgham.
1210
1211         * css/FontFaceSet.cpp:
1212         (WebCore::FontFaceSet::FontFaceSet): Only resolve the promise if the CSSFontFaceSet
1213         is already loaded. Otherwise, we will resolve it later when it calls completedLoading.
1214
1215 2017-09-08  Dean Jackson  <dino@apple.com>
1216
1217         gl.detachShader breaks shader program
1218         https://bugs.webkit.org/show_bug.cgi?id=137689
1219         <rdar://problem/34025056>
1220
1221         Reviewed by Sam Weinig.
1222
1223         It should be possible to compile shaders, attach them to a program,
1224         link the program, detach the shaders, delete the shaders, and then
1225         ask for the uniform and attribute locations. That is, once you've
1226         linked, the shaders can be thrown away.
1227
1228         We were using the attached shaders to look up uniform locations, so
1229         we now keep around a separate map that remembers what shaders were
1230         attached when the program links.
1231
1232         This fixes the bug, but the whole area is still a bit messy. For one,
1233         we're keeping around all the shader information even after it is
1234         no longer used.
1235         See https://bugs.webkit.org/show_bug.cgi?id=98204
1236
1237         Test: fast/canvas/webgl/detachShader-before-accessing-uniform.html
1238
1239         * platform/graphics/GraphicsContext3D.h: Add another map to remember
1240         what shaders were used when a program was linked.
1241         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1242         (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap): New helper
1243         to look up a name in our source maps.
1244         (WebCore::GraphicsContext3D::mappedSymbolName): Use the helper, and look
1245         at linked shaders if there are no attached shaders.
1246         (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap): Does the
1247         reverse of the above.
1248         (WebCore::GraphicsContext3D::originalSymbolName):
1249         (WebCore::GraphicsContext3D::linkProgram): Add to the new map.
1250         (WebCore::GraphicsContext3D::deleteProgram): Delete the program from
1251         our shader entries.
1252
1253 2017-09-09  Mark Lam  <mark.lam@apple.com>
1254
1255         Avoid duplicate computations of ExecState::vm().
1256         https://bugs.webkit.org/show_bug.cgi?id=176647
1257
1258         Reviewed by Saam Barati.
1259
1260         No new tests because this is only a refactoring patch.  There is no
1261         significant behavior change.
1262
1263         * Modules/mediastream/SDPProcessor.cpp:
1264         (WebCore::SDPProcessor::callScript const):
1265         * Modules/plugins/QuickTimePluginReplacement.mm:
1266         (WebCore::QuickTimePluginReplacement::installReplacement):
1267         * bindings/js/JSCallbackData.cpp:
1268         (WebCore::JSCallbackData::invokeCallback):
1269         * bindings/js/JSCustomElementInterface.cpp:
1270         (WebCore::constructCustomElementSynchronously):
1271         (WebCore::JSCustomElementInterface::upgradeElement):
1272         (WebCore::JSCustomElementInterface::invokeCallback):
1273         * bindings/js/JSDOMConvertRecord.h:
1274         * bindings/js/JSDOMMapLike.h:
1275         (WebCore::forwardSizeToMapLike):
1276         (WebCore::forwardEntriesToMapLike):
1277         (WebCore::forwardKeysToMapLike):
1278         (WebCore::forwardValuesToMapLike):
1279         (WebCore::forwardGetToMapLike):
1280         (WebCore::forwardHasToMapLike):
1281         * bindings/js/JSDOMWindowCustom.cpp:
1282         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1283         (WebCore::addCrossOriginWindowOwnPropertyNames):
1284         * bindings/js/JSDocumentCustom.cpp:
1285         (WebCore::reportMemoryForDocumentIfFrameless):
1286         * bindings/js/JSErrorHandler.cpp:
1287         (WebCore::JSErrorHandler::handleEvent):
1288         * bindings/js/JSImageDataCustom.cpp:
1289         (WebCore::toJSNewlyCreated):
1290         * bindings/js/JSLocationCustom.cpp:
1291         (WebCore::getOwnPropertySlotCommon):
1292         (WebCore::putCommon):
1293         (WebCore::addCrossOriginLocationPropertyNames):
1294         (WebCore::addCrossOriginLocationOwnPropertyNames):
1295         (WebCore::JSLocation::defineOwnProperty):
1296         (WebCore::JSLocationPrototype::put):
1297         (WebCore::JSLocationPrototype::defineOwnProperty):
1298         * bindings/js/SerializedScriptValue.cpp:
1299         (WebCore::CloneSerializer::serialize):
1300         * bindings/scripts/CodeGeneratorJS.pm:
1301         (GenerateImplementation):
1302         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1303         (WebCore::setJSInterfaceNameConstructor):
1304         * bindings/scripts/test/JS/JSMapLike.cpp:
1305         (WebCore::setJSMapLikeConstructor):
1306         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1307         (WebCore::setJSReadOnlyMapLikeConstructor):
1308         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1309         (WebCore::setJSTestActiveDOMObjectConstructor):
1310         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1311         (WebCore::setJSTestCEReactionsConstructor):
1312         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1313         (WebCore::setJSTestCEReactionsStringifierConstructor):
1314         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1315         (WebCore::setJSTestCallTracerConstructor):
1316         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1317         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
1318         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1319         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
1320         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
1321         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1322         (WebCore::setJSTestDOMJITConstructor):
1323         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1324         (WebCore::setJSTestEnabledBySettingConstructor):
1325         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1326         (WebCore::setJSTestEventConstructorConstructor):
1327         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1328         (WebCore::setJSTestEventTargetConstructor):
1329         * bindings/scripts/test/JS/JSTestException.cpp:
1330         (WebCore::setJSTestExceptionConstructor):
1331         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1332         (WebCore::setJSTestGenerateIsReachableConstructor):
1333         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1334         (WebCore::setJSTestGlobalObjectConstructor):
1335         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1336         (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
1337         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1338         (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
1339         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1340         (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
1341         * bindings/scripts/test/JS/JSTestInterface.cpp:
1342         (WebCore::setJSTestInterfaceConstructor):
1343         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1344         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
1345         * bindings/scripts/test/JS/JSTestIterable.cpp:
1346         (WebCore::setJSTestIterableConstructor):
1347         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1348         (WebCore::setJSTestJSBuiltinConstructorConstructor):
1349         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1350         (WebCore::setJSTestMediaQueryListListenerConstructor):
1351         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1352         (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
1353         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1354         (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
1355         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1356         (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
1357         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1358         (WebCore::setJSTestNamedConstructorConstructor):
1359         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1360         (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
1361         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1362         (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
1363         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1364         (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
1365         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1366         (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
1367         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1368         (WebCore::setJSTestNamedGetterCallWithConstructor):
1369         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1370         (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
1371         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1372         (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
1373         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1374         (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
1375         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1376         (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
1377         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1378         (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
1379         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1380         (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
1381         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1382         (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
1383         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1384         (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
1385         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1386         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
1387         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1388         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
1389         * bindings/scripts/test/JS/JSTestNode.cpp:
1390         (WebCore::setJSTestNodeConstructor):
1391         * bindings/scripts/test/JS/JSTestObj.cpp:
1392         (WebCore::setJSTestObjConstructor):
1393         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1394         (WebCore::setJSTestOverloadedConstructorsConstructor):
1395         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1396         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
1397         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1398         (WebCore::setJSTestOverrideBuiltinsConstructor):
1399         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1400         (WebCore::setJSTestPluginInterfaceConstructor):
1401         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1402         (WebCore::setJSTestPromiseRejectionEventConstructor):
1403         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1404         (WebCore::setJSTestSerializationConstructor):
1405         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1406         (WebCore::setJSTestSerializationIndirectInheritanceConstructor):
1407         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1408         (WebCore::setJSTestSerializationInheritConstructor):
1409         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1410         (WebCore::setJSTestSerializationInheritFinalConstructor):
1411         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1412         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
1413         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1414         (WebCore::setJSTestStringifierConstructor):
1415         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1416         (WebCore::setJSTestStringifierAnonymousOperationConstructor):
1417         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1418         (WebCore::setJSTestStringifierNamedOperationConstructor):
1419         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1420         (WebCore::setJSTestStringifierOperationImplementedAsConstructor):
1421         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1422         (WebCore::setJSTestStringifierOperationNamedToStringConstructor):
1423         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1424         (WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
1425         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1426         (WebCore::setJSTestStringifierReadWriteAttributeConstructor):
1427         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1428         (WebCore::setJSTestTypedefsConstructor):
1429         * bridge/NP_jsobject.cpp:
1430         (_NPN_SetProperty):
1431         (_NPN_RemoveProperty):
1432         (_NPN_Enumerate):
1433         * bridge/c/c_instance.cpp:
1434         (JSC::Bindings::CRuntimeMethod::create):
1435         * bridge/objc/WebScriptObject.mm:
1436         (-[WebScriptObject setValue:forKey:]):
1437         (-[WebScriptObject removeWebScriptKey:]):
1438         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
1439         * bridge/objc/objc_instance.mm:
1440         (ObjCRuntimeMethod::create):
1441         * bridge/objc/objc_runtime.h:
1442         (JSC::Bindings::ObjcFallbackObjectImp::create):
1443         * bridge/runtime_array.cpp:
1444         (JSC::RuntimeArray::getOwnPropertyNames):
1445         (JSC::RuntimeArray::getOwnPropertySlot):
1446         (JSC::RuntimeArray::put):
1447         * bridge/runtime_array.h:
1448         (JSC::RuntimeArray::create):
1449         * bridge/runtime_method.cpp:
1450         (JSC::RuntimeMethod::getOwnPropertySlot):
1451         * bridge/runtime_method.h:
1452         * html/HTMLMediaElement.cpp:
1453         (WebCore::HTMLMediaElement::updateCaptionContainer):
1454         (WebCore::HTMLMediaElement::setControllerJSProperty):
1455         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1456         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
1457         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
1458         * html/HTMLPlugInImageElement.cpp:
1459         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
1460         * testing/Internals.cpp:
1461         (WebCore::Internals::cloneArrayBuffer):
1462
1463 2017-09-09  Zan Dobersek  <zdobersek@igalia.com>
1464
1465         [EME] MediaKeySession: handle MediaKeys association through a WeakPtr
1466         https://bugs.webkit.org/show_bug.cgi?id=176584
1467
1468         Reviewed by Xabier Rodriguez-Calvar.
1469
1470         Don't keep a raw pointer to the originating MediaKeys object in
1471         MediaKeySession that gets nulled out once MediaKeys is destroyed.
1472         Instead, make MediaKeys a WeakPtrFactory and use a WeakPtr<MediaKeys>
1473         object to maintain the association between MediaKeySession and
1474         MediaKeys.
1475
1476         * Modules/encryptedmedia/MediaKeySession.cpp:
1477         (WebCore::MediaKeySession::create):
1478         (WebCore::MediaKeySession::MediaKeySession):
1479         (WebCore::MediaKeySession::detachKeys): Deleted.
1480         * Modules/encryptedmedia/MediaKeySession.h:
1481         * Modules/encryptedmedia/MediaKeys.cpp:
1482         (WebCore::MediaKeys::MediaKeys):
1483         (WebCore::MediaKeys::createSession):
1484         (WebCore::MediaKeys::~MediaKeys): Deleted.
1485         * Modules/encryptedmedia/MediaKeys.h:
1486
1487 2017-09-09  Zan Dobersek  <zdobersek@igalia.com>
1488
1489         [GStreamer] Missing GRefPtr adoptions in MediaPlayerPrivateGStreamerBase, PlaybackPipeline
1490         https://bugs.webkit.org/show_bug.cgi?id=176646
1491
1492         Reviewed by Carlos Garcia Campos.
1493
1494         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1495         (WebCore::registerWebKitGStreamerElements): Adopt the return value
1496         of gst_element_factory_find(), which is transferred in full.
1497         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1498         (WebCore::PlaybackPipeline::flush): Adopt the return values
1499         of gst_element_get_static_pad() and gst_pad_get_peer(), both being
1500         transferred in full.
1501
1502 2017-09-09  Frederic Wang  <fwang@igalia.com>
1503
1504         Use RenderLayerBacking::renderer() when possible
1505         https://bugs.webkit.org/show_bug.cgi?id=176585
1506
1507         The private member renderer() is a shorthand for m_owningLayer.renderer(). This patch uses
1508         it in RenderLayerBacking when possible.
1509
1510         Reviewed by Carlos Garcia Campos.
1511
1512         No new tests, behavior not changed.
1513
1514         * rendering/RenderLayerBacking.cpp:
1515         (WebCore::RenderLayerBacking::updateGeometry):
1516         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
1517         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1518
1519 2017-09-08  Sam Weinig  <sam@webkit.org>
1520
1521         Replace JS builtin implementation of the FetchResponse constructor with a C++ one
1522         https://bugs.webkit.org/show_bug.cgi?id=176627
1523
1524         Reviewed by Alex Christensen.
1525
1526         Removes the last of the Fetch related JS builtin code.
1527
1528         * CMakeLists.txt:
1529         * DerivedSources.make:
1530         * WebCore.xcodeproj/project.pbxproj:
1531         * Modules/fetch/FetchInternals.js: Removed.
1532         * Modules/fetch/FetchResponse.js: Removed.
1533         
1534             Remove FetchInternals.js and FetchResponse.js.
1535
1536
1537         * Modules/fetch/FetchBody.idl:
1538         * Modules/fetch/FetchBodyConsumer.h:
1539
1540             Remove no longer correct FIXMEs.
1541
1542         * Modules/fetch/FetchBodySource.cpp:
1543
1544             Add missing newline between functions.
1545
1546         * Modules/fetch/FetchHeaders.idl:
1547         * Modules/fetch/FetchResponse.idl:
1548
1549             Remove builtin related operations and extended attributes.
1550
1551         * Modules/fetch/FetchHeaders.h:
1552         (WebCore::FetchHeaders::fastHas const):
1553         * Modules/fetch/FetchHeaders.cpp:
1554
1555             Added fastHas to allow checking for a header using a HTTPHeaderName. Remove
1556             now unused filter function.
1557
1558         * Modules/fetch/FetchResponse.cpp:
1559         (WebCore::isNullBodyStatus):
1560
1561             Added helper predicate for 'null body status' concept.
1562
1563         (WebCore::FetchResponse::create):
1564
1565             Add spec defined constructor implementation.
1566
1567         (WebCore::FetchResponse::setBodyData):
1568
1569             Reformatted to match more common WTF::switchOn style.
1570
1571         (WebCore::FetchResponse::setStatus): Deleted.
1572         (WebCore::FetchResponse::initializeWith): Deleted.
1573
1574             Removed now unused functions.
1575
1576         * Modules/fetch/FetchResponse.h:
1577         (WebCore::FetchResponse::create):
1578
1579             Move inline create out of the class definition to make things a bit less crowded.
1580
1581 2017-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1582
1583         Implement HTMLImageElement.decoode() method
1584         https://bugs.webkit.org/show_bug.cgi?id=176016
1585
1586         Reviewed by Simon Fraser.
1587
1588         The specs is:
1589         https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode.
1590
1591         -- img.decode() waits till loading the image finishes. Otherwise it starts
1592         decoding the image immediately.
1593         -- If the image frame is already decoded, the promise will be resolved
1594         before return.
1595         -- If an error happens in loading the image or decoding the image frame,
1596         the promise will be rejected with 'EncodingError' exception.
1597         -- Animated image resolves the promise when the next frame is decoded and 
1598         the animation is advanced it. If the image is not displayed, decode() will
1599         request the decoding the first frame and start animating the image.
1600
1601         Tests: fast/images/decode-animated-image.html
1602                fast/images/decode-render-animated-image.html
1603                fast/images/decode-render-static-image.html
1604                fast/images/decode-static-image-reject.html
1605                fast/images/decode-static-image-resolve.html
1606
1607         * html/HTMLImageElement.cpp:
1608         (WebCore::HTMLImageElement::decode):
1609         * html/HTMLImageElement.h:
1610         * html/HTMLImageElement.idl:
1611         * loader/ImageLoader.cpp:
1612         (WebCore::ImageLoader::notifyFinished):
1613         (WebCore::ImageLoader::decode):
1614         (WebCore::ImageLoader::decodeError):
1615         * loader/ImageLoader.h:
1616         (WebCore::ImageLoader::hasPendingDecodePromise const):
1617         * platform/graphics/BitmapImage.cpp:
1618         (WebCore::BitmapImage::internalStartAnimation):
1619         (WebCore::BitmapImage::internalAdvanceAnimation):
1620         (WebCore::BitmapImage::decode):
1621         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
1622         * platform/graphics/BitmapImage.h:
1623         * platform/graphics/Image.h:
1624         (WebCore::Image::decode):
1625
1626 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
1627
1628         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
1629         https://bugs.webkit.org/show_bug.cgi?id=176479
1630
1631         Reviewed by Alex Christensen.
1632
1633         Test: http/wpt/fetch/response-status-text.html
1634
1635         HTTP/2 doesn't include a status reason phrase. So the "status line"
1636         ends up just being the version and status code. Fallback to the empty
1637         string instead of the full line.
1638
1639         * platform/network/HTTPParsers.cpp:
1640         (WebCore::extractReasonPhraseFromHTTPStatusLine):
1641
1642 2017-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1643
1644         Implement the attribute HTMLImageElement.async 
1645         https://bugs.webkit.org/show_bug.cgi?id=176204
1646
1647         Reviewed by Darin Adler.
1648
1649         Adding this attribute to the <img> element will force async decoding for
1650         this image all the times. None of the heuristics, which  prevents flickering
1651         the image, will be checked.
1652
1653         Test: fast/images/async-attribute-with-small-image.html
1654
1655         * html/HTMLImageElement.cpp:
1656         (WebCore::HTMLImageElement::parseAttribute):
1657         * html/HTMLImageElement.h:
1658         (WebCore::HTMLImageElement::async const):
1659         * html/HTMLImageElement.idl:
1660         * rendering/RenderBoxModelObject.cpp:
1661         (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
1662
1663 2017-09-08  Commit Queue  <commit-queue@webkit.org>
1664
1665         Unreviewed, rolling out r221773.
1666         https://bugs.webkit.org/show_bug.cgi?id=176614
1667
1668         This caused build failures. (Requested by mlewis13 on
1669         #webkit).
1670
1671         Reverted changeset:
1672
1673         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
1674         https://bugs.webkit.org/show_bug.cgi?id=176472
1675         http://trac.webkit.org/changeset/221773
1676
1677 2017-09-08  Antti Koivisto  <antti@apple.com>
1678
1679         Remove support for >> descendant combinator syntax
1680         https://bugs.webkit.org/show_bug.cgi?id=175765
1681
1682         Reviewed by Sam Weinig.
1683
1684         This is an alternative syntax for the normal descendant combinator (just space) that was
1685         advertised as being consistent with > (child combinator) and >>> (shadow piercing combinator).
1686         The latter has been killed so it is not consistent with anything anymore.
1687
1688         No other engine besides WebKit has implemented this and the WPT tests have been removed
1689         (in https://github.com/w3c/web-platform-tests/pull/6785). Full removal from spec is still
1690         open (https://github.com/w3c/csswg-drafts/issues/641) but we shouldn't encourage adoption of
1691         this pointless feature.
1692
1693         While this has shipped the compatibility risk is low as no other engine implemented it and
1694         there were no incentives to use it over the standard syntax.
1695
1696         * css/CSSSelector.cpp:
1697         (WebCore::CSSSelector::selectorText const):
1698         * css/CSSSelector.h:
1699         (WebCore::CSSSelector::hasDescendantRelation const):
1700         * css/SelectorChecker.cpp:
1701         (WebCore::SelectorChecker::matchRecursively const):
1702         * css/SelectorFilter.cpp:
1703         (WebCore::SelectorFilter::collectIdentifierHashes):
1704         * css/parser/CSSParserSelector.cpp:
1705         (WebCore::CSSParserSelector::appendTagHistory):
1706         * css/parser/CSSParserSelector.h:
1707         * css/parser/CSSSelectorParser.cpp:
1708         (WebCore::isDescendantCombinator):
1709         (WebCore::CSSSelectorParser::consumeCombinator):
1710         * cssjit/SelectorCompiler.cpp:
1711         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
1712
1713 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
1714
1715         [GStreamer] initializationDataEncountered() dispatch can outlive MediaPlayerPrivateGStreamerBase
1716         https://bugs.webkit.org/show_bug.cgi?id=176544
1717
1718         Reviewed by Xabier Rodriguez-Calvar.
1719
1720         The RunLoop dispatch that invokes MediaPlayer::initializationDataEncountered()
1721         can outlive the MediaPlayerPrivateGStreamerBase object that is referenced
1722         from the dispatched functor. To avoid this, a WeakPtrFactory is placed onto
1723         MediaPlayerPrivateGStreamerBase and a WeakPtr object is kept in the functor,
1724         bailing during dispatch if the factory (along with MediaPlayerPrivateGStreamerBase)
1725         has already been destroyed since the schedule of this dispatch.
1726
1727         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1728         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1729         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1730         Also remove the unused `sessionId` string.
1731         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1732
1733 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
1734
1735         [GStreamer] Add GRefPtr specializations for GstGLDisplay, GstGLContext
1736         https://bugs.webkit.org/show_bug.cgi?id=176543
1737
1738         Reviewed by Xabier Rodriguez-Calvar.
1739
1740         Both GstGLDisplay and GstGLContext inherit from GstObject, meaning
1741         gst_object_ref_sink() and gst_object_unref() should be used for
1742         incrementing and decrementing reference count. Template specializations
1743         for the adoptGRef(), refGPtr() and derefGPtr() are added for both types,
1744         preventing GRefPtr<> from falling back to using g_object_ref() and
1745         g_object_unref() for reference count modification purposes.
1746
1747         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1748         (WTF::adoptGRef):
1749         (WTF::refGPtr<GstGLDisplay>):
1750         (WTF::derefGPtr<GstGLDisplay>):
1751         (WTF::refGPtr<GstGLContext>):
1752         (WTF::derefGPtr<GstGLContext>):
1753         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1754
1755 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
1756
1757         [GStreamer] Incorrect GstCaps unreffing in GStreamerEMEUtilities::createDecryptor()
1758         https://bugs.webkit.org/show_bug.cgi?id=176540
1759
1760         Reviewed by Xabier Rodriguez-Calvar.
1761
1762         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
1763         Include the GRefPtrGStreamer.h header in order to use specialized template
1764         functions that correctly adopt and dereference GstCaps object that is
1765         wrapped the GRefPtr<>.
1766
1767 2017-09-07  Joseph Pecoraro  <pecoraro@apple.com>
1768
1769         WebKit should claim that it can show responses for a broader range of JSON MIMETypes
1770         https://bugs.webkit.org/show_bug.cgi?id=176252
1771         <rdar://problem/34212885>
1772
1773         Reviewed by Ryosuke Niwa.
1774
1775         * platform/MIMETypeRegistry.h:
1776         * platform/MIMETypeRegistry.cpp:
1777         (WebCore::MIMETypeRegistry::canShowMIMEType):
1778         Extend this to support JavaScript and JSON MIMETypes that WebKit
1779         knows how to treat as text.
1780
1781 2017-09-07  Andy Estes  <aestes@apple.com>
1782
1783         [Mac] Upstream QTKit-related WebKitSystemInterface functions
1784         https://bugs.webkit.org/show_bug.cgi?id=176472
1785
1786         Reviewed by Eric Carlson.
1787
1788         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1789         (WebCore::disableComponentsOnce):
1790         (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
1791         (WebCore::MediaPlayerPrivateQTKit::hasClosedCaptions const):
1792         (WebCore::MediaPlayerPrivateQTKit::setClosedCaptionsVisible):
1793         (WebCore::selectPreferredAlternateTrackForMediaType):
1794         (WebCore::selectPreferredAlternates):
1795         (WebCore::MediaPlayerPrivateQTKit::updateStates):
1796         (WebCore::mimeModernTypesCache):
1797         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache):
1798         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
1799         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins):
1800         (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin const):
1801         (WebCore::MediaPlayerPrivateQTKit::movieLoadType const):
1802         (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData const):
1803         * platform/mac/WebCoreSystemInterface.h:
1804         * platform/mac/WebCoreSystemInterface.mm:
1805         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1806         (createMediaUIControl):
1807         (createControlWithMediaUIControlType):
1808         (createMediaUIBackgroundView):
1809         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
1810
1811 2017-09-07  Youenn Fablet  <youenn@apple.com>
1812
1813         Align FetchResponse and FetchRequest body handling
1814         https://bugs.webkit.org/show_bug.cgi?id=176539
1815
1816         Reviewed by Alex Christensen.
1817
1818         Covered by rebased tests.
1819
1820         Removing most of FetchResponse JS Builtins now that ReadableStream has full support.
1821         Implementing FetchResponse body cloning through ReadableStream.
1822         Cloning a loading FetchResponse still requires to create a ReadableStream for the purpose of teeing.
1823
1824         Moving exposure of the body from FetchResponse to FetchBodyOwner.
1825         This is controlled by a boolean flag set according response tainting.
1826
1827         Moving handling of body ReadableStream consuming from FetchResponse to FetchBodyConsumer.
1828         For that purpose, a loading boolean flag is added to FetchBodyConsumer so that it will resolve consume promises
1829         when loading is finished.
1830
1831         Added support for getting a body in case the request/response body is already consumed.
1832         In that case, a locked ReadableStream is returned.
1833
1834         * Modules/cache/DOMCache.cpp:
1835         (WebCore::DOMCache::doMatch):
1836         (WebCore::DOMCache::matchAll):
1837         * Modules/fetch/FetchBody.h:
1838         (WebCore::FetchBody::loadingBody):
1839         (WebCore::FetchBody::FetchBody):
1840         * Modules/fetch/FetchBody.idl:
1841         * Modules/fetch/FetchBodyConsumer.cpp:
1842         (WebCore::FetchBodyConsumer::resolve):
1843         (WebCore::FetchBodyConsumer::loadingFailed):
1844         (WebCore::FetchBodyConsumer::loadingSucceeded):
1845         * Modules/fetch/FetchBodyConsumer.h:
1846         (WebCore::FetchBodyConsumer::setAsLoading):
1847         * Modules/fetch/FetchBodyOwner.cpp:
1848         (WebCore::FetchBodyOwner::arrayBuffer):
1849         (WebCore::FetchBodyOwner::blob):
1850         (WebCore::FetchBodyOwner::formData):
1851         (WebCore::FetchBodyOwner::json):
1852         (WebCore::FetchBodyOwner::text):
1853         (WebCore::FetchBodyOwner::readableStream):
1854         * Modules/fetch/FetchBodyOwner.h:
1855         (WebCore::FetchBodyOwner::isBodyNullOrOpaque const):
1856         (WebCore::FetchBodyOwner::setBodyAsOpaque):
1857         (WebCore::FetchBodyOwner::isBodyOpaque const):
1858         * Modules/fetch/FetchInternals.js:
1859         (fillFetchHeaders):
1860         * Modules/fetch/FetchResponse.cpp:
1861         (WebCore::FetchResponse::clone):
1862         (WebCore::FetchResponse::fetch):
1863         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
1864         (WebCore::FetchResponse::setBodyData):
1865         (WebCore::FetchResponse::consumeChunk):
1866         (WebCore::FetchResponse::consumeBodyAsStream):
1867         * Modules/fetch/FetchResponse.h:
1868         * Modules/fetch/FetchResponse.idl:
1869         * Modules/fetch/FetchResponse.js:
1870         (initializeFetchResponse):
1871         * bindings/js/ReadableStream.cpp:
1872         (WebCore::ReadableStream::create):
1873         (WebCore::ReadableStream::lock):
1874         * bindings/js/ReadableStream.h:
1875         * bindings/js/WebCoreBuiltinNames.h:
1876
1877 2017-09-07  Michael Saboff  <msaboff@apple.com>
1878
1879         Add support for RegExp named capture groups
1880         https://bugs.webkit.org/show_bug.cgi?id=176435
1881
1882         Reviewed by Filip Pizlo.
1883
1884         Implemented stub routines to support named capture groups.  These are no-ops
1885         just like for number capture group.
1886
1887         No new tests as this is covered by existing tests.
1888
1889         * contentextensions/URLFilterParser.cpp:
1890         (WebCore::ContentExtensions::PatternParser::atomNamedBackReference):
1891         (WebCore::ContentExtensions::PatternParser::atomParenthesesSubpatternBegin):
1892
1893 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
1894
1895         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
1896         https://bugs.webkit.org/show_bug.cgi?id=176561
1897
1898         Reviewed by Brent Fulgham.
1899
1900         No new tests because there is no behavior change.
1901
1902         * CMakeLists.txt:
1903         * WebCore.xcodeproj/project.pbxproj:
1904         * accessibility/AccessibilitySVGElement.cpp:
1905         * bindings/js/JSDOMWindowBase.cpp:
1906         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1907         * dom/Document.cpp:
1908         * html/HTMLInputElement.cpp:
1909         * html/HTMLMediaElement.cpp:
1910         * html/shadow/MediaControlElements.cpp:
1911         * html/track/TrackBase.cpp:
1912         * page/CaptionUserPreferences.cpp:
1913         * page/CaptionUserPreferencesMediaAF.cpp:
1914         * page/DOMWindow.cpp:
1915         * page/Navigator.cpp:
1916         * page/NavigatorBase.cpp:
1917         * platform/graphics/FontGenericFamilies.cpp:
1918         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1919         * platform/network/HTTPParsers.cpp:
1920         * platform/text/PlatformLocale.h:
1921         * platform/text/cf/HyphenationCF.cpp:
1922         * platform/text/mac/LocaleMac.mm:
1923         * svg/SVGTests.cpp:
1924         * testing/InternalSettings.cpp:
1925         * testing/Internals.cpp:
1926         (WebCore::Internals::resetToConsistentState):
1927         (WebCore::Internals::userPreferredLanguages const):
1928         (WebCore::Internals::setUserPreferredLanguages):
1929
1930 2017-09-06  Dean Jackson  <dino@apple.com>
1931
1932         [WebGL] accelerated texImage2D for video doesn't respect flipY
1933         https://bugs.webkit.org/show_bug.cgi?id=176491
1934         <rdar://problem/33833511>
1935
1936         Reviewed by Jer Noble.
1937
1938         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
1939         back to software or fail to upload texture data. Fix this by intercepting
1940         the texImage2D call, checking the orientation of the video, and running
1941         a small shader program to flip it if necessary.
1942
1943         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
1944         none of our media decoders support video with alpha, so unfortunately
1945         this will have no visible change.
1946
1947         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
1948                fast/canvas/webgl/texImage2D-video-flipY-true.html
1949
1950         * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
1951         which is used to check the orientation of the source video.
1952         * platform/cocoa/CoreVideoSoftLink.h:
1953
1954         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1955         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
1956         now handle flipped or premultiplied requests.
1957         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1958         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.
1959
1960         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1961         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
1962         simply framebuffer.
1963         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
1964         if they were created.
1965         (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
1966         and the vertex buffer for drawing. Also records the location of the uniforms.
1967         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
1968         framebuffer object, and render the video texture into that framebuffer using a
1969         shader that can flip the coordinates.
1970         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
1971         the state of the user's GraphicsContext3D while we're intercepting calls.
1972         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
1973         * platform/graphics/cv/VideoTextureCopierCV.h:
1974
1975         * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
1976         compilation and attribute access. This avoids going through ANGLE.
1977         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1978         (WebCore::GraphicsContext3D::compileShader):
1979         (WebCore::GraphicsContext3D::compileShaderDirect):
1980         (WebCore::GraphicsContext3D::getAttribLocationDirect):
1981
1982 2017-09-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1983
1984         [Directory Upload] Extend drag and drop support to iOS
1985         https://bugs.webkit.org/show_bug.cgi?id=176492
1986         <rdar://problem/34291584>
1987
1988         Reviewed by Tim Horton.
1989
1990         Adds support for accepting dropped folders on iOS.
1991
1992         Tests: DataInteractionTests.ExternalSourceDataTransferItemGetFolderAsEntry
1993                DataInteractionTests.ExternalSourceDataTransferItemGetPlainTextFileAsEntry
1994
1995         * platform/ios/PasteboardIOS.mm:
1996         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
1997
1998         Add "public.folder" as a compatible pasteboard type for drops on iOS. This means file inputs and custom drop
1999         targets that preventDefault() will, by default, be able to accept incoming folders.
2000
2001         * platform/ios/WebItemProviderPasteboard.mm:
2002         (linkTemporaryItemProviderFilesToDropStagingDirectory):
2003
2004         Tweak temporaryFileURLForDataInteractionContent to also hard link UIKit's temporary files instead, and return
2005         a non-null destination URL only if the necessary file operations succeeded. Also renames this helper to
2006         linkTemporaryItemProviderFilesToDropStagingDirectory to better reflect its new purpose. This makes logic much
2007         cleaner at the call site, which no longer checks against various conditions before proceeding to set the data
2008         transfer URL.
2009
2010         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
2011         (temporaryFileURLForDataInteractionContent): Deleted.
2012
2013 2017-09-07  Alex Christensen  <achristensen@webkit.org>
2014
2015         Modernize Geolocation code
2016         https://bugs.webkit.org/show_bug.cgi?id=176496
2017
2018         Reviewed by Andy Estes.
2019
2020         No change in behavior.  Just more references instead of pointers.
2021
2022         * Modules/geolocation/Geolocation.cpp:
2023         (WebCore::createPositionError):
2024         (WebCore::Geolocation::resetAllGeolocationPermission):
2025         (WebCore::Geolocation::stop):
2026         (WebCore::Geolocation::requestPermission):
2027         (WebCore::Geolocation::setError):
2028         (WebCore::Geolocation::startUpdating):
2029         (WebCore::Geolocation::stopUpdating):
2030         * Modules/geolocation/Geolocation.h:
2031         * Modules/geolocation/GeolocationClient.h:
2032         * Modules/geolocation/GeolocationController.cpp:
2033         (WebCore::GeolocationController::addObserver):
2034         (WebCore::GeolocationController::removeObserver):
2035         (WebCore::GeolocationController::requestPermission):
2036         (WebCore::GeolocationController::cancelPermissionRequest):
2037         (WebCore::GeolocationController::positionChanged):
2038         (WebCore::GeolocationController::errorOccurred):
2039         (WebCore::GeolocationController::activityStateDidChange):
2040         (WebCore::provideGeolocationTo):
2041         * Modules/geolocation/GeolocationController.h:
2042
2043 2017-09-07  Adrian Perez de Castro  <aperez@igalia.com>
2044
2045         [ARM] Building FELightningNEON.cpp fails due to missing {Point,Spot}LightSource declarations
2046         https://bugs.webkit.org/show_bug.cgi?id=176531
2047
2048         Reviewed by Žan Doberšek.
2049
2050         The m_lightSource member is a Ref<LightSource>, and its get() method returns
2051         a reference, therefore the casts have to be done to the corresponding reference
2052         types.
2053
2054         * platform/graphics/cpu/arm/filters/FELightingNEON.h:
2055         (WebCore::FELighting::platformApplyNeon): Adjust casts and member accesses accordingly.
2056
2057 2017-09-07  Ryan Haddad  <ryanhaddad@apple.com>
2058
2059         Unreviewed, rolling out r221716.
2060
2061         This change caused assertion failures on macOS Debug WK2.
2062
2063         Reverted changeset:
2064
2065         "Fetch's Response.statusText is unexpectedly the full http
2066         status line for HTTP/2 responses"
2067         https://bugs.webkit.org/show_bug.cgi?id=176479
2068         http://trac.webkit.org/changeset/221716
2069
2070 2017-09-07  Zan Dobersek  <zdobersek@igalia.com>
2071
2072         [EME] CDMClearKey: implement remaining methods of CDMPrivate derivative
2073         https://bugs.webkit.org/show_bug.cgi?id=176495
2074
2075         Reviewed by Xabier Rodriguez-Calvar.
2076
2077         Implement the remaining CDMPrivateClearKey methods, following the
2078         ClearKey specification:
2079          - server certificates are not supported, but sessions are;
2080          - 'keyids' init data in JSON format is acceptable;
2081          - JSON responses are acceptable;
2082          - session IDs must use the 32-bit integer format.
2083
2084         No new tests -- covered by imported W3C tests that utilize ClearKey.
2085
2086         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2087         (WebCore::parseJSONObject):
2088         (WebCore::CDMPrivateClearKey::loadAndInitialize):
2089         (WebCore::CDMPrivateClearKey::supportsServerCertificates const):
2090         (WebCore::CDMPrivateClearKey::supportsSessions const):
2091         (WebCore::CDMPrivateClearKey::supportsInitData const):
2092         (WebCore::CDMPrivateClearKey::sanitizeResponse const):
2093         (WebCore::CDMPrivateClearKey::sanitizeSessionId const):
2094
2095 2017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2096
2097         [GTK] Bring back line height rounding when computing font metrics
2098         https://bugs.webkit.org/show_bug.cgi?id=176497
2099
2100         Reviewed by Žan Doberšek.
2101
2102         In r221670 we changed the way we get the metrics to avoid rounding that was causing a negative line gap to be
2103         computed. Since the font metrics value is indeed a float value, we also removed the rounding when setting the
2104         line height. However, this caused some test failures because now we report non integer line heights.
2105
2106         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2107         (WebCore::Font::platformInit):
2108
2109 2017-09-06  Carlos Garcia Campos  <cgarcia@igalia.com>
2110
2111         Unreviewed. Temporary disable the changes introduced in r221670 for WPE.
2112
2113         It caused a lot of test failures. Once WPE upgrades to Freetype 2.8 and removes the 2.4.11 patch, we can enable
2114         it again.
2115
2116         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2117         (WebCore::Font::platformInit):
2118
2119 2017-09-06  Zan Dobersek  <zdobersek@igalia.com>
2120
2121         [GStreamer] Implement MediaPlayerPrivateGStreamerMSE::attempToDecryptWithInstance()
2122         https://bugs.webkit.org/show_bug.cgi?id=176445
2123
2124         Reviewed by Xabier Rodriguez-Calvar.
2125
2126         Implement MediaPlayerPrivateGStreamerMSE::attempToDecryptWithInstance(), also
2127         adding support for dispatching ClearKey keys into the append pipelines.
2128
2129         CDMInstanceClearKey::Key is added, containing key ID and value buffers as well
2130         as the key status value. Vector of keys for a specific CDMInstance is
2131         accessible through the CDMInstanceClearKey::keys() getter.
2132
2133         In MediaPlayerPrivateGStreamerMSE, that Vector is retrieved and then iterated
2134         over, constructing corresponding key ID and key value lists that contain
2135         GstBuffer objects into which each key ID and value data is copied. Both lists
2136         are then set on the 'drm-cipher-clearkey' structure before it's dispatched
2137         against each AppendPipeline object.
2138
2139         * platform/encryptedmedia/clearkey/CDMClearKey.h:
2140         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2141         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
2142         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2143
2144 2017-09-06  Joseph Pecoraro  <pecoraro@apple.com>
2145
2146         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
2147         https://bugs.webkit.org/show_bug.cgi?id=176479
2148
2149         Reviewed by Alexey Proskuryakov.
2150
2151         Test: http/wpt/fetch/response-status-text.html
2152
2153         HTTP/2 doesn't include a status reason phrase. So the "status line"
2154         ends up just being the version and status code. Fallback to the empty
2155         string instead of the full line.
2156
2157         * platform/network/HTTPParsers.cpp:
2158         (WebCore::extractReasonPhraseFromHTTPStatusLine):
2159
2160 2017-09-06  Eric Carlson  <eric.carlson@apple.com>
2161
2162         Require LoggingHelper overrides to provide identifier
2163         https://bugs.webkit.org/show_bug.cgi?id=176477
2164
2165         Reviewed by Jer Noble.
2166
2167         No new tests, updated API test.
2168
2169         * html/HTMLMediaElement.cpp:
2170         (WebCore::nextLogIdentifier): New.
2171         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_logIdendifier. LOGTHIS -> LOGIDENTIFIER.
2172         (WebCore::HTMLMediaElement::~HTMLMediaElement): Ditto.
2173         * html/HTMLMediaElement.h:
2174
2175 2017-09-06  Youenn Fablet  <youenn@apple.com>
2176
2177         NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
2178         https://bugs.webkit.org/show_bug.cgi?id=176249
2179
2180         Reviewed by Alex Christensen.
2181
2182         Test: http/tests/cache-storage/cache-representation.https.html
2183
2184         Each Cache construction/destruction is notified to the CacheStorageConnection
2185         so that the WebKit2 engine can handle memory management accordingly.
2186
2187         Adding an internal API to grab the representation of an engine at any time.
2188
2189         * Modules/cache/Cache.cpp:
2190         (WebCore::Cache::Cache):
2191         (WebCore::Cache::~Cache):
2192         * Modules/cache/CacheStorageConnection.h:
2193         (WebCore::CacheStorageConnection::reference):
2194         (WebCore::CacheStorageConnection::dereference):
2195         * Modules/cache/WorkerCacheStorageConnection.cpp:
2196         (WebCore::WorkerCacheStorageConnection::reference):
2197         (WebCore::WorkerCacheStorageConnection::dereference):
2198         * Modules/cache/WorkerCacheStorageConnection.h:
2199         * testing/Internals.cpp:
2200         (WebCore::Internals::cacheStorageEngineRepresentation):
2201         * testing/Internals.h:
2202         * testing/Internals.idl:
2203
2204 2017-09-05  Matt Rajca  <mrajca@apple.com>
2205
2206         Support new autoplay quirk for arbitrary user gestures.
2207         https://bugs.webkit.org/show_bug.cgi?id=176402
2208
2209         Reviewed by Eric Carlson.
2210
2211         This quirk allows any user gesture to allow autoplay in a document.
2212
2213         No new tests because this specifically targets one host.
2214
2215         * html/MediaElementSession.cpp:
2216         (WebCore::needsArbitraryUserGestureAutoplayQuirk):
2217         (WebCore::MediaElementSession::playbackPermitted const):
2218
2219 2017-09-06  Youenn Fablet  <youenn@apple.com>
2220
2221         Support caching of Response with a ReadableStream body
2222         https://bugs.webkit.org/show_bug.cgi?id=176462
2223
2224         Reviewed by Alex Christensen.
2225
2226         Tests: http/wpt/cache-storage/cache-put-stream.https.any.html
2227                http/wpt/cache-storage/cache-put-stream.https.any.worker.html
2228
2229         Making FetchResponse use more of ReadableStream:
2230         - Cloning of its body is done through ReadableStream.
2231         - Computation of disturbed and locked is done through ReadableStream.
2232         - Storing of the ReadableStream body given at constructor time is done in FetchBody for FetchResponse.
2233         This allows making FetchResponse closer to FetchRequest.
2234         This also allows to correctly compute disturbed and locked in clone cases.
2235
2236         Adding the ability to consume a Response ReadableStream body as a SharedBuffer.
2237         Using that ability in DOMCache.
2238
2239         * Modules/cache/DOMCache.cpp:
2240         (WebCore::DOMCache::putWithResponseData):
2241         (WebCore::DOMCache::put):
2242         * Modules/cache/DOMCache.h:
2243         * Modules/fetch/FetchBody.h:
2244         (WebCore::FetchBody::readableStream const):
2245         * Modules/fetch/FetchBodyConsumer.cpp:
2246         (WebCore::FetchBodyConsumer::extract):
2247         * Modules/fetch/FetchBodyConsumer.h:
2248         * Modules/fetch/FetchBodyOwner.cpp:
2249         (WebCore::FetchBodyOwner::isDisturbed const):
2250         (WebCore::FetchBodyOwner::isDisturbedOrLocked const):
2251         * Modules/fetch/FetchBodyOwner.h:
2252         (WebCore::FetchBodyOwner::hasReadableStreamBody const):
2253         * Modules/fetch/FetchBodySource.cpp:
2254         * Modules/fetch/FetchBodySource.h:
2255         * Modules/fetch/FetchResponse.cpp:
2256         (WebCore::FetchResponse::consumeBodyFromReadableStream):
2257         (WebCore::FetchResponse::consumeBodyWhenLoaded):
2258         (WebCore::FetchResponse::consumeBodyAsStream):
2259         * Modules/fetch/FetchResponse.h:
2260         * Modules/fetch/FetchResponse.idl:
2261         * Modules/fetch/FetchResponse.js:
2262         (initializeFetchResponse):
2263         (clone):
2264         * bindings/js/ReadableStream.cpp:
2265         (WebCore::callFunction):
2266         (WebCore::ReadableStream::pipeTo):
2267         (WebCore::ReadableStream::tee):
2268         (WebCore::checkReadableStream):
2269         (WebCore::ReadableStream::isLocked const):
2270         (WebCore::ReadableStream::isDisturbed const):
2271         (WebCore::ReadableStream::isDisturbed):
2272         * bindings/js/ReadableStream.h:
2273         * bindings/js/ReadableStreamDefaultController.cpp:
2274         * bindings/js/ReadableStreamDefaultController.h:
2275         * bindings/js/WebCoreBuiltinNames.h:
2276         * testing/Internals.cpp:
2277         (WebCore::Internals::isReadableStreamDisturbed):
2278
2279 2017-09-06  Ryan Haddad  <ryanhaddad@apple.com>
2280
2281         Unreviewed, rolling out r221461.
2282
2283         The LayoutTest added with this change crashes under
2284         GuardMalloc.
2285
2286         Reverted changeset:
2287
2288         "Add (entirely incorrect) fetching of ServiceWorker scripts."
2289         https://bugs.webkit.org/show_bug.cgi?id=176179
2290         http://trac.webkit.org/changeset/221461
2291
2292 2017-09-06  Devin Rousso  <webkit@devinrousso.com>
2293
2294         Web Inspector: Support overloaded CanvasRenderingContext2D actions with identical parameter counts
2295         https://bugs.webkit.org/show_bug.cgi?id=176178
2296         <rdar://problem/34192229>
2297
2298         Reviewed by Matt Baker.
2299
2300         Update existing tests.
2301
2302         * WebCore.xcodeproj/project.pbxproj:
2303
2304         * inspector/InspectorCanvas.cpp:
2305         (WebCore::buildArrayForVector):
2306         (WebCore::InspectorCanvas::buildAction):
2307         Add another array to each action that contains a swizzle type for each parameter. This is
2308         used by the frontend to determine how to regenerate the value from what is given in the JSON.
2309
2310         * inspector/RecordingSwizzleTypes.h: Added.
2311         Contains a value-specified enum of types that translate into int values, which are mirrored
2312         by an object in the frontend, that indicate the type of each parameter. This enum matches
2313         the values in WI.Recording.Swizzle.
2314
2315 2017-09-06  Per Arne Vollan  <pvollan@apple.com>
2316
2317         [Win] WebCore failed to build, InbandTextTrackPrivateAVF: base class undefined.
2318         https://bugs.webkit.org/show_bug.cgi?id=176431
2319
2320         Reviewed by Alex Christensen.
2321
2322         AVFoundation header detection should be done in WebCore because of build dependencies.
2323
2324         No new tests, covered by existing tests.
2325
2326         * AVFoundationSupport.py: Copied from Source/WTF/AVFoundationSupport.py.
2327         * PlatformWin.cmake:
2328         * config.h:
2329         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2330         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2331
2332 2017-09-06  Sam Weinig  <sam@webkit.org>
2333
2334         REGRESSION (r221598): Legacy "round" and "bevel" options can no longer be used with the legacy CanvasRenderingContext2D setLineJoin operation
2335         https://bugs.webkit.org/show_bug.cgi?id=176461
2336
2337         Reviewed by Alex Christensen.
2338
2339         Tests: fast/canvas/canvas-strokePath-cap-join-legacy-functions-match-attribute.html
2340                fast/canvas/canvas-strokePath-cap-join-legacy.html
2341
2342         * html/canvas/CanvasRenderingContext2D.cpp:
2343         (WebCore::CanvasRenderingContext2D::setLineJoin):
2344         
2345             Fix silly typo, ifs -> else ifs.
2346
2347 2017-09-06  Per Arne Vollan  <pvollan@apple.com>
2348
2349         [Win] Compile errors in Document::updateTitleElement.
2350         https://bugs.webkit.org/show_bug.cgi?id=176381
2351
2352         Reviewed by Alex Christensen.
2353
2354         MSVC is not able to compile the statement:
2355         'auto result = boolExpression ? lambda1 : lambda2;'
2356         where 'lambda1' and 'lambda2' have the same signature.
2357
2358         * dom/Document.cpp:
2359         (WebCore::findHTMLTitle):
2360         (WebCore::isHTMLTitle):
2361         (WebCore::isHTMLTitleEligible):
2362         (WebCore::findSVGTitle):
2363         (WebCore::isSVGTitle):
2364         (WebCore::isSVGTitleEligible):
2365         (WebCore::Document::updateTitleElement):
2366
2367 2017-09-06  Brent Fulgham  <bfulgham@apple.com>
2368
2369         Deny third-party cookie creation for prevalent resources without interaction
2370         https://bugs.webkit.org/show_bug.cgi?id=175232
2371         <rdar://problem/33709386>
2372
2373         Reviewed by Alex Christensen.
2374
2375         Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's
2376         settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie,
2377         but destroy it at some arbitrary moment which is difficult for websites to work with.
2378         
2379         This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately,
2380         which is what sites are expecting from Safari.
2381
2382         Tests: http/tests/loading/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html
2383
2384         * platform/network/NetworkStorageSession.h:
2385         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2386         (WebCore::NetworkStorageSession::shouldPartitionCookies const): Revise for new naming.
2387         (WebCore::NetworkStorageSession::shouldAllowThirdPartyCookies const): Allow third party cookies when the
2388         user interaction property applies.
2389         (WebCore::NetworkStorageSession::shouldBlockCookies const): Deny cookies for origins that are not allowed by
2390         user interaction, and that are not being partitioned.
2391         (WebCore::NetworkStorageSession::setPrevalentDomainsWithAndWithoutInteraction): Revise for new naming, and
2392         to track prevalent origins with and without user interaction.
2393         (WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts): Renamed to setPrevalentDomainsWithAndWithoutInteraction.
2394         (WebCore::NetworkStorageSession::removePrevalentDomains): New helper function for testing.
2395
2396 2017-09-06  Tomas Popela  <tpopela@redhat.com>
2397
2398         Missing break in URLParser
2399         https://bugs.webkit.org/show_bug.cgi?id=176357
2400
2401         Reviewed by Darin Adler.
2402
2403         Add a missing break so the currently set state is not overwritten
2404         after the block. Found by Coverity scan.
2405
2406         * platform/URLParser.cpp:
2407         (WebCore::URLParser::parse):
2408
2409 2017-09-06  Dominik Röttsches  <dominik.rottsches@intel.com>
2410
2411         [GTK] Bump freetype version to 2.8.0
2412         https://bugs.webkit.org/show_bug.cgi?id=176351
2413
2414         Reviewed by Carlos Alberto Lopez Perez.
2415
2416         Retrieving line spacing info without metrics hinting - FreeType's metric hinting
2417         uses rounding which results in the sum of ascent and descent being larger
2418         than the line height. To work around this without globally disabling font metrics
2419         hinting, I am temporarily creating a new cairo scaled font with metrics hinting
2420         off and retrieving the height values from this one.
2421
2422         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2423         (WebCore::scaledFontWithoutMetricsHinting): New function to clone the existing font, only with metrics hinting
2424         disabled.
2425         (WebCore::Font::platformInit): Get height info from non-metrics hinted font, disable rounding for linespacing.
2426
2427 2017-09-06  Frédéric Wang  <fwang@igalia.com>
2428
2429         Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling
2430         https://bugs.webkit.org/show_bug.cgi?id=174097
2431
2432         Reviewed by Darin Adler.
2433
2434         No new tests, behavior unchanged.
2435
2436         * WebCore.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegate.
2437         * page/scrolling/ScrollingTreeScrollingNode.h: Make ScrollingTreeScrollingNodeDelegate a
2438         friend so that it can access private members.
2439         * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp: Added. New delegate class for a
2440         scrolling node, which is used by the UI process.
2441         (WebCore::ScrollingTreeScrollingNodeDelegate::ScrollingTreeScrollingNodeDelegate):
2442         Constructor, taking the scrolling node as a parameter.
2443         (WebCore::ScrollingTreeScrollingNodeDelegate::~ScrollingTreeScrollingNodeDelegate):
2444         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingTree const): Expose the scrolling
2445         tree containing the scrolling node.
2446         (WebCore::ScrollingTreeScrollingNodeDelegate::lastCommittedScrollPosition const): Expose
2447         the last committed scroll position of the scrolling node.
2448         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h: Added.
2449         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingNode): Expose the scrolling node.
2450         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingNode const): Ditto.
2451
2452 2017-09-06  Manuel Rego Casasnovas  <rego@igalia.com>
2453
2454         [css-grid] grid shorthand should not reset the gutter properties
2455         https://bugs.webkit.org/show_bug.cgi?id=176375
2456
2457         Reviewed by Sergio Villar Senin.
2458
2459         The CSS WG has resolved that the "grid" shorthand shouldn't reset
2460         the gutter properties anymore:
2461         https://github.com/w3c/csswg-drafts/issues/1036
2462
2463         This was originally implemented in r195529, so this is somehow
2464         a revert of that change.
2465
2466         Test: imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html
2467
2468         * css/CSSProperties.json:
2469         * css/parser/CSSPropertyParser.cpp:
2470         (WebCore::CSSPropertyParser::consumeGridShorthand):
2471
2472 2017-09-06  Zan Dobersek  <zdobersek@igalia.com>
2473
2474         [WebGL2] Implement getActiveUniforms()
2475         https://bugs.webkit.org/show_bug.cgi?id=175203
2476
2477         Reviewed by Darin Adler.
2478
2479         Align getActiveUniforms() WebIDL signature with the spec -- making it
2480         return a WebGLAny object, making the program parameter non-nullable,
2481         and making the uniformIndices parameter a sequence on GLuint values.
2482
2483         The getActiveUniforms() implementation in WebGL2RenderingContext
2484         validates the passed-in program and parameter name and then calls the
2485         GraphicsContext3D::getActiveUniforms() method, retrieving an array of
2486         integers that represent values of the requested parameter name for
2487         each uniform whose index was passed through uniformIndices.
2488
2489         Test: fast/canvas/webgl/webgl2-getActiveUniforms.html
2490
2491         * bindings/js/JSDOMConvertWebGL.cpp:
2492         (WebCore::convertToJSValue):
2493         * html/canvas/WebGL2RenderingContext.cpp:
2494         (WebCore::WebGL2RenderingContext::getActiveUniforms):
2495         * html/canvas/WebGL2RenderingContext.h:
2496         * html/canvas/WebGL2RenderingContext.idl:
2497         * html/canvas/WebGLAny.h:
2498         * platform/graphics/GraphicsContext3D.h:
2499         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2500         (WebCore::GraphicsContext3D::getActiveUniforms):
2501
2502 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
2503
2504         [WebCrypto] Downcast parameters and keys at the platform operation callsites
2505         https://bugs.webkit.org/show_bug.cgi?id=176392
2506
2507         Reviewed by Sam Weinig.
2508
2509         Downcast to algorithm-specific parameter and key types in the shared
2510         code that then invokes platform-specific operation implementations.
2511         This reduces the duplicated downcasts across different implementations
2512         that don't differ at all in this behavior.
2513
2514         Covered by existing tests.
2515
2516         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2517         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2518         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2519         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2520         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2521         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2522         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2523         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2524         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2525         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2526         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2527         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2528         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2529         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2530         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2531         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2532         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2533         (WebCore::CryptoAlgorithmAES_KW::wrapKey):
2534         (WebCore::CryptoAlgorithmAES_KW::unwrapKey):
2535         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2536         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2537         (WebCore::CryptoAlgorithmECDH::deriveBits):
2538         * crypto/algorithms/CryptoAlgorithmECDH.h:
2539         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2540         (WebCore::CryptoAlgorithmECDSA::sign):
2541         (WebCore::CryptoAlgorithmECDSA::verify):
2542         * crypto/algorithms/CryptoAlgorithmECDSA.h:
2543         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2544         (WebCore::CryptoAlgorithmHKDF::deriveBits):
2545         * crypto/algorithms/CryptoAlgorithmHKDF.h:
2546         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2547         (WebCore::CryptoAlgorithmHMAC::sign):
2548         (WebCore::CryptoAlgorithmHMAC::verify):
2549         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2550         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2551         (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
2552         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2553         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2554         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
2555         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
2556         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2557         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2558         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
2559         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
2560         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2561         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2562         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
2563         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
2564         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2565         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2566         (WebCore::CryptoAlgorithmRSA_PSS::sign):
2567         (WebCore::CryptoAlgorithmRSA_PSS::verify):
2568         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2569         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2570         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2571         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2572         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
2573         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2574         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2575         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2576         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2577         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2578         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2579         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2580         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2581         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
2582         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
2583         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
2584         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
2585         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
2586         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
2587         (WebCore::CryptoAlgorithmECDSA::platformSign):
2588         (WebCore::CryptoAlgorithmECDSA::platformVerify):
2589         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2590         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2591         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2592         (WebCore::CryptoAlgorithmHMAC::platformSign):
2593         (WebCore::CryptoAlgorithmHMAC::platformVerify):
2594         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2595         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2596         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
2597         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
2598         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
2599         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
2600         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
2601         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
2602         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2603         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2604         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2605         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
2606         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2607         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2608         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2609         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2610         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2611         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
2612         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2613         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2614         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
2615         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2616         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2617         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2618         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2619         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2620         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
2621         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
2622         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
2623         * crypto/mac/CryptoAlgorithmECDHMac.cpp:
2624         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
2625         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
2626         (WebCore::CryptoAlgorithmECDSA::platformSign):
2627         (WebCore::CryptoAlgorithmECDSA::platformVerify):
2628         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2629         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2630         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
2631         (WebCore::CryptoAlgorithmHMAC::platformSign):
2632         (WebCore::CryptoAlgorithmHMAC::platformVerify):
2633         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2634         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2635         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
2636         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
2637         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
2638         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
2639         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
2640         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
2641         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2642         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2643         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2644         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
2645         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2646         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2647
2648 2017-09-05  Darin Adler  <darin@apple.com>
2649
2650         Fix a few minor problems found while working toward removing unneeded calls to updateStyle
2651         https://bugs.webkit.org/show_bug.cgi?id=176279
2652
2653         Reviewed by Antti Koivisto.
2654
2655         * dom/Document.cpp:
2656         (WebCore::Document::updateTitleElement): Fix the algorithm so that an SVG title won't
2657         ever become the title when the document element is not an SVG element. We had this wrong
2658         before but we were passing the test because SVGTitleElement::insertedInto had a bug that
2659         hid the problem.
2660         (WebCore::Document::titleElementAdded): Pass a reference instead of a pointer.
2661         (WebCore::Document::titleElementRemoved): Pass a reference instead of nullptr since we
2662         want to know which element is being removed.
2663
2664         * dom/Document.h: Update the argument name and type for updateTitleElement.
2665
2666         * html/HTMLTitleElement.cpp:
2667         (WebCore::HTMLTitleElement::insertedInto): Call titleElementAdded unconditionally.
2668         The checks to see if the title element is connected to the document and not in the
2669         shadow tree are now handled by the Document class.
2670         (WebCore::HTMLTitleElement::removedFrom): Same for titleElementRemoved.
2671
2672         * platform/mock/MockRealtimeVideoSource.cpp:
2673         (WebCore::MockRealtimeVideoSource::applySize): Removed incorrect caching of FontCascade
2674         objects; these need to be created each time we draw.
2675         (WebCore::MockRealtimeVideoSource::drawText): Create all the fonts here. Since this is
2676         a mock for testing, there is no real performance concern with doing this.
2677         * platform/mock/MockRealtimeVideoSource.h: Removed the FontCascade data members.
2678
2679         * rendering/RenderTreeAsText.cpp:
2680         (WebCore::updateLayoutIgnoringPendingStylesheetsIncludingSubframes): Added. Used below
2681         to update layout more thoroughly.
2682         (WebCore::externalRepresentation): Update layout of all descendant frames, not just
2683         the top level frame.
2684
2685         * svg/SVGTitleElement.cpp:
2686         (WebCore::SVGTitleElement::insertedInto): Removed bogus firstChild check, bogus isSVGDocument
2687         check, and unneeded isConnected check and call titleElementAdded unconditionally. The checks
2688         are now handled by the Document class.
2689         (WebCore::SVGTitleElement::removedFrom): Same for titleElementRemoved.
2690
2691         * testing/Internals.cpp:
2692         (WebCore::Internals::layerTreeAsText const): Added missing updateLayoutIgnorePendingStylesheets,
2693         since dumping the layer tree without first doing a layout will yield stale results.
2694         (WebCore::Internals::layerIDForElement): Added missing updateLayoutIgnorePendingStylesheets,
2695         since using a renderer to check if a layer exists without first doing a layout will yield stale results.
2696         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
2697         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
2698         (WebCore::Internals::displayListForElement): Ditto.
2699         (WebCore::Internals::replayDisplayListForElement): Ditto.
2700         (WebCore::Internals::isSelectPopupVisible): Added missing updateLayoutIgnorePendingStylesheets,
2701         since working with the RenderMenuList without first doing a layout will yield stale results.
2702         Also removed unneeded strict handling of null renderer, instead just returning false.
2703         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Removed unnneeded check of
2704         renderer class, since the HTMLPlugInElement::isReplacementObscured already handles that correctly.
2705         (WebCore::Internals::pageOverlayLayerTreeAsText const): Use updateLayoutIgnorePendingStylesheets
2706         instead of the normal updateLayout for consistency with the behavior of the other functions in this
2707         file, and because we need a real answer here.
2708         (WebCore::Internals::scrollSnapOffsets): Ditto. Also rearranged the code so the renderer check is
2709         done after updating the renderer tree.
2710
2711 2017-09-05  Ryan Haddad  <ryanhaddad@apple.com>
2712
2713         Unreviewed, rolling out r221495.
2714
2715         This change introduced  assertion failures on El Capitan Debug
2716         WK2.
2717
2718         Reverted changeset:
2719
2720         "Move ServiceWorkerJob from FetchLoader to ThreadableLoader."
2721         https://bugs.webkit.org/show_bug.cgi?id=176231
2722         http://trac.webkit.org/changeset/221495
2723
2724 2017-09-05  Chris Dumez  <cdumez@apple.com>
2725
2726         Add support for input.webkitEntries
2727         https://bugs.webkit.org/show_bug.cgi?id=176257
2728         <rdar://problem/34218671>
2729
2730         Reviewed by Andreas Kling.
2731
2732         Add support for input.webkitEntries as per:
2733         - https://wicg.github.io/entries-api/#html-forms
2734
2735         Our behavior matches Chrome and Firefox, rather than the specification. This means
2736         that webkitEntries is only populated if the webkitdirectory flag is unset.
2737
2738         Tests: fast/forms/file/entries-api/drag-folder-webkitEntries.html
2739                fast/forms/file/entries-api/webkitdirectory-drag-folder-webkitEntries.html
2740
2741         * CMakeLists.txt:
2742         * DerivedSources.make:
2743         * Modules/entriesapi/HTMLInputElementEntriesAPI.cpp: Added.
2744         (WebCore::HTMLInputElementEntriesAPI::webkitEntries):
2745         * Modules/entriesapi/HTMLInputElementEntriesAPI.h: Added.
2746         * Modules/entriesapi/HTMLInputElementEntriesAPI.idl: Added.
2747         * WebCore.xcodeproj/project.pbxproj:
2748         * bindings/scripts/generate-bindings.pl:
2749         * bindings/scripts/test/JS/JSTestInterface.cpp:
2750         (WebCore::jsTestInterfaceReflectAttributeGetter):
2751         (WebCore::jsTestInterfaceReflectAttribute):
2752         (WebCore::setJSTestInterfaceReflectAttributeSetter):
2753         (WebCore::setJSTestInterfaceReflectAttribute):
2754         * bindings/scripts/test/TestSupplemental.idl:
2755         * html/HTMLInputElement.idl:
2756
2757 2017-09-05  Chris Dumez  <cdumez@apple.com>
2758
2759         FileSystemEntry API should ignore hidden files
2760         https://bugs.webkit.org/show_bug.cgi?id=176292
2761         <rdar://problem/34257666>
2762
2763         Reviewed by Andreas Kling.
2764
2765         FileSystemEntry API should ignore hidden files as the user likely does not mean
2766         to expose those when drag'n dropping a folder.
2767
2768         Test: editing/pasteboard/enties-api/datatransfer-items-drop-hidden-file.html
2769
2770         * Modules/entriesapi/DOMFileSystem.cpp:
2771         (WebCore::listDirectoryWithMetadata):
2772         (WebCore::validatePathIsExpectedType):
2773         (WebCore::fileType):
2774         (WebCore::DOMFileSystem::getEntry):
2775
2776 2017-09-05  Myles C. Maxfield  <mmaxfield@apple.com>
2777
2778         Update font selection algorithm to match latest CSS spec
2779         https://bugs.webkit.org/show_bug.cgi?id=175236
2780
2781         Reviewed by Darin Adler.
2782
2783         The CSS WG tweaked the generalization of the font selection
2784         algorithm between levels 3 and 4. In particular, the behavior
2785         of weights between 400 and 500 works a little differently.
2786
2787         https://github.com/w3c/csswg-drafts/commit/f6973a21847f1c200ed38bff05dc543cebe1c827
2788
2789         Test: fast/text/variations/font-selection-font-weight.html
2790
2791         * platform/graphics/FontSelectionAlgorithm.cpp:
2792         (WebCore::FontSelectionAlgorithm::weightDistance const):
2793         * platform/graphics/FontSelectionAlgorithm.h:
2794         (WebCore::lowerWeightSearchThreshold):
2795         (WebCore::upperWeightSearchThreshold):
2796         (WebCore::weightSearchThreshold): Deleted.
2797
2798 2017-09-05  Per Arne Vollan  <pvollan@apple.com>
2799
2800         [Win] Compile errors in pathByAppendingComponents.
2801         https://bugs.webkit.org/show_bug.cgi?id=176387
2802
2803         Reviewed by Brent Fulgham.
2804
2805         The pathByAppendingComponents function has changed signature.
2806
2807         * platform/win/FileSystemWin.cpp:
2808         (WebCore::pathByAppendingComponents):
2809
2810 2017-09-05  Simon Fraser  <simon.fraser@apple.com>
2811
2812         Fix capitalization of scheduleinvalidateStyleAndLayerComposition
2813         https://bugs.webkit.org/show_bug.cgi?id=176266
2814
2815         Reviewed by Antti Koivisto.
2816
2817         * html/HTMLFrameOwnerElement.cpp:
2818         (WebCore::HTMLFrameOwnerElement::scheduleInvalidateStyleAndLayerComposition):
2819         (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition): Deleted.
2820         * html/HTMLFrameOwnerElement.h:
2821         * rendering/RenderLayerCompositor.cpp:
2822         (WebCore::RenderLayerCompositor::attachRootLayer):
2823         (WebCore::RenderLayerCompositor::detachRootLayer):
2824         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
2825
2826 2017-09-05  Matt Lewis  <jlewis3@apple.com>
2827
2828         Unreviewed, rolling out r221603.
2829
2830         This caused accessibility/mac/select-element-selection-with-
2831         optgroups.html to consistently timeout on macOS
2832
2833         Reverted changeset:
2834
2835         "Fix a few minor problems found while working toward removing
2836         unneeded calls to updateStyle"
2837         https://bugs.webkit.org/show_bug.cgi?id=176279
2838         http://trac.webkit.org/changeset/221603
2839
2840 2017-09-05  Youenn Fablet  <youenn@apple.com>
2841
2842         Allow retrieving Cache Storage records for a given URL only
2843         https://bugs.webkit.org/show_bug.cgi?id=176202
2844
2845         Reviewed by Alex Christensen.
2846
2847         No observable change of behavior.
2848
2849         Adding a URL parameter to CacheStorageConnection::retrieveRecords.
2850         If given URL is null, all records will be retrieved, which is useful for the keys method.
2851         Other operations only need records that share the same URL (modulo query string and frag id).
2852
2853         * Modules/cache/Cache.cpp:
2854         (WebCore::Cache::matchAll):
2855         (WebCore::Cache::keys):
2856         (WebCore::Cache::retrieveRecords):
2857         (WebCore::Cache::queryCache):
2858         * Modules/cache/Cache.h:
2859         * Modules/cache/CacheStorageConnection.cpp:
2860         (WebCore::CacheStorageConnection::retrieveRecords):
2861         * Modules/cache/CacheStorageConnection.h:
2862         (WebCore::CacheStorageConnection::doRetrieveRecords):
2863         * Modules/cache/WorkerCacheStorageConnection.cpp:
2864         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
2865         * Modules/cache/WorkerCacheStorageConnection.h:
2866         * platform/URL.h:
2867
2868 2017-09-05  Tim Horton  <timothy_horton@apple.com>
2869
2870         Remove some unused bits of code and resources
2871         https://bugs.webkit.org/show_bug.cgi?id=176275
2872
2873         Reviewed by Dan Bernstein.
2874
2875         No new tests, just removing things.
2876
2877         * Resources/textAreaResizeCorner.tiff: Removed.
2878         * Resources/missingImage.tiff: Removed.
2879         These files have PNG versions that include more resolutions.
2880
2881         * Resources/hScrollControl_left.png: Removed.
2882         * Resources/hScrollControl_middle.png: Removed.
2883         * Resources/hScrollControl_right.png: Removed.
2884         * Resources/vScrollControl_bottom.png: Removed.
2885         * Resources/vScrollControl_middle.png: Removed.
2886         * Resources/vScrollControl_top.png: Removed.
2887         * Resources/decrementArrow.tiff: Removed.
2888         * Resources/incrementArrow.tiff: Removed.
2889         * Resources/markedLeft.png: Removed.
2890         * Resources/markedMiddle.png: Removed.
2891         * Resources/markedRight.png: Removed.
2892         These were added in r161638 as part of the iOS upstreaming, but were
2893         unused even then.
2894
2895         * Resources/inputSpeech.tiff: Removed.
2896         The feature this image was for was removed in r172259; the PNG version
2897         of this image was removed in r172384.
2898
2899         * WebCore.xcodeproj/project.pbxproj:
2900         * platform/ios/FileSystemIOS.h: Removed.
2901         * platform/ios/FileSystemIOS.mm: Removed.
2902         Remove FileSystemIOS; one function is unused, the other is not at all
2903         iOS-specific and can be folded into FileSystemCocoa.
2904
2905         * platform/FileSystem.h:
2906         * platform/cocoa/FileSystemCocoa.mm:
2907         (WebCore::createTemporaryDirectory):
2908         Move this in from FileSystemIOS.
2909
2910         * platform/PlatformEvent.cpp: Removed.
2911         Remove this unused file.
2912         
2913         * platform/ios/QuickLook.mm:
2914         * platform/ios/WebItemProviderPasteboard.mm:
2915         Include FileSystem instead of FileSystemIOS.
2916
2917 2017-09-05  Frederic Wang  <fwang@igalia.com>
2918
2919         Use TilesBacking for iframes when async frame scrolling is enabled
2920         https://bugs.webkit.org/show_bug.cgi?id=173644
2921
2922         Reviewed by Simon Fraser.
2923
2924         This patch adds creation of TilesBacking for non-main frames when async frame scrolling is
2925         enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect
2926         that tiled backing is not exclusive to the main frame. More adjustments might be needed for
2927         non-main frames and will be handled in follow-up commits.
2928
2929         Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
2930
2931         * rendering/RenderLayerBacking.cpp: Rename m_isMainFrameLayerWithTiledBacking
2932         * rendering/RenderLayerBacking.h: Rename isMainFrameLayerWithTiledBacking and
2933         m_isMainFrameLayerWithTiledBacking.
2934         * rendering/RenderLayerCompositor.cpp: Use isFrameLayerWithTiledBacking
2935
2936 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
2937
2938         HTMLMediaElement: attach any existing EME CDMInstance in mediaEngineWasUpdated()
2939         https://bugs.webkit.org/show_bug.cgi?id=176354
2940
2941         Reviewed by Xabier Rodriguez-Calvar.
2942
2943         It's common for MediaKeys to be set on an HTMLMediaElement object before
2944         any resource is loaded for that element, meaning no underlying MediaPlayer
2945         exists at that point. In order to not stall the pipeline when encrypted
2946         content is finally loaded, the CDMInstance object of the current MediaKeys
2947         set on this element should be attached in mediaEngineWasUpdated() that's
2948         called whenever the underlying MediaPlayerPrivate object is replaced.
2949
2950         * html/HTMLMediaElement.cpp:
2951         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
2952
2953 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
2954
2955         [EME] HTMLMediaElement: setMediaKeys() should attach CDMInstance from the arriving MediaKeys
2956         https://bugs.webkit.org/show_bug.cgi?id=176352
2957
2958         Reviewed by Xabier Rodriguez-Calvar.
2959
2960         In HTMLMediaElement::setMediaKeys(), use the incoming MediaKeys object
2961         to retrieve the CDMInstance that is then attached to the current
2962         MediaPlayer, if any.
2963
2964         Covered by existing W3C tests that focus on multi-key use cases.
2965
2966         * html/HTMLMediaElement.cpp:
2967         (WebCore::HTMLMediaElement::setMediaKeys):
2968
2969 2017-09-05  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2970
2971         [Win] Fix the wincairo build after r221558 and r221583
2972         https://bugs.webkit.org/show_bug.cgi?id=176353
2973
2974         Reviewed by Yusuke Suzuki.
2975
2976         * platform/win/FileSystemWin.cpp:
2977         (WebCore::isSymbolicLink): Fix a "missing type specifier" error
2978         (WebCore::findDataToFileMetadata): Fix a narrowing convertion error
2979
2980 2017-09-04  Chris Dumez  <cdumez@apple.com>
2981
2982         Use StringView more in DOMFileSystem code
2983         https://bugs.webkit.org/show_bug.cgi?id=176347
2984
2985         Reviewed by Darin Adler.
2986
2987         * Modules/entriesapi/DOMFileSystem.cpp:
2988         (WebCore::resolveRelativeVirtualPath):
2989         (WebCore::DOMFileSystem::evaluatePath):
2990         * platform/FileSystem.h:
2991         * platform/glib/FileSystemGlib.cpp:
2992         (WebCore::pathByAppendingComponents):
2993         * platform/posix/FileSystemPOSIX.cpp:
2994         (WebCore::pathByAppendingComponents):
2995         * platform/win/FileSystemWin.cpp:
2996         (WebCore::pathByAppendingComponents):
2997
2998 2017-09-04  Eric Carlson  <eric.carlson@apple.com>
2999
3000         Switch HTMLMediaElement to release logging
3001         https://bugs.webkit.org/show_bug.cgi?id=176065
3002
3003         Reviewed by Jer Noble.
3004
3005         * dom/Document.cpp:
3006         (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
3007         mode is enabled.
3008         (WebCore::Document::logger const):
3009         * dom/Document.h:
3010
3011         Convert debug-only logging to configurable release logging.
3012         * html/HTMLMediaElement.cpp:
3013         (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
3014         String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
3015         * html/HTMLMediaElement.h:
3016
3017 2017-09-04  Sam Weinig  <sam@webkit.org>
3018
3019         [Canvas] Move non-standard functionality/aliases back to CanvasRenderingContext2D.idl
3020         https://bugs.webkit.org/show_bug.cgi?id=176340
3021
3022         Reviewed by Darin Adler.
3023
3024         In r221598 (https://webkit.org/b/176276), the CanvasRenderingContext2D was split out into
3025         separate interfaces to the match the spec and prepare for implementing OffscreenCanvas. While
3026         doing that, related non-standard functionality and aliases were moved as well. In retrospect,
3027         that doesn't really makes sense, as we don't want to add these legacy properties to any new
3028         interfaces that happen to implement/use the broken out interfaces. Since they are specific
3029         to CanvasRenderingContext2D, let's move them back.
3030
3031         * html/canvas/CanvasCompositing.idl:
3032         * html/canvas/CanvasDrawImage.idl:
3033         * html/canvas/CanvasFillStrokeStyles.idl:
3034         * html/canvas/CanvasImageData.idl:
3035         * html/canvas/CanvasImageSmoothing.idl:
3036         * html/canvas/CanvasPathDrawingStyles.idl:
3037         * html/canvas/CanvasShadowStyles.idl:
3038         * html/canvas/CanvasRenderingContext2D.idl:
3039
3040             Move non-standard operation and attributes back to CanvasRenderingContext2D.idl.
3041
3042             * html/canvas/CanvasRenderingContext2D.h:
3043         * html/canvas/CanvasRenderingContext2D.cpp:
3044         (WebCore::CanvasRenderingContext2D::stringForCanvasFillRule): Deleted.
3045             
3046             Remove unused function.
3047
3048         (WebCore::CanvasRenderingContext2D::setAlpha): Deleted.
3049         (WebCore::CanvasRenderingContext2D::setCompositeOperation): Deleted.
3050
3051             Removed. Instead, the IDL uses [ImplementedAs] to forward to the 
3052             underlying setGlobalAlpha/setGlobalCompositeOperation. This reduces
3053             code and makes it clear they are strict aliases.
3054
3055 2017-09-03  Darin Adler  <darin@apple.com>
3056
3057         Fix a few minor problems found while working toward removing unneeded calls to updateStyle
3058         https://bugs.webkit.org/show_bug.cgi?id=176279
3059
3060         Reviewed by Antti Koivisto.
3061
3062         * dom/Document.cpp:
3063         (WebCore::Document::updateTitleElement): Fix the algorithm so that an SVG title won't
3064         ever become the title when the document element is not an SVG element. We had this wrong
3065         before but we were passing the test because SVGTitleElement::insertedInto had a bug that
3066         hid the problem.
3067         (WebCore::Document::titleElementAdded): Pass a reference instead of a pointer.
3068         (WebCore::Document::titleElementRemoved): Pass a reference instead of nullptr since we
3069         want to know which element is being removed.
3070
3071         * dom/Document.h: Update the argument name and type for updateTitleElement.
3072
3073         * html/HTMLTitleElement.cpp:
3074         (WebCore::HTMLTitleElement::insertedInto): Call titleElementAdded unconditionally.
3075         The checks to see if the title element is connected to the document and not in the
3076         shadow tree are now handled by the Document class.
3077         (WebCore::HTMLTitleElement::removedFrom): Same for titleElementRemoved.
3078
3079         * platform/mock/MockRealtimeVideoSource.cpp:
3080         (WebCore::MockRealtimeVideoSource::applySize): Removed incorrect caching of FontCascade
3081         objects; these need to be created each time we draw.
3082         (WebCore::MockRealtimeVideoSource::drawText): Create all the fonts here. Since this is
3083         a mock for testing, there is no real performance concern with doing this.
3084         * platform/mock/MockRealtimeVideoSource.h: Removed the FontCascade data members.
3085
3086         * rendering/RenderTreeAsText.cpp:
3087         (WebCore::updateLayoutIgnoringPendingStylesheetsIncludingSubframes): Added. Used below
3088         to update layout more thoroughly.
3089         (WebCore::externalRepresentation): Update layout of all descendant frames, not just
3090         the top level frame.
3091
3092         * svg/SVGTitleElement.cpp:
3093         (WebCore::SVGTitleElement::insertedInto): Removed bogus firstChild check, bogus isSVGDocument
3094         check, and unneeded isConnected check and call titleElementAdded unconditionally. The checks
3095         are now handled by the Document class.
3096         (WebCore::SVGTitleElement::removedFrom): Same for titleElementRemoved.
3097
3098         * testing/Internals.cpp:
3099         (WebCore::Internals::layerTreeAsText const): Added missing updateLayoutIgnorePendingStylesheets,
3100         since dumping the layer tree without first doing a layout will yield stale results.
3101         (WebCore::Internals::layerIDForElement): Added missing updateLayoutIgnorePendingStylesheets,
3102         since using a renderer to check if a layer exists without first doing a layout will yield stale results.
3103         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
3104         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
3105         (WebCore::Internals::displayListForElement): Ditto.
3106         (WebCore::Internals::replayDisplayListForElement): Ditto.
3107         (WebCore::Internals::isSelectPopupVisible): Added missing updateLayoutIgnorePendingStylesheets,
3108         since working with the RenderMenuList without first doing a layout will yield stale results.
3109         Also removed unneeded strict handling of null renderer, instead just returning false.
3110         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Removed unnneeded check of
3111         renderer class, since the HTMLPlugInElement::isReplacementObscured already handles that correctly.
3112         (WebCore::Internals::pageOverlayLayerTreeAsText const): Use updateLayoutIgnorePendingStylesheets
3113         instead of the normal updateLayout for consistency with the behavior of the other functions in this
3114         file, and because we need a real answer here.
3115         (WebCore::Internals::scrollSnapOffsets): Ditto. Also rearranged the code so the renderer check is
3116         done after updating the renderer tree.
3117
3118 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
3119
3120         Remove OS(SOLARIS) support
3121         https://bugs.webkit.org/show_bug.cgi?id=176341
3122
3123         Reviewed by Sam Weinig.
3124
3125         * bindings/scripts/preprocessor.pm:
3126         (applyPreprocessor):
3127         * dom/make_names.pl:
3128         * inspector/InspectorFrontendHost.cpp:
3129         (WebCore::InspectorFrontendHost::platform):
3130         * page/Page.h:
3131
3132 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
3133
3134         Unreviewed, fixing unused constant for initial buffer size
3135         https://bugs.webkit.org/show_bug.cgi?id=176310
3136
3137         Follow-up patch after r221583. Pointed by darin@.
3138
3139         * platform/graphics/win/FontPlatformDataWin.cpp:
3140         (WebCore::FontPlatformData::FontPlatformData):
3141
3142 2017-09-04  Sam Weinig  <sam@webkit.org>
3143
3144         [Canvas] Split CanvasRenderingContext2D.idl into separate IDLs to match current HTML spec
3145         https://bugs.webkit.org/show_bug.cgi?id=176276
3146
3147         Reviewed by Dean Jackson.
3148
3149         - Splits CanvasRenderingContext2D.idl out into:
3150             CanvasState
3151             CanvasTransform
3152             CanvasCompositing
3153             CanvasImageSmoothing
3154             CanvasFillStrokeStyles
3155             CanvasShadowStyles
3156             CanvasFilters
3157             CanvasRect
3158             CanvasDrawPath
3159             CanvasUserInterface
3160             CanvasText
3161             CanvasDrawImage
3162             CanvasImageData
3163             CanvasPathDrawingStyles
3164             CanvasTextDrawingStyles
3165         - Renames CanvasWindingRule enum to CanvasFillRule, and moves it to its own file
3166           so it can be reused by multiple IDLs.
3167         - Renames DOMPath to Path2D, which is what it is supposed to be called, and doesn't
3168           conflict with any WebCore names.
3169         - Converts lineCap, lineJoin, textAlign, textBaseline, direction to use enums, rather
3170           than DOMStrings, allowing us to remove a bunch of custom parsing.
3171         - Non-standard canvas API was grouped with related functionality in the broken out
3172           IDLs and clearly marked as non-standard.
3173         - Comments were added for places where we break with the standard, mostly around use
3174           of float where we should be using double.
3175
3176         * CMakeLists.txt:
3177         * DerivedSources.cpp:
3178         * DerivedSources.make:
3179         * WebCore.xcodeproj/project.pbxproj:
3180         
3181             Add new files.
3182         
3183         * bindings/js/CallTracerTypes.h:
3184         * inspector/InspectorCanvas.cpp:
3185         (WebCore::InspectorCanvas::buildInitialState):
3186         (WebCore::InspectorCanvas::buildAction):
3187
3188             Update for renames, and use new convertEnumerationToString to
3189             serialize enumerations.
3190         
3191         * bindings/scripts/CodeGeneratorJS.pm:
3192         (GenerateEnumerationImplementationContent):
3193         (GenerateEnumerationHeaderContent):
3194
3195             Split string conversion out of convertEnumerationToJS, and into
3196             its own function, convertEnumerationToString, to allow serialization
3197             to string outside of the bindings context, in this case, for the 
3198             InspectorCanvas.
3199
3200         (GenerateParametersCheck):
3201         
3202             Improve error message to make it clear which operation has the issue
3203             in order to make debugging easier.
3204
3205         * html/ImageData.idl:
3206         
3207             Re-order constructors to match specification, and add FIXME for incorrect
3208             default argument.
3209         
3210         * html/TextMetrics.idl:
3211             
3212             Add spec'd exposure and spec comments, as well a FIXME to convert the
3213             unrestricted float parameters should be doubles.
3214
3215         * html/canvas/CanvasCompositing.idl: Added.
3216         * html/canvas/CanvasDirection.h: Added.
3217         * html/canvas/CanvasDirection.idl: Added.
3218         * html/canvas/CanvasDrawImage.idl: Added.
3219         * html/canvas/CanvasDrawPath.idl: Added.
3220         * html/canvas/CanvasFillRule.h: Added.
3221         * html/canvas/CanvasFillRule.idl: Added.
3222         * html/canvas/CanvasFillStrokeStyles.idl: Added.
3223         * html/canvas/CanvasFilters.idl: Added.
3224         * html/canvas/CanvasImageData.idl: Added.
3225         * html/canvas/CanvasImageSmoothing.idl: Added.
3226         * html/canvas/CanvasLineCap.h: Added.
3227         * html/canvas/CanvasLineCap.idl: Added.
3228         * html/canvas/CanvasLineJoin.h: Added.
3229         * html/canvas/CanvasLineJoin.idl: Added.
3230         * html/canvas/CanvasPathDrawingStyles.idl: Added.
3231         * html/canvas/CanvasRect.idl: Added.
3232         * html/canvas/CanvasShadowStyles.idl: Added.
3233         * html/canvas/CanvasState.idl: Added.
3234         * html/canvas/CanvasText.idl: Added.
3235         * html/canvas/CanvasTextAlign.h: Added.
3236         * html/canvas/CanvasTextAlign.idl: Added.
3237         * html/canvas/CanvasTextBaseline.h: Added.
3238         * html/canvas/CanvasTextBaseline.idl: Added.
3239         * html/canvas/CanvasTextDrawingStyles.idl: Added.
3240         * html/canvas/CanvasTransform.idl: Added.
3241         * html/canvas/CanvasUserInterface.idl: Added.
3242         * html/canvas/ImageSmoothingQuality.h: Added.
3243         * html/canvas/ImageSmoothingQuality.idl: Added.
3244
3245             Move CanvasRenderingContext2D.idl content into separate files to
3246             match the specification.
3247
3248         * html/canvas/CanvasGradient.idl:
3249         * html/canvas/CanvasPath.idl:
3250         * html/canvas/CanvasPattern.idl:
3251
3252             Add exposure and FIXMEs on changes need to match the spec.
3253
3254         * html/canvas/CanvasRenderingContext2D.cpp:
3255         * html/canvas/CanvasRenderingContext2D.h:
3256
3257             Switch to using enums for lineCap, lineJoin, textAlign, textBaseline, and direction.
3258             Rather than using the parsing / stringifying functions from GraphicsTypes, add simple
3259             switch based to/from converters to convert to/from the canvas type to the platform
3260             type. Also update for rename of DOMPath -> Path2D and WindingRule -> CanvasFillRule.
3261
3262             Unfortunately, not all custom parsing could be removed. To support the legacy functions
3263             setLineCap and setLineJoin, which take Strings, two simply parse paths had to be
3264             brought back. They can't use the enums, because the rules for enums as parameters
3265             is stricter that what was implemented in the custom code (e.g. the bindings would
3266             have thrown for strings not in the enum set).
3267
3268         * html/canvas/CanvasRenderingContext2D.idl:
3269
3270             Move most of the functions into the new files, which are then 'implemented' by
3271             this.
3272
3273         * html/canvas/DOMPath.cpp: Removed.
3274         * html/canvas/DOMPath.h: Removed.
3275         * html/canvas/DOMPath.idl: Removed.
3276         * html/canvas/Path2D.cpp: Copied from Source/WebCore/html/canvas/DOMPath.cpp.
3277         * html/canvas/Path2D.h: Copied from Source/WebCore/html/canvas/DOMPath.h.
3278         * html/canvas/Path2D.idl: Copied from Source/WebCore/html/canvas/DOMPath.idl.
3279
3280             Rename DOMPath to Path2D to match the spec..
3281
3282         * platform/graphics/GraphicsTypes.cpp:
3283         (WebCore::parseLineCap): Deleted.
3284         (WebCore::lineCapName): Deleted.
3285         (WebCore::parseLineJoin): Deleted.
3286         (WebCore::lineJoinName): Deleted.
3287         (WebCore::textAlignName): Deleted.
3288         (WebCore::parseTextAlign): Deleted.
3289         (WebCore::textBaselineName): Deleted.
3290         (WebCore::parseTextBaseline): Deleted.
3291         * platform/graphics/GraphicsTypes.h:
3292
3293             Remove now unused parsing / stringifying functions.
3294
3295         * testing/Internals.cpp:
3296
3297             Remove unused #include.
3298
3299         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
3300         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
3301         * bindings/scripts/test/JS/JSTestObj.cpp:
3302         * bindings/scripts/test/JS/JSTestObj.h:
3303         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3304         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
3305         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
3306         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
3307
3308             Update test results to add convertEnumerationToString.
3309
3310 2017-09-03  Darin Adler  <darin@apple.com>
3311
3312         Follow up FrameView::updateLayoutAndStyleIfNeededRecursive changes with related improvements
3313         https://bugs.webkit.org/show_bug.cgi?id=176277
3314
3315         Reviewed by Antti Koivisto.
3316
3317         * page/FrameView.cpp:
3318         (WebCore::FrameView::needsStyleRecalcOrLayout): Deleted. This function was only used
3319         by an assertion inside updateLayoutAndStyleIfNeededRecursive, and thus there is no reason
3320         for it to be in the header file, or for it to be a public member function.
3321         (WebCore::appendRenderedChildren): Deleted. This function was only used inside
3322         updateLayoutAndStyleIfNeededRecursive, and it is now packaged in an even better way
3323         for efficient use inside that function.
3324         (WebCore::FrameView::renderedChildFrameViews): Deleted. This function was only used
3325         inside needsStyleRecalcOrLayout, and it's now packaged in a better way inside that function.
3326         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Created a new lambda called
3327         nextRendereredDescendant that packages up the process of repeatedly iterating this view
3328         and all of its descendants in an easy-to-use way. Replaces both of the functions above.
3329         Rewrote to use it; it made the logic clear enough that it was good to get rid of the
3330         updateOneFrame lambda, too. Added two separate functions, one that checks for needed
3331         style recalculation and a separate one that checked for needed layout. Using those,
3332         replaced the old single assertion with two separate assertions.
3333
3334         * page/FrameView.h: Removed needsStyleRecalcOrLayout, renderedChildFrameViews, and
3335         FrameViewList.
3336
3337 2017-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3338
3339         [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session
3340         https://bugs.webkit.org/show_bug.cgi?id=176264
3341         <rdar://problem/31144674>
3342
3343         Reviewed by Darin Adler.
3344
3345         Makes some small adjustments to WebItemProviderPasteboard. Rather than just -setItemProviders: on the
3346         WebItemProviderPasteboard when initiating a drag, also stage the WebItemProviderRegistrationList that will be
3347         used to generate an item provider. While it would be cleaner to avoid directly setting item providers so we
3348         don't overwrite item providers on the WebItemProviderPasteboard when adding items to an existing drag session,
3349         this isn't possible without breaking binary compability with older UIKit versions.
3350
3351         Importantly, WKContentView will now ignore any item providers that have been set on the
3352         WebItemProviderPasteboard when initiating a drag or adding items to an existing drag session, and instead only
3353         consider the staged registration list when generating item providers for dragging. This only has the drawback of
3354         generating an unnecessary item provider, but otherwise maintains backwards compatibility while allowing us to
3355         provide WebKit2 support for multiple items per drag session.
3356
3357         Tests: DataInteractionTests.DragEventClientCoordinatesBasic
3358                DataInteractionTests.DragEventClientCoordinatesWithScrollOffset
3359                DataInteractionTests.DragEventPageCoordinatesBasic
3360                DataInteractionTests.DragEventPageCoordinatesWithScrollOffset
3361
3362         * platform/ios/AbstractPasteboard.h:
3363         * platform/ios/PlatformPasteboardIOS.mm:
3364         (WebCore::registerItemToPasteboard):
3365
3366         Changed to only stage registration info on the item provider pasteboard, if possible. This has no effect on the
3367         copy/paste codepath, since it uses a UIPasteboard.
3368
3369         * platform/ios/WebItemProviderPasteboard.h:
3370         * platform/ios/WebItemProviderPasteboard.mm:
3371
3372         Rename _registrationInfoLists to _stagedRegistrationInfoList, and change it from an array of registration info
3373         lists to a single registration info list. This could be updated in the future to be an array of registration
3374         lists, but currently, it serves no purpose and makes coordination with DragItem info more difficult. This would
3375         need to support multiple registration lists if we are to add a way to begin a drag containing multiple items in
3376         vanilla web content, such as dragging multiple selections.
3377
3378         (-[WebItemProviderPasteboard init]):
3379         (-[WebItemProviderPasteboard setItemProviders:]):
3380         (-[WebItemProviderPasteboard stageRegistrationList:]):
3381
3382         Sets the staged item provider registration list.
3383
3384         (-[WebItemProviderPasteboard takeRegistrationList]):
3385
3386         Removes the staged item provider registration list from the WebItemProviderPasteboard and also returns it.
3387
3388         (-[WebItemProviderPasteboard registrationInfoAtIndex:]): Deleted.
3389         (-[WebItemProviderPasteboard setRegistrationInfoLists:]): Deleted.
3390
3391 2017-09-04  Commit Queue  <commit-queue@webkit.org>
3392
3393         Unreviewed, rolling out r221494 and r221500.
3394         https://bugs.webkit.org/show_bug.cgi?id=176258
3395
3396         This caused the windows build to fail. (Requested by mlewis13
3397         on #webkit).
3398
3399         Reverted changesets:
3400
3401         "Switch HTMLMediaElement to release logging"
3402         https://bugs.webkit.org/show_bug.cgi?id=176065
34