[Win] Compile error, PALHeaderDetection.h not found.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-09-21  Per Arne Vollan  <pvollan@apple.com>
2
3         [Win] Compile error, PALHeaderDetection.h not found.
4         https://bugs.webkit.org/show_bug.cgi?id=177309
5
6         Reviewed by Brent Fulgham.
7
8         Copy PAL header files to WebCore forwarding headers folder.
9
10         * PlatformWin.cmake:
11
12 2017-09-21  Joseph Pecoraro  <pecoraro@apple.com>
13
14         Web Inspector: Remove support for CSS Regions
15         https://bugs.webkit.org/show_bug.cgi?id=177287
16
17         Reviewed by Matt Baker.
18
19         * inspector/InspectorCSSAgent.cpp:
20         (WebCore::InspectorCSSAgent::getNamedFlowCollection): Deleted.
21         * inspector/InspectorCSSAgent.h:
22         * inspector/InspectorOverlay.cpp:
23         (WebCore::buildRendererHighlight):
24         (WebCore::buildNodeHighlight):
25         (WebCore::InspectorOverlay::getHighlight const):
26         (WebCore::buildArrayForRendererFragments):
27         (WebCore::buildQuadObjectForCSSRegionContentClip): Deleted.
28         * inspector/InspectorOverlayPage.js:
29         (_createElementTitle):
30         (_drawElementTitle):
31         (_drawFragmentHighlight):
32         (drawNodeHighlight):
33         (_drawRegionNumber): Deleted.
34         (_quadMidPoint): Deleted.
35         (_drawRegionLink): Deleted.
36         (_drawRegionsHighlight): Deleted.
37
38 2017-09-21  Antti Koivisto  <antti@apple.com>
39
40         Remove some more code from RenderFlowThread
41         https://bugs.webkit.org/show_bug.cgi?id=177320
42
43         Reviewed by David Hyatt.
44
45         More dead code related to named flows.
46
47         * rendering/RenderFlowThread.cpp:
48         (WebCore::RenderFlowThread::RenderFlowThread):
49         (WebCore::RenderFlowThread::invalidateRegions):
50         (WebCore::RenderFlowThread::layout):
51         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
52         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
53         (WebCore::RenderFlowThread::addForcedRegionBreak):
54         (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion const):
55         (WebCore::RenderFlowThread::hasCachedOffsetFromLogicalTopOfFirstRegion const): Deleted.
56         (WebCore::RenderFlowThread::cachedOffsetFromLogicalTopOfFirstRegion const): Deleted.
57         (WebCore::RenderFlowThread::setOffsetFromLogicalTopOfFirstRegion): Deleted.
58         (WebCore::RenderFlowThread::clearOffsetFromLogicalTopOfFirstRegion): Deleted.
59         (WebCore::RenderFlowThread::currentActiveRenderBox const): Deleted.
60         (WebCore::RenderFlowThread::pushFlowThreadLayoutState): Deleted.
61         (WebCore::RenderFlowThread::popFlowThreadLayoutState): Deleted.
62         * rendering/RenderFlowThread.h:
63
64 2017-09-21  Chris Dumez  <cdumez@apple.com>
65
66         eventInitDict parameter to GamepadEvent constructor should be optional
67         https://bugs.webkit.org/show_bug.cgi?id=177308
68
69         Reviewed by Sam Weinig.
70
71         eventInitDict parameter to GamepadEvent constructor should be optional to match Firefox
72         and Chrome. Having such dictionary parameter is also not valid Web IDL:
73         """
74         If the type of an argument is a dictionary type (or a union type that has a dictionary as one
75         of its flattened member types), and that dictionary type and its ancestors have no required
76         members, and the argument is either the final argument or is followed only by optional arguments,
77         then the argument must be specified as optional. Such arguments are always considered to have a
78         default value of an empty dictionary, unless otherwise specified.
79         """
80
81         Test: gamepad/gamepad-event.html
82
83         * Modules/gamepad/GamepadEvent.idl:
84
85 2017-09-21  Brian Burg  <bburg@apple.com>
86
87         Web Inspector: keyboard shortcut for "Reload page from origin" doesn't match Safari, and doesn't work
88         https://bugs.webkit.org/show_bug.cgi?id=177010
89         <rdar://problem/33134548>
90
91         Reviewed by Joseph Pecoraro.
92
93         Use "reload from origin" nomenclature instead of "reload ignoring cache".
94
95         * inspector/InspectorPageAgent.cpp:
96         (WebCore::InspectorPageAgent::reload):
97         * inspector/InspectorPageAgent.h:
98
99 2017-09-21  Antti Koivisto  <antti@apple.com>
100
101         Remove RenderNamedFlowFragment
102         https://bugs.webkit.org/show_bug.cgi?id=177299
103
104         Reviewed by David Hyatt.
105
106         Remove the remaining named flow rendering code.
107
108         The feature is already disabled, no functional changes.
109
110         * WebCore.xcodeproj/project.pbxproj:
111         * rendering/RenderBlock.cpp:
112         (WebCore::RenderBlock::paint):
113         (WebCore::RenderBlock::selectionGaps):
114         (WebCore::RenderBlock::nodeAtPoint):
115         * rendering/RenderBlockFlow.cpp:
116         (WebCore::RenderBlockFlow::insertedIntoTree):
117         (WebCore::RenderBlockFlow::willBeDestroyed):
118         (WebCore::RenderBlockFlow::layoutBlock):
119         (WebCore::RenderBlockFlow::styleDidChange):
120         (WebCore::RenderBlockFlow::updateLogicalHeight):
121         (WebCore::RenderBlockFlow::positionForPoint):
122         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded): Deleted.
123         (WebCore::RenderBlockFlow::canHaveChildren const): Deleted.
124         (WebCore::RenderBlockFlow::canHaveGeneratedChildren const): Deleted.
125         (WebCore::RenderBlockFlow::namedFlowFragmentNeedsUpdate const): Deleted.
126         (WebCore::RenderBlockFlow::setRenderNamedFlowFragment): Deleted.
127         * rendering/RenderBlockFlow.h:
128         (WebCore::RenderBlockFlow::RenderBlockFlowRareData::RenderBlockFlowRareData):
129         (WebCore::RenderBlockFlow::renderNamedFlowFragment const): Deleted.
130         (WebCore::RenderElement::isRenderNamedFlowFragmentContainer const): Deleted.
131         * rendering/RenderBox.cpp:
132         (WebCore::RenderBox::nodeAtPoint):
133         (WebCore::RenderBox::paintBoxDecorations):
134         (WebCore::RenderBox::pushContentsClip):
135         (WebCore::RenderBox::mapLocalToContainer const):
136         (WebCore::RenderBox::isUnsplittableForPagination const):
137         (WebCore::RenderBox::overflowRectForPaintRejection const):
138         * rendering/RenderBox.h:
139         * rendering/RenderBoxModelObject.cpp:
140         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
141         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
142         * rendering/RenderBoxModelObject.h:
143         * rendering/RenderElement.h:
144         (WebCore::RenderElement::generatingElement const):
145         * rendering/RenderFlowThread.cpp:
146         (WebCore::RenderFlowThread::RenderFlowThread):
147         (WebCore::RenderFlowThread::invalidateRegions):
148         (WebCore::RenderFlowThread::validateRegions):
149         (WebCore::RenderFlowThread::layout):
150         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const):
151         (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
152         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
153         (WebCore::RenderFlowThread::addForcedRegionBreak):
154         (WebCore::RenderFlowThread::hasCompositingRegionDescendant const): Deleted.
155         (WebCore::RenderFlowThread::getLayerListForRegion const): Deleted.
156         (WebCore::RenderFlowThread::regionForCompositedLayer const): Deleted.
157         (WebCore::RenderFlowThread::cachedRegionForCompositedLayer const): Deleted.
158         (WebCore::RenderFlowThread::updateLayerToRegionMappings): Deleted.
159         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings): Deleted.
160         (WebCore::RenderFlowThread::collectsGraphicsLayersUnderRegions const): Deleted.
161         (WebCore::RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent const): Deleted.
162         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight): Deleted.
163         (WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout): Deleted.
164         (WebCore::RenderFlowThread::incrementAutoLogicalHeightRegions): Deleted.
165         (WebCore::RenderFlowThread::decrementAutoLogicalHeightRegions): Deleted.
166         * rendering/RenderFlowThread.h:
167         * rendering/RenderLayer.cpp:
168         (WebCore::RenderLayer::updateLayerPositions):
169         (WebCore::expandClipRectForDescendantsAndReflection):
170         (WebCore::RenderLayer::paintLayer):
171         (WebCore::RenderLayer::paintLayerContents):
172         (WebCore::RenderLayer::paintList):
173         (WebCore::isHitCandidate):
174         (WebCore::RenderLayer::hitTestLayer):
175         (WebCore::RenderLayer::hitTestList):
176         (WebCore::RenderLayer::calculateClipRects const):
177         (WebCore::expandClipRectForRegionAndReflection): Deleted.
178         (WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions const): Deleted.
179         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer const): Deleted.
180         * rendering/RenderLayer.h:
181         * rendering/RenderLayerBacking.cpp:
182         (WebCore::RenderLayerBacking::shouldClipCompositedBounds const):
183         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
184         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
185         (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread const): Deleted.
186         * rendering/RenderLayerBacking.h:
187         * rendering/RenderLayerCompositor.cpp:
188         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
189         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
190         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
191         (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
192         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
193         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements): Deleted.
194         (WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree): Deleted.
195         * rendering/RenderLayerCompositor.h:
196         * rendering/RenderNamedFlowFragment.cpp: Removed.
197         * rendering/RenderNamedFlowFragment.h: Removed.
198         * rendering/RenderObject.cpp:
199         (WebCore::RenderObject::containerForRepaint const):
200         (WebCore::RenderObject::fixedPositionedWithNamedFlowContainingBlock const): Deleted.
201         (WebCore::hasFixedPosInNamedFlowContainingBlock): Deleted.
202         (WebCore::RenderObject::currentRenderNamedFlowFragment const): Deleted.
203         * rendering/RenderObject.h:
204         (WebCore::RenderObject::isRenderRegion const):
205         (WebCore::RenderObject::isAnonymousBlock const):
206         (WebCore::RenderObject::isRenderNamedFlowFragment const): Deleted.
207         * rendering/RenderRegion.cpp:
208         * rendering/RenderRegion.h:
209         (WebCore::RenderRegion::hasAutoLogicalHeight const): Deleted.
210         * rendering/RenderReplaced.cpp:
211         (WebCore::RenderReplaced::shouldPaint):
212         * rendering/RenderTable.cpp:
213         (WebCore::RenderTable::overflowClipRect):
214         (WebCore::RenderTable::nodeAtPoint):
215         * rendering/RenderTableSection.cpp:
216         (WebCore::RenderTableSection::nodeAtPoint):
217         * rendering/RenderTreeAsText.cpp:
218         (WebCore::writeLayers):
219         * rendering/RenderView.cpp:
220         (WebCore::RenderView::layout):
221         (WebCore::RenderView::pushLayoutState):
222         (WebCore::RenderView::pushLayoutStateForPaginationIfNeeded):
223         (WebCore::RenderView::layoutContentInAutoLogicalHeightRegions): Deleted.
224         (WebCore::RenderView::checkTwoPassLayoutForAutoHeightRegions const): Deleted.
225         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread): Deleted.
226         (WebCore::RenderView::popLayoutStateForCurrentFlowThread): Deleted.
227         * rendering/RenderView.h:
228         * rendering/RootInlineBox.cpp:
229         (WebCore::RootInlineBox::paint):
230         * rendering/svg/RenderSVGRoot.cpp:
231         (WebCore::RenderSVGRoot::paintReplaced):
232
233 2017-09-21  Alex Christensen  <achristensen@webkit.org>
234
235         Fix all builds after r222325
236
237         * loader/DocumentLoader.h:
238         WebKit needs this, too.
239
240 2017-09-21  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
241
242         [PAL] Move MediaTimeAVFoundation into PAL
243         https://bugs.webkit.org/show_bug.cgi?id=177222
244
245         Reviewed by Myles C. Maxfield.
246
247         No new tests. No change in behavior..
248
249         * Configurations/WebCore.unexp:
250         * PlatformAppleWin.cmake:
251         * WebCore.xcodeproj/project.pbxproj:
252         * platform/audio/mac/AudioSampleDataSource.mm:
253         (WebCore::AudioSampleDataSource::pushSamples):
254         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
255         (WebCore::AudioSourceProviderAVFObjC::process):
256         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
257         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
258         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
259         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
260         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
261         (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration const):
262         (WebCore::MediaPlayerPrivateAVFoundationCF::currentMediaTime const):
263         (WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges const):
264         (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable const):
265         (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable const):
266         (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded const):
267         (WebCore::AVFWrapper::seekToTime):
268         (WebCore::AVFWrapper::legibleOutputCallback):
269         (WebCore::AVFWrapper::createImageForTimeInRect):
270         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
271         (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
272         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
273         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
274         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
275         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
276         (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime const):
277         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
278         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges const):
279         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable const):
280         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable const):
281         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded const):
282         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
283         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
284         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
285         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
286         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
287         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTime const):
288         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
289         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
290         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
291         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
292         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::calculateTimelineOffset):
293         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
294         (WebCore::MediaSampleAVFObjC::presentationTime const):
295         (WebCore::MediaSampleAVFObjC::outputPresentationTime const):
296         (WebCore::MediaSampleAVFObjC::decodeTime const):
297         (WebCore::MediaSampleAVFObjC::duration const):
298         (WebCore::MediaSampleAVFObjC::outputDuration const):
299         (WebCore::MediaSampleAVFObjC::offsetTimestampsBy):
300         (WebCore::MediaSampleAVFObjC::setTimestamps):
301         (WebCore::MediaSampleAVFObjC::divide):
302         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
303         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
304         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
305         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
306         (WebCore::WebCoreDecompressionSession::automaticDequeue):
307         (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
308         (WebCore::WebCoreDecompressionSession::imageForTime):
309         * platform/mac/PlatformClockCM.mm:
310         (PlatformClockCM::setCurrentMediaTime):
311         (PlatformClockCM::currentMediaTime const):
312         * platform/mac/PlaybackSessionInterfaceMac.mm:
313         (WebCore::timeRangesToArray):
314         * platform/mac/VideoFullscreenInterfaceMac.mm:
315         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
316         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
317         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
318         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
319         (WebCore::RealtimeIncomingAudioSource::OnData):
320         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
321
322 2017-09-21  Alex Christensen  <achristensen@webkit.org>
323
324         Fix ASAN build after r222306
325         https://bugs.webkit.org/show_bug.cgi?id=177255
326
327         * loader/DocumentLoader.cpp:
328         (WebCore::DocumentLoader::setCustomHeaderFields):
329         * loader/DocumentLoader.h:
330         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
331         Moving a Vector of a type requires more than just a forward declaration of the type, but only in ASAN builds.  Weird.
332
333 2017-09-21  Zhifei FANG  <facetothefate@gmail.com>
334
335         In regular block layout, the width of a child's margin box should always be equal to that of its containing block
336         Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
337         https://bugs.webkit.org/show_bug.cgi?id=176620
338
339         Reviewed by Zalan Bujtas.
340
341         Test: fast/block/over-constrained-auto-margin.html
342
343         * rendering/RenderBox.cpp:
344         (WebCore::RenderBox::computeLogicalWidthInRegion const):
345
346 2017-09-21  Javier Fernandez  <jfernandez@igalia.com>
347
348         Unpredictable selection when dragging out of float elements children of in-flow block-level box
349         https://bugs.webkit.org/show_bug.cgi?id=176096
350
351         Reviewed by David Hyatt.
352
353         In order to improve Selection across float elements we need to
354         consider them as HitTest candidates.  Additionally, since
355         out-of-flow elements must not affect how in-flow elements are
356         rendered we have to deal with some special cases when implementing
357         the positionForPoint logic.
358
359         This patch addresses the issues caused by the fact that an in-flow
360         box's logicalBottom does not consider the out-of-flow children, as
361         they don't affect its height. Hence, we should add the lowest float
362         logical bottom to figure out the box the point is actually hitting.
363
364         Tests: editing/selection/select-out-of-floated-non-editable-01.html
365                editing/selection/select-out-of-floated-non-editable-02.html
366                editing/selection/select-out-of-floated-non-editable-03.html
367                editing/selection/select-out-of-floated-non-editable-04.html
368                editing/selection/select-out-of-floated-non-editable-05.html
369                editing/selection/select-out-of-floated-non-editable-06.html
370                editing/selection/select-out-of-floated-non-editable-07.html
371                editing/selection/select-out-of-floated-non-editable-08.html
372                editing/selection/select-out-of-floated-non-editable-09.html
373                editing/selection/select-out-of-floated-non-editable-10.html
374                editing/selection/select-out-of-floated-non-editable-11.html
375                editing/selection/select-out-of-floated-non-editable-12.html
376
377         * rendering/RenderBlock.cpp:
378         (WebCore::isChildHitTestCandidate):
379         (WebCore::RenderBlock::positionForPoint):
380
381 2017-09-21  Zan Dobersek  <zdobersek@igalia.com>
382
383         [WebCrypto] Support Elliptic Curve P-521
384         https://bugs.webkit.org/show_bug.cgi?id=169231
385         <rdar://problem/30881703>
386
387         Reviewed by Jiewen Tan.
388
389         Add support for the P-521 elliptic curve to the CryptoKeyEC class, but
390         allow the underlying platform-specific implementations to opt out of
391         supporting this feature.
392
393         This is achieved with the platformSupportedCurve() static function that
394         each platform has to implement, returning true if the passed-in curve
395         type is supported. The function is called at each CryptoKeyEC entrypoint,
396         that is in each static function that could generate a new CryptoKeyEC
397         object. These functions return a NotSupportedError exception in case the
398         platformSupportedCurve() call returns false.
399
400         While the libgcrypt-based implementation will support P-521 curves in
401         the near future, the CommonCrypto-based implementation might not. The use
402         of platformSupportedCurve() ensures that the implementations that don't
403         support EC P-521 continue to return the NotSupportedError exception at
404         these entrypoints, instead of the OperationError exception that's returned
405         when the platform-specific extensions of these entrypoints fail due to the
406         specified elliptic curve not being supported.
407
408         Both libgcrypt-based and CommonCrypto-based implementations mark P-256 and
409         P-384 curves as supported. Switch statements handling NamedCurve values
410         must now also handle the NamedCurve::P521 value, but both implementations
411         treat that as an unreachable case since support is not indicated in
412         platformSupportedCurve(), and all CryptoKeyEC operations should have
413         returned with an NotSupportedError exception before entering
414         platform-specific code. The common CryptoKeyEC constructor similarly asserts
415         that the specified curve is supported by the underlying implementation.
416
417         CryptoAlgorithmECDSA is modified to now also support 'ES512' as the algorithm
418         identifier, matching it against the 'P-521' curve value.
419
420         No new tests -- tests covering EC P-521 already exist, but no platform
421         runs them yet due to missing implementations.
422
423         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
424         (WebCore::CryptoAlgorithmECDSA::importKey):
425         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
426         (WebCore::curveName):
427         (WebCore::curveIdentifier):
428         (WebCore::curveSize):
429         (WebCore::curveUncompressedFieldElementSize):
430         (WebCore::CryptoKeyEC::platformSupportedCurve):
431         * crypto/keys/CryptoKeyEC.cpp:
432         (WebCore::toNamedCurve):
433         (WebCore::CryptoKeyEC::CryptoKeyEC):
434         (WebCore::CryptoKeyEC::generatePair):
435         (WebCore::CryptoKeyEC::importRaw):
436         (WebCore::CryptoKeyEC::importJwk):
437         (WebCore::CryptoKeyEC::importSpki):
438         (WebCore::CryptoKeyEC::importPkcs8):
439         (WebCore::CryptoKeyEC::exportJwk const):
440         (WebCore::CryptoKeyEC::namedCurveString const):
441         (WebCore::CryptoKeyEC::algorithm const):
442         * crypto/keys/CryptoKeyEC.h:
443         * crypto/mac/CryptoKeyECMac.cpp:
444         (WebCore::doesUncompressedPointMatchNamedCurve):
445         (WebCore::doesFieldElementMatchNamedCurve):
446         (WebCore::getKeySizeFromNamedCurve):
447         (WebCore::CryptoKeyEC::platformSupportedCurve):
448         (WebCore::getOID):
449
450 2017-09-20  Antti Koivisto  <antti@apple.com>
451
452         inspector/dom/content-node-region-info.html and inspector/dom/content-flow tests crashing
453         https://bugs.webkit.org/show_bug.cgi?id=177249
454         <rdar://problem/34559968>
455
456         Unreviewed.
457
458         * inspector/InspectorCSSAgent.cpp:
459         (WebCore::InspectorCSSAgent::getNamedFlowCollection):
460
461             Fix crashing by adding a few lines of removed code back.
462
463 2017-09-20  Zalan Bujtas  <zalan@apple.com>
464
465         Remove redundant SelectionSubtreeData functions.
466         https://bugs.webkit.org/show_bug.cgi?id=177288
467
468         Reviewed by Simon Fraser.
469
470         No change in functionality.
471
472         * rendering/SelectionSubtreeRoot.h:
473         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
474         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos const):
475         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionClear const): Deleted.
476         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStart): Deleted.
477         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos): Deleted.
478         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEnd): Deleted.
479         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos): Deleted.
480         (): Deleted.
481
482 2017-09-20  Alex Christensen  <achristensen@webkit.org>
483
484         Add infrastructure for adding custom headers to requests per website
485         https://bugs.webkit.org/show_bug.cgi?id=177255
486
487         Reviewed by Geoffrey Garen.
488
489         Covered by API tests.
490
491         * CMakeLists.txt:
492         * WebCore.xcodeproj/project.pbxproj:
493         * loader/DocumentLoader.cpp:
494         * loader/DocumentLoader.h:
495         (WebCore::DocumentLoader::setCustomHeaderFields):
496         * loader/HTTPHeaderField.cpp: Added.
497         (WebCore::RFC7230::isTokenCharacter):
498         (WebCore::RFC7230::isDelimiter):
499         (WebCore::RFC7230::isVisibleCharacter):
500         (WebCore::RFC7230::isWhitespace):
501         (WebCore::RFC7230::isInRange):
502         (WebCore::RFC7230::isOBSText):
503         (WebCore::RFC7230::isQuotedTextCharacter):
504         (WebCore::RFC7230::isQuotedPairSecondOctet):
505         (WebCore::RFC7230::isCommentText):
506         (WebCore::RFC7230::isValidName):
507         (WebCore::RFC7230::isValidValue):
508         (WebCore::HTTPHeaderField::HTTPHeaderField):
509         * loader/HTTPHeaderField.h: Added.
510         (WebCore::HTTPHeaderField::encode const):
511         (WebCore::HTTPHeaderField::decode):
512
513 2017-09-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
514
515         REGRESSION(r191731): SVGPatternElement can only reference another SVGPatternElement in the same SVG document
516         https://bugs.webkit.org/show_bug.cgi?id=176221
517
518         Reviewed by Tim Horton.
519
520         According to the specs:
521
522         https://www.w3.org/TR/SVG11/filters.html#FilterElementHrefAttribute
523         https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementHrefAttribute
524         https://www.w3.org/TR/SVG11/pservers.html#RadialGradientElementHrefAttribute
525         https://www.w3.org/TR/SVG11/pservers.html#PatternElementHrefAttribute
526
527         The xlink:href attribute of the SVG filter, gradient and pattern elements
528         must reference another element within the current SVG of the same type.
529
530         In r191731, the code of SVGPatternElement::collectPatternAttributes() was
531         removed and replaced by RenderSVGResourcePattern::collectPatternAttributes()
532         to avoid cyclic reference in the pattern element. The problem is the old
533         code used to check whether the referenced element is<SVGPatternElement>
534         before casting it. This code was not copied to the new function. So we
535         now allow the SVGPatternElement to reference any SVG resource element.
536
537         To fix this issue, we need to prevent SVGResources from chaining an incorrect
538         type of element to the SVG filter, gradient and pattern elements.
539
540         We also need to use the SVGResources for getting the referenced element
541         when collecting the attributes for the gradient elements. SVGResources solves
542         the cyclic referencing issue so there is no need to repeat the same code
543         in many places. Also, from now on the SVGResources will have valid linked
544         resource only. So casting the referenced element should always be valid.
545
546         Tests: svg/custom/pattern-invalid-content-inheritance.svg
547
548         * rendering/svg/RenderSVGResourcePattern.cpp:
549         (WebCore::RenderSVGResourcePattern::collectPatternAttributes const): Asserts
550         the linkedResource is of type RenderSVGResourcePattern.
551         * rendering/svg/SVGResources.cpp:
552         (WebCore::SVGResources::SVGResources):
553         (WebCore::isChainableResource): Ensure that an SVG resource can reference
554         only an SVG resource with the valid type.
555         (WebCore::SVGResources::buildCachedResources):
556         * rendering/svg/SVGResources.h:
557
558 2017-09-20  Daniel Bates  <dabates@apple.com>
559
560         Spelling and grammar dots should not overlap
561         https://bugs.webkit.org/show_bug.cgi?id=177265
562         <rdar://problem/34556424>
563
564         Reviewed by David Hyatt.
565
566         A line may contain both spelling and grammar errors such that these errors overlap.
567         For example, "to mooof or not to mooof.". It is more pleasing aesthetically to
568         paint spelling and grammar dots such that they do not overlap. This also matches
569         AppKit's behavior.
570
571         A side benefit of this change is that it adds support infrastructure towards
572         implementing the CSS Pseudo-Elements Module Level 4 pseudo elements ::spelling-error
573         and ::grammar-error (see <https://bugs.webkit.org/show_bug.cgi?id=175784>).
574         It will also make it straightforward to add ::inactive-selection and allow us
575         to make ::selection conform to CSS Pseudo-Elements Module Level 4.
576
577         * CMakeLists.txt: Add file MarkerSubrange.cpp.
578         * WebCore.xcodeproj/project.pbxproj: Add files MarkerSubrange.{cpp, h}.
579         * rendering/InlineTextBox.cpp:
580         (WebCore::InlineTextBox::paintDocumentMarker): Modified to take a const MarkerSubrange&
581         instead of a RenderedDocumentMarker&.
582         (WebCore::InlineTextBox::paintTextMatchMarker): Modified to take a const MarkerSubrange&
583         instead of a RenderedDocumentMarker& and take a boolean as to whether the text match is active.
584         (WebCore::InlineTextBox::paintDocumentMarkers): Collect the subranges that need to be
585         painted, subdivide them preserving only the frontmost subrange when two or more subranges
586         overlap and paint the resulting subranges.
587         (WebCore::lineStyleForMarkerType): Deleted; converted to a lambda function inlined
588         in paintDocumentMarker() as this is the only place we made use of this function.
589         * rendering/InlineTextBox.h:
590         * rendering/MarkerSubrange.cpp: Added.
591         (WebCore::subdivide): Subdivides the specified list of subranges and returns a list of non-overlapping
592         subranges in paint order. The implementation of subdivide() is derived from an algorithm that
593         Said Abou-Hallawa came up with.
594         * rendering/MarkerSubrange.h: Added.
595         (WebCore::MarkerSubrange::MarkerSubrange):
596
597 2017-09-20  Alex Christensen  <achristensen@webkit.org>
598
599         Remove ActionType::CSSDisplayNoneStyleSheet
600         https://bugs.webkit.org/show_bug.cgi?id=177275
601
602         Reviewed by Andy Estes.
603
604         It not a real action type anyways.  It was a fake action type
605         that stored a String indicating which ContentRuleLists had not triggered
606         an ignore-previous-rules action, so we should apply the default stylesheet,
607         which is the css-display-none selectors that match everything.
608
609         No change in behaviour.  Covered by existing tests.
610
611         * contentextensions/ContentExtensionActions.h:
612         * contentextensions/ContentExtensionCompiler.cpp:
613         (WebCore::ContentExtensions::serializeActions):
614         * contentextensions/ContentExtensionRule.cpp:
615         (WebCore::ContentExtensions::Action::deserialize):
616         (WebCore::ContentExtensions::Action::deserializeType):
617         (WebCore::ContentExtensions::Action::serializedLength):
618         * contentextensions/ContentExtensionRule.h:
619         (WebCore::ContentExtensions::Action::Action):
620         * contentextensions/ContentExtensionsBackend.cpp:
621         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
622         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
623         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
624         * contentextensions/ContentExtensionsBackend.h:
625         * page/DOMWindow.cpp:
626         (WebCore::DOMWindow::open):
627         * page/UserContentProvider.cpp:
628         (WebCore::UserContentProvider::actionsForResourceLoad):
629         * page/UserContentProvider.h:
630
631 2017-09-20  Zalan Bujtas  <zalan@apple.com>
632
633         FloatingObject should not hold a raw pointer to RootInlineBox.
634         https://bugs.webkit.org/show_bug.cgi?id=177266
635
636         Reviewed by Simon Fraser.
637
638         FloatingObject and RootInlineBox objects' lifetimes are very much independent from each other.
639
640         Not testable.
641
642         * rendering/FloatingObjects.cpp:
643         (WebCore::FloatingObjects::clearLineBoxTreePointers):
644         * rendering/FloatingObjects.h:
645         (WebCore::FloatingObject::originatingLine const):
646         (WebCore::FloatingObject::clearOriginatingLine):
647         (WebCore::FloatingObject::setOriginatingLine):
648         * rendering/RenderBlockFlow.cpp:
649         (WebCore::RenderBlockFlow::removeFloatingObject):
650         * rendering/RenderBlockLineLayout.cpp:
651         (WebCore::RenderBlockFlow::appendFloatingObjectToLastLine):
652         (WebCore::RenderBlockFlow::reattachCleanLineFloats):
653         (WebCore::RenderBlockFlow::determineStartPosition):
654         * rendering/RootInlineBox.cpp:
655         (WebCore::RootInlineBox::RootInlineBox):
656         * rendering/RootInlineBox.h:
657         (WebCore::RootInlineBox::createWeakPtr):
658
659 2017-09-20  Chris Dumez  <cdumez@apple.com>
660
661         Drop legacy DOMError type
662         https://bugs.webkit.org/show_bug.cgi?id=177207
663
664         Reviewed by Eric Carlson.
665
666         Drop legacy DOMError type. It has been removed from the Web standards,
667         is no longer used by our implementation and was not exposed to the
668         Web in WebKit (i.e. marked as [NoInterfaceObject]).
669
670         * CMakeLists.txt:
671         * DerivedSources.cpp:
672         * DerivedSources.make:
673         * Modules/mediastream/MediaEndpointSessionDescription.h:
674         * WebCore.xcodeproj/project.pbxproj:
675         * bindings/js/JSDOMPromiseDeferred.cpp:
676         * dom/DOMAllInOne.cpp:
677         * dom/DOMError.cpp: Removed.
678         * dom/DOMError.h: Removed.
679         * dom/DOMError.idl: Removed.
680         * platform/mock/RTCNotifiersMock.cpp:
681
682 2017-09-20  Commit Queue  <commit-queue@webkit.org>
683
684         Unreviewed, rolling out r222254.
685         https://bugs.webkit.org/show_bug.cgi?id=177267
686
687         Caused fast/images/animated-gif-webkit-transform.html to time
688         out, and possible perf regression (Requested by smfr on
689         #webkit).
690
691         Reverted changeset:
692
693         "Simplify compositing layer updating"
694         https://bugs.webkit.org/show_bug.cgi?id=176196
695         http://trac.webkit.org/changeset/222254
696
697 2017-09-20  Alex Christensen  <achristensen@webkit.org>
698
699         Remove ActionType::InvalidAction
700         https://bugs.webkit.org/show_bug.cgi?id=177262
701
702         Reviewed by Tim Horton.
703
704         This was needed before r213322 because we needed to have a default constructor.
705         With all these cool new C++14/17 types, we don't need this any more.
706
707         No change in behaviour.
708
709         * contentextensions/ContentExtensionActions.h:
710         * contentextensions/ContentExtensionCompiler.cpp:
711         (WebCore::ContentExtensions::serializeActions):
712         * contentextensions/ContentExtensionRule.cpp:
713         (WebCore::ContentExtensions::Action::deserialize):
714         (WebCore::ContentExtensions::Action::deserializeType):
715         (WebCore::ContentExtensions::Action::serializedLength):
716         * contentextensions/ContentExtensionRule.h:
717         * contentextensions/ContentExtensionsBackend.cpp:
718         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
719         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
720
721 2017-09-20  Daniel Bates  <dabates@apple.com>
722
723         RenderedDocumentMarker.h should include DocumentMarker.h
724         https://bugs.webkit.org/show_bug.cgi?id=177263
725
726         Reviewed by Andy Estes.
727
728         RenderedDocumentMarker extends DocumentMarker. RenderedDocumentMarker.h should
729         include DocumentMarker.h. Otherwise, both DocumentMarker.h and RenderedDocumentMarker.h
730         must be explicitly included.
731
732         * dom/RenderedDocumentMarker.h:
733         * rendering/RenderText.cpp:
734         * testing/Internals.cpp:
735
736 2017-09-20  Alex Christensen  <achristensen@webkit.org>
737
738         Clean up content extensions code in preparation for more actions with string arguments
739         https://bugs.webkit.org/show_bug.cgi?id=177258
740
741         Reviewed by Tim Horton.
742
743         No change in behaviour.  Covered by existing tests.
744
745         * contentextensions/ContentExtensionCompiler.cpp:
746         (WebCore::ContentExtensions::serializeString):
747         (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
748         (WebCore::ContentExtensions::serializeActions):
749         (WebCore::ContentExtensions::serializeSelector): Deleted.
750         * contentextensions/ContentExtensionParser.cpp:
751         (WebCore::ContentExtensions::loadAction):
752         (WebCore::ContentExtensions::loadRule):
753         * contentextensions/ContentExtensionRule.cpp:
754         (WebCore::ContentExtensions::deserializeString):
755         (WebCore::ContentExtensions::Action::deserialize):
756         (WebCore::ContentExtensions::Action::deserializeType):
757         (WebCore::ContentExtensions::Action::serializedLength):
758         * contentextensions/ContentExtensionRule.h:
759         (WebCore::ContentExtensions::Action::Action):
760
761 2017-09-20  Joanmarie Diggs  <jdiggs@igalia.com>
762
763         [ATK] atk_table_get_n_rows() and atk_table_get_n_columns() should return values of aria-rowcount and aria-colcount, if present
764         https://bugs.webkit.org/show_bug.cgi?id=171172
765
766         Reviewed by Chris Fleizach.
767
768         Modify webKitAccessibleTableGetNColumns() and webkitAccessibleTableGetNRows()
769         to prefer the ARIA value over the DOM-based value.
770
771         No new tests needed: We already have coverage through aria-table-attributes.html.
772         Platform expectations for this test were updated.
773
774         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
775         (webkitAccessibleTableGetNColumns):
776         (webkitAccessibleTableGetNRows):
777
778 2017-09-20  Youenn Fablet  <youenn@apple.com>
779
780         Rename CacheStorage to DOMCacheStorage
781         https://bugs.webkit.org/show_bug.cgi?id=177025
782
783         Reviewed by Chris Dumez.
784
785         No change of behavior, just renaming CacheStorage class and files to DOMCacheStorage.
786
787         * CMakeLists.txt:
788         * DerivedSources.make:
789         * Modules/cache/DOMCacheStorage.cpp: Renamed from Source/WebCore/Modules/cache/CacheStorage.cpp.
790         (WebCore::DOMCacheStorage::DOMCacheStorage):
791         (WebCore::DOMCacheStorage::origin const):
792         (WebCore::doSequentialMatch):
793         (WebCore::startSequentialMatch):
794         (WebCore::copyCaches):
795         (WebCore::DOMCacheStorage::match):
796         (WebCore::DOMCacheStorage::has):
797         (WebCore::DOMCacheStorage::retrieveCaches):
798         (WebCore::logConsolePersistencyError):
799         (WebCore::DOMCacheStorage::open):
800         (WebCore::DOMCacheStorage::remove):
801         (WebCore::DOMCacheStorage::keys):
802         (WebCore::DOMCacheStorage::stop):
803         (WebCore::DOMCacheStorage::activeDOMObjectName const):
804         (WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const):
805         * Modules/cache/DOMCacheStorage.h: Renamed from Source/WebCore/Modules/cache/CacheStorage.h.
806         (WebCore::DOMCacheStorage::create):
807         * Modules/cache/DOMCacheStorage.idl: Renamed from Source/WebCore/Modules/cache/CacheStorage.idl.
808         * Modules/cache/DOMWindowCaches.cpp:
809         (WebCore::DOMWindowCaches::caches):
810         (WebCore::DOMWindowCaches::caches const):
811         * Modules/cache/DOMWindowCaches.h:
812         * Modules/cache/DOMWindowCaches.idl:
813         * Modules/cache/WorkerGlobalScopeCaches.cpp:
814         (WebCore::WorkerGlobalScopeCaches::caches):
815         (WebCore::WorkerGlobalScopeCaches::caches const):
816         * Modules/cache/WorkerGlobalScopeCaches.h:
817         * Modules/cache/WorkerGlobalScopeCaches.idl:
818         * WebCore.xcodeproj/project.pbxproj:
819
820 2017-09-20  Eric Carlson  <eric.carlson@apple.com>
821
822         Switch PeerConnection to release logging
823         https://bugs.webkit.org/show_bug.cgi?id=177193
824         <rdar://problem/34529014>
825
826         Reviewed by Youenn Fablet.
827
828         * Modules/mediastream/PeerConnectionBackend.cpp:
829         (WebCore::PeerConnectionBackend::PeerConnectionBackend):
830         (WebCore::PeerConnectionBackend::createOfferSucceeded):
831         (WebCore::PeerConnectionBackend::createOfferFailed):
832         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
833         (WebCore::PeerConnectionBackend::createAnswerFailed):
834         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
835         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
836         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
837         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
838         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
839         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
840         (WebCore::PeerConnectionBackend::newICECandidate):
841         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
842         (WebCore::PeerConnectionBackend::logChannel const):
843         * Modules/mediastream/PeerConnectionBackend.h:
844         (WebCore::PeerConnectionBackend::PeerConnectionBackend): Deleted.
845
846         * Modules/mediastream/RTCPeerConnection.cpp:
847         (WebCore::RTCPeerConnection::RTCPeerConnection):
848         (WebCore::RTCPeerConnection::~RTCPeerConnection):
849         (WebCore::RTCPeerConnection::addTrack):
850         (WebCore::RTCPeerConnection::removeTrack):
851         (WebCore::RTCPeerConnection::addTransceiver):
852         (WebCore::RTCPeerConnection::queuedCreateOffer):
853         (WebCore::RTCPeerConnection::queuedCreateAnswer):
854         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
855         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
856         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
857         (WebCore::RTCPeerConnection::initializeConfiguration):
858         (WebCore::RTCPeerConnection::setConfiguration):
859         (WebCore::RTCPeerConnection::createDataChannel):
860         (WebCore::RTCPeerConnection::setSignalingState):
861         (WebCore::RTCPeerConnection::updateIceGatheringState):
862         (WebCore::RTCPeerConnection::updateIceConnectionState):
863         (WebCore::RTCPeerConnection::updateConnectionState):
864         (WebCore::RTCPeerConnection::replaceTrack):
865         (WebCore::RTCPeerConnection::dispatchEvent):
866         (WebCore::RTCPeerConnection::logChannel const):
867         (WebCore::rtcIceGatheringStateToString): Deleted.
868         (WebCore::rtcIceConnectionStateToString): Deleted.
869         * Modules/mediastream/RTCPeerConnection.h:
870
871         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
872         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
873         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
874         (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
875         (WebCore::LibWebRTCMediaEndpoint::logChannel const):
876         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
877         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
878         (PAL::LogArgument<webrtc::RTCStats>::toString):
879
880         * platform/mediastream/RTCIceConnectionState.h:
881         (PAL::LogArgument<WebCore::RTCIceConnectionState>::toString):
882
883         * platform/mediastream/RTCIceGatheringState.h:
884         (PAL::LogArgument<WebCore::RTCIceGatheringState>::toString):
885
886         * platform/mediastream/RTCPeerConnectionState.h:
887         (PAL::LogArgument<WebCore::RTCPeerConnectionState>::toString):
888
889         * platform/mediastream/RTCSignalingState.h:
890         (PAL::LogArgument<WebCore::RTCSignalingState>::toString):
891
892 2017-09-20  Chris Dumez  <cdumez@apple.com>
893
894         Video errors should be instances of Error
895         https://bugs.webkit.org/show_bug.cgi?id=174573
896         <rdar://problem/34445494>
897
898         Reviewed by Youenn Fablet.
899
900         Video errors should be instances of DOMException and Error as per:
901         - https://html.spec.whatwg.org/multipage/media.html#reject-pending-play-promises
902         - https://html.spec.whatwg.org/multipage/media.html#loading-the-media-resource:reject-pending-play-promises-2
903         - https://html.spec.whatwg.org/multipage/media.html#loading-the-media-resource:reject-pending-play-promises-3
904         - https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:reject-pending-play-promises-3
905         - https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:reject-pending-play-promises
906
907         No new tests, extended existing test.
908
909         * html/HTMLMediaElement.cpp:
910         (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
911         (WebCore::HTMLMediaElement::noneSupported):
912         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
913         (WebCore::HTMLMediaElement::pauseInternal):
914         * html/HTMLMediaElement.h:
915
916 2017-09-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>
917
918         [Curl] improve the implementation of FormDataStream
919         https://bugs.webkit.org/show_bug.cgi?id=177111
920
921         Reviewed by Alex Christensen.
922
923         * platform/network/curl/FormDataStreamCurl.cpp:
924         (WebCore::FormDataStream::read):
925         (WebCore::FormDataStream::hasMoreElements const):
926         * platform/network/curl/FormDataStreamCurl.h:
927         (WebCore::FormDataStream::setHTTPBody):
928         (WebCore::FormDataStream::FormDataStream): Deleted.
929         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
930         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
931         (WebCore::ResourceHandleCurlDelegate::prepareSendData):
932         (WebCore::ResourceHandleCurlDelegate::didFinish):
933         (WebCore::ResourceHandleCurlDelegate::didFail):
934         (WebCore::ResourceHandleCurlDelegate::setupFormData):
935         * platform/network/curl/ResourceHandleCurlDelegate.h:
936
937 2017-09-20  Miguel Gomez  <magomez@igalia.com>
938
939         [GTK] Completely garbled display in GMail
940         https://bugs.webkit.org/show_bug.cgi?id=168964
941
942         Reviewed by Carlos Garcia Campos.
943
944         Do not try to decode images that are bigger than 32768 pixels, as cairo won't be able to render them,
945         and they will break the rendering of the rest of the page.
946
947         Covered by existent tests.
948
949         * platform/graphics/ImageBackingStore.h:
950         (WebCore::ImageBackingStore::isOverSize):
951
952 2017-09-20  Antti Koivisto  <antti@apple.com>
953
954         Remove RenderNamedFlowThread and FlowThreadController
955         https://bugs.webkit.org/show_bug.cgi?id=177229
956
957         Reviewed by Andreas Kling.
958
959         Get rid of some parts of the rendering code for CSS Regions.
960
961         The feature is disabled, no functional changes.
962
963         * WebCore.xcodeproj/project.pbxproj:
964         * rendering/FlowThreadController.cpp: Removed.
965         * rendering/FlowThreadController.h: Removed.
966         * rendering/RenderBlock.cpp:
967         (WebCore::RenderBlock::paintObject):
968         (WebCore::canComputeRegionRangeForBox):
969         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
970         * rendering/RenderBlockFlow.cpp:
971         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
972         (WebCore::RenderBlockFlow::applyBeforeBreak):
973         (WebCore::RenderBlockFlow::applyAfterBreak):
974         (WebCore::RenderBlockFlow::logicalHeightForChildForFragmentation const):
975         * rendering/RenderBlockLineLayout.cpp:
976         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
977         * rendering/RenderBox.cpp:
978         (WebCore::RenderBox::borderBoxRectInRegion const):
979         (WebCore::RenderBox::scroll):
980         (WebCore::RenderBox::renderBoxRegionInfo const):
981         (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
982         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
983         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
984         * rendering/RenderBoxModelObject.cpp:
985         (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
986         * rendering/RenderElement.cpp:
987         (WebCore::RenderElement::willBeDestroyed):
988         (WebCore::RenderElement::hoverAncestor const):
989         * rendering/RenderFlowThread.cpp:
990         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const):
991         (WebCore::RenderFlowThread::incrementAutoLogicalHeightRegions):
992         (WebCore::RenderFlowThread::decrementAutoLogicalHeightRegions):
993         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
994         * rendering/RenderInline.cpp:
995         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
996         * rendering/RenderLayer.cpp:
997         (WebCore::RenderLayer::paintLayerContents):
998         (WebCore::RenderLayer::hitTestLayer):
999         (WebCore::RenderLayer::calculateClipRects const):
1000         (WebCore::RenderLayer::paintFixedLayersInNamedFlows): Deleted.
1001         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows): Deleted.
1002         * rendering/RenderLayer.h:
1003         * rendering/RenderLayerCompositor.cpp:
1004         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1005         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1006         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1007         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed): Deleted.
1008         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed): Deleted.
1009         * rendering/RenderLayerCompositor.h:
1010         * rendering/RenderNamedFlowFragment.cpp:
1011         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
1012         (WebCore::RenderNamedFlowFragment::namedFlowThread const): Deleted.
1013         * rendering/RenderNamedFlowFragment.h:
1014         * rendering/RenderNamedFlowThread.cpp: Removed.
1015         * rendering/RenderNamedFlowThread.h: Removed.
1016         * rendering/RenderObject.cpp:
1017         (WebCore::RenderObject::selectionRoot const):
1018         (WebCore::RenderObject::offsetParent const):
1019         (WebCore::RenderObject::currentRenderNamedFlowFragment const):
1020         * rendering/RenderObject.h:
1021         (WebCore::RenderObject::isRenderGrid const):
1022         (WebCore::RenderObject::isRenderNamedFlowThread const): Deleted.
1023         * rendering/RenderRegion.cpp:
1024         (WebCore::RenderRegion::RenderRegion):
1025         (WebCore::RenderRegion::attachRegion):
1026         * rendering/RenderRegion.h:
1027         (WebCore::RenderRegion::parentNamedFlowThread const): Deleted.
1028         * rendering/RenderTreeAsText.cpp:
1029         (WebCore::writeLayers):
1030         (WebCore::writeRenderRegionList): Deleted.
1031         (WebCore::writeRenderNamedFlowThreads): Deleted.
1032         * rendering/RenderView.cpp:
1033         (WebCore::RenderView::layoutContent):
1034         (WebCore::RenderView::layoutContentInAutoLogicalHeightRegions):
1035         (WebCore::RenderView::layout):
1036         (WebCore::RenderView::selectionBounds const):
1037         (WebCore::RenderView::repaintSelection const):
1038         (WebCore::RenderView::setSelection):
1039         (WebCore::RenderView::updateSelectionForSubtrees):
1040         (WebCore::RenderView::styleDidChange):
1041         (WebCore::RenderView::checkTwoPassLayoutForAutoHeightRegions const):
1042         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
1043         (WebCore::RenderView::popLayoutStateForCurrentFlowThread):
1044         (WebCore::RenderView::layoutContentToComputeOverflowInRegions): Deleted.
1045         (WebCore::RenderView::splitSelectionBetweenSubtrees): Deleted.
1046         (WebCore::RenderView::hasRenderNamedFlowThreads const): Deleted.
1047         (WebCore::RenderView::flowThreadController): Deleted.
1048         * rendering/RenderView.h:
1049         * rendering/SelectionSubtreeRoot.cpp:
1050         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection): Deleted.
1051         * rendering/SelectionSubtreeRoot.h:
1052         (WebCore::SelectionSubtreeRoot::setSelectionData):
1053
1054 2017-09-20  Antti Koivisto  <antti@apple.com>
1055
1056         Remove DOM and styling support for CSS Regions
1057         https://bugs.webkit.org/show_bug.cgi?id=177221
1058
1059         Reviewed by Andreas Kling.
1060
1061         This patch removes all CSS Regions (aka "named flow") related code excluding rendering.
1062
1063         The feature is already disabled so no functional changes.
1064
1065         * CMakeLists.txt:
1066         * Configurations/FeatureDefines.xcconfig:
1067         * DerivedSources.make:
1068         * WebCore.xcodeproj/project.pbxproj:
1069         * bindings/js/JSCSSRuleCustom.cpp:
1070         (WebCore::toJSNewlyCreated):
1071         * css/CSSComputedStyleDeclaration.cpp:
1072         (WebCore::contentToCSSValue):
1073         (WebCore::ComputedStyleExtractor::propertyValue):
1074         (WebCore::convertToRegionBreak): Deleted.
1075         * css/CSSPrimitiveValueMappings.h:
1076         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1077         (WebCore::CSSPrimitiveValue::operator BreakBetween const):
1078         * css/CSSProperties.json:
1079         * css/CSSRule.cpp:
1080         * css/CSSRule.h:
1081         * css/CSSRule.idl:
1082         * css/ElementRuleCollector.cpp:
1083         (WebCore::ElementRuleCollector::matchAuthorRules):
1084         (WebCore::ElementRuleCollector::matchUserRules):
1085         (WebCore::ElementRuleCollector::collectMatchingRulesForRegion): Deleted.
1086         * css/ElementRuleCollector.h:
1087         (WebCore::ElementRuleCollector::setSameOriginOnly):
1088         (WebCore::ElementRuleCollector::setRegionForStyling): Deleted.
1089         * css/InspectorCSSOMWrappers.cpp:
1090         (WebCore::InspectorCSSOMWrappers::collect):
1091         * css/RuleSet.cpp:
1092         (WebCore::determinePropertyWhitelistType):
1093         (WebCore::RuleData::RuleData):
1094         (WebCore::RuleSet::addChildRules):
1095         (WebCore::RuleSet::shrinkToFit):
1096         (WebCore::RuleSet::addRegionRule): Deleted.
1097         * css/RuleSet.h:
1098         (WebCore::RuleSet:: const):
1099         (WebCore::RuleSet::regionSelectorsAndRuleSets const): Deleted.
1100         * css/StyleBuilderConverter.h:
1101         (WebCore::StyleBuilderConverter::convertRegionBreakBetween): Deleted.
1102         (WebCore::StyleBuilderConverter::convertRegionBreakInside): Deleted.
1103         * css/StyleProperties.cpp:
1104         * css/StyleResolver.cpp:
1105         (WebCore::StyleResolver::State::clear):
1106         (WebCore::StyleResolver::State::State):
1107         (WebCore::StyleResolver::styleForElement):
1108         (WebCore::StyleResolver::CascadedProperties::addMatch):
1109         (WebCore::StyleResolver::checkRegionStyle): Deleted.
1110         (WebCore::isValidRegionStyleProperty): Deleted.
1111         * css/StyleResolver.h:
1112         (WebCore::StyleResolver::State::regionForStyling const): Deleted.
1113         (WebCore::checkRegionSelector): Deleted.
1114         * css/StyleRule.cpp:
1115         (WebCore::StyleRuleBase::destroy):
1116         (WebCore::StyleRuleBase::copy const):
1117         (WebCore::StyleRuleBase::createCSSOMWrapper const):
1118         (WebCore::StyleRuleRegion::StyleRuleRegion): Deleted.
1119         * css/StyleRule.h:
1120         (WebCore::StyleRuleBase::isStyleRule const):
1121         (WebCore::StyleRuleBase::isRegionRule const): Deleted.
1122         * css/StyleSheetContents.cpp:
1123         (WebCore::traverseSubresourcesInRules):
1124         * css/WebKitCSSRegionRule.cpp: Removed.
1125         * css/WebKitCSSRegionRule.h: Removed.
1126         * css/WebKitCSSRegionRule.idl: Removed.
1127         * css/parser/CSSAtRuleID.cpp:
1128         (WebCore::cssAtRuleID):
1129         * css/parser/CSSAtRuleID.h:
1130         * css/parser/CSSParserFastPaths.cpp:
1131         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1132         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1133         * css/parser/CSSParserImpl.cpp:
1134         (WebCore::CSSParserImpl::consumeAtRule):
1135         (WebCore::CSSParserImpl::consumeRegionRule): Deleted.
1136         * css/parser/CSSParserImpl.h:
1137         * css/parser/CSSPropertyParser.cpp:
1138         (WebCore::isLegacyBreakProperty):
1139         (WebCore::CSSPropertyParser::parseSingleValue):
1140         (WebCore::mapFromLegacyBreakProperty):
1141         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
1142         (WebCore::consumeFlowProperty): Deleted.
1143         (WebCore::mapFromRegionBreakBetween): Deleted.
1144         * dom/ContainerNode.cpp:
1145         (WebCore::destroyRenderTreeIfNeeded):
1146         * dom/DOMNamedFlowCollection.cpp: Removed.
1147         * dom/DOMNamedFlowCollection.h: Removed.
1148         * dom/DOMNamedFlowCollection.idl: Removed.
1149         * dom/Document.cpp:
1150         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1151         (WebCore::Document::webkitGetNamedFlows): Deleted.
1152         (WebCore::Document::namedFlows): Deleted.
1153         * dom/Document.h:
1154         * dom/Document.idl:
1155         * dom/Element.cpp:
1156         (WebCore::Element::~Element):
1157         (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
1158         (WebCore::Element::unregisterNamedFlowContentElement): Deleted.
1159         (WebCore::Element::setIsNamedFlowContentElement): Deleted.
1160         (WebCore::Element::clearIsNamedFlowContentElement): Deleted.
1161         (WebCore::Element::rareDataIsNamedFlowContentElement const): Deleted.
1162         (WebCore::Element::setRegionOversetState): Deleted.
1163         (WebCore::Element::regionOversetState const): Deleted.
1164         (WebCore::Element::renderNamedFlowFragment const): Deleted.
1165         (WebCore::Element::shouldMoveToFlowThread const): Deleted.
1166         (WebCore::Element::webkitRegionOverset const): Deleted.
1167         (WebCore::Element::webkitGetRegionFlowRanges const): Deleted.
1168         * dom/Element.h:
1169         (WebCore::Element::isNamedFlowContentElement const): Deleted.
1170         * dom/Element.idl:
1171         * dom/ElementRareData.cpp:
1172         * dom/ElementRareData.h:
1173         (WebCore::ElementRareData::ElementRareData):
1174         (WebCore::ElementRareData::regionOversetState const): Deleted.
1175         (WebCore::ElementRareData::setRegionOversetState): Deleted.
1176         (WebCore::ElementRareData::isNamedFlowContentElement const): Deleted.
1177         (WebCore::ElementRareData::setIsNamedFlowContentElement): Deleted.
1178         * dom/EventTargetFactory.in:
1179         * dom/NamedFlowCollection.cpp: Removed.
1180         * dom/NamedFlowCollection.h: Removed.
1181         * dom/PseudoElement.h:
1182         * dom/WebKitNamedFlow.cpp: Removed.
1183         * dom/WebKitNamedFlow.h: Removed.
1184         * dom/WebKitNamedFlow.idl: Removed.
1185         * inspector/InspectorCSSAgent.cpp:
1186         (WebCore::InspectorCSSAgent::resetNonPersistentData):
1187         (WebCore::ChangeRegionOversetTask::ChangeRegionOversetTask): Deleted.
1188         (WebCore::ChangeRegionOversetTask::scheduleFor): Deleted.
1189         (WebCore::ChangeRegionOversetTask::unschedule): Deleted.
1190         (WebCore::ChangeRegionOversetTask::reset): Deleted.
1191         (WebCore::ChangeRegionOversetTask::timerFired): Deleted.
1192         (WebCore::InspectorCSSAgent::didCreateNamedFlow): Deleted.
1193         (WebCore::InspectorCSSAgent::willRemoveNamedFlow): Deleted.
1194         (WebCore::InspectorCSSAgent::didChangeRegionOverset): Deleted.
1195         (WebCore::InspectorCSSAgent::regionOversetChanged): Deleted.
1196         (WebCore::InspectorCSSAgent::didRegisterNamedFlowContentElement): Deleted.
1197         (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement): Deleted.
1198         (WebCore::InspectorCSSAgent::getNamedFlowCollection): Deleted.
1199         (WebCore::InspectorCSSAgent::documentNodeWithRequestedFlowsId): Deleted.
1200         (WebCore::InspectorCSSAgent::buildArrayForRegions): Deleted.
1201         (WebCore::InspectorCSSAgent::buildObjectForNamedFlow): Deleted.
1202         * inspector/InspectorCSSAgent.h:
1203         * inspector/InspectorInstrumentation.cpp:
1204         (WebCore::InspectorInstrumentation::didCreateNamedFlowImpl): Deleted.
1205         (WebCore::InspectorInstrumentation::willRemoveNamedFlowImpl): Deleted.
1206         (WebCore::InspectorInstrumentation::didChangeRegionOversetImpl): Deleted.
1207         (WebCore::InspectorInstrumentation::didRegisterNamedFlowContentElementImpl): Deleted.
1208         (WebCore::InspectorInstrumentation::didUnregisterNamedFlowContentElementImpl): Deleted.
1209         * inspector/InspectorOverlay.cpp:
1210         (WebCore::buildRendererHighlight):
1211         (WebCore::buildObjectForElementData):
1212         (WebCore::buildObjectForRegion): Deleted.
1213         (WebCore::buildObjectForFlowRegions): Deleted.
1214         * page/EventHandler.cpp:
1215         (WebCore::handleWheelEventInAppropriateEnclosingBox):
1216         * rendering/FlowThreadController.cpp:
1217         (WebCore::FlowThreadController::ensureRenderFlowThreadWithName): Deleted.
1218         * rendering/FlowThreadController.h:
1219         * rendering/RegionOversetState.h: Removed.
1220         * rendering/RenderBlockFlow.cpp:
1221         (WebCore::RenderBlockFlow::applyBeforeBreak):
1222         (WebCore::RenderBlockFlow::applyAfterBreak):
1223         * rendering/RenderNamedFlowFragment.cpp:
1224         (WebCore::RenderNamedFlowFragment::getRanges const):
1225         (WebCore::RenderNamedFlowFragment::layoutBlock):
1226         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
1227         (WebCore::RenderNamedFlowFragment::computeStyleInRegion const):
1228         (WebCore::RenderNamedFlowFragment::setRegionObjectsRegionStyle):
1229         (WebCore::RenderNamedFlowFragment::setRegionOversetState): Deleted.
1230         (WebCore::RenderNamedFlowFragment::regionOversetState const): Deleted.
1231         (WebCore::RenderNamedFlowFragment::updateOversetState): Deleted.
1232         * rendering/RenderNamedFlowFragment.h:
1233         * rendering/RenderNamedFlowThread.cpp:
1234         (WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
1235         (WebCore::RenderNamedFlowThread::clearContentElements):
1236         (WebCore::RenderNamedFlowThread::registerNamedFlowContentElement):
1237         (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentElement):
1238         (WebCore::RenderNamedFlowThread::hasContentElement const):
1239         (WebCore::RenderNamedFlowThread::flowThreadName const):
1240         (WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
1241         (WebCore::RenderNamedFlowThread::regionOversetChangeEventTimerFired):
1242         (WebCore::RenderNamedFlowThread::setMarkForDestruction):
1243         (WebCore::RenderNamedFlowThread::resetMarkForDestruction):
1244         (WebCore::RenderNamedFlowThread::isMarkedForDestruction const):
1245         (WebCore::nextNodeInsideContentElement):
1246         * rendering/RenderNamedFlowThread.h:
1247         * rendering/RenderRegion.cpp:
1248         (WebCore::RenderRegion::installFlowThread):
1249         * rendering/style/RenderStyleConstants.h:
1250         * rendering/style/WillChangeData.cpp:
1251         (WebCore::WillChangeData::propertyCreatesStackingContext):
1252         * style/RenderTreePosition.cpp:
1253         (WebCore::RenderTreePosition::previousSiblingRenderer const):
1254         (WebCore::RenderTreePosition::nextSiblingRenderer const):
1255         (WebCore::RenderTreePosition::insertionPositionForFlowThread): Deleted.
1256         (WebCore::RenderTreePosition::isRendererReparented): Deleted.
1257         * style/RenderTreePosition.h:
1258         (WebCore::RenderTreePosition::RenderTreePosition):
1259         * style/RenderTreeUpdater.cpp:
1260         (WebCore::RenderTreeUpdater::updateElementRenderer):
1261         (WebCore::RenderTreeUpdater::createRenderer):
1262         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
1263         (WebCore::registerElementForFlowThreadIfNeeded): Deleted.
1264         * style/RenderTreeUpdaterGeneratedContent.cpp:
1265         (WebCore::createContentRenderers):
1266         * style/StyleChange.cpp:
1267         (WebCore::Style::determineChange):
1268         * style/StyleTreeResolver.cpp:
1269         (WebCore::Style::TreeResolver::styleForElement):
1270         (WebCore::Style::affectsRenderedSubtree):
1271         * svg/SVGElement.cpp:
1272         (WebCore::SVGElement::shouldMoveToFlowThread const): Deleted.
1273         * svg/SVGElement.h:
1274
1275 2017-09-20  Ms2ger  <Ms2ger@igalia.com>
1276
1277         Add bindings for optional arguments to some WebGL2 methods.
1278         https://bugs.webkit.org/show_bug.cgi?id=177067
1279
1280         Reviewed by Antti Koivisto.
1281
1282         Add bindings for optional arguments to some WebGL2 methods.
1283
1284         No new tests: not much point in adding tests now; these methods don't
1285         do anything anyway.
1286
1287         * html/canvas/WebGL2RenderingContext.cpp:
1288         (WebCore::WebGL2RenderingContext::uniform1uiv):
1289         (WebCore::WebGL2RenderingContext::uniform2uiv):
1290         (WebCore::WebGL2RenderingContext::uniform3uiv):
1291         (WebCore::WebGL2RenderingContext::uniform4uiv):
1292         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
1293         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
1294         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
1295         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
1296         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
1297         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
1298         (WebCore::WebGL2RenderingContext::clearBufferiv):
1299         (WebCore::WebGL2RenderingContext::clearBufferuiv):
1300         (WebCore::WebGL2RenderingContext::clearBufferfv):
1301         * html/canvas/WebGL2RenderingContext.h:
1302         * html/canvas/WebGL2RenderingContext.idl:
1303
1304 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
1305
1306         On Mac, dataTransfer claims to contain URL list when dropping files
1307         https://bugs.webkit.org/show_bug.cgi?id=177219
1308
1309         Reviewed by Wenson Hsieh.
1310
1311         Fixed the bug by removing code which was specifically adding local filenames as URLs in "text/uri-list"
1312         when pasting or dropping files. Neither Chrome nor Firefox exhibit this behavior, and exposing local
1313         filenames reveal sensitive information such as username.
1314
1315         Test: editing/pasteboard/datatransfer-types-dropping-text-file.html
1316
1317         * platform/mac/PasteboardMac.mm:
1318         (WebCore::Pasteboard::readString):
1319         (WebCore::addHTMLClipboardTypesForCocoaType):
1320         (WebCore::absoluteURLsFromPasteboard): Deleted.
1321
1322 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
1323
1324         Simplify compositing layer updating
1325         https://bugs.webkit.org/show_bug.cgi?id=176196
1326
1327         Reviewed by Zalan Bujtas.
1328
1329         Remove compositing layer updating from the updateLayerPositions() code path, which
1330         was problematic because it wasn't pre-order. Instead, just rely on post-layout
1331         compositing updates, which now need to do geometry updates. Micro benchmarking shows
1332         this to be no slower.
1333
1334         We can remove the 'OnHitTest' update type, since we always ensure that layout is updated
1335         before hit testing now.
1336
1337         Also remove a code path that could trigger updateGeometry() during a style change, and
1338         in response to images loads, which were bad because layout may not be up-to-date at this time.
1339
1340         Tested by existing compositing tests. Rebaselined two tests after confirming they are progressions.
1341
1342         * rendering/RenderLayer.cpp:
1343         (WebCore::RenderLayer::updateLayerPositions):
1344         (WebCore::RenderLayer::hitTestLayer):
1345         (WebCore::RenderLayer::calculateClipRects const):
1346         * rendering/RenderLayer.h:
1347         * rendering/RenderLayerBacking.cpp:
1348         (WebCore::RenderLayerBacking::updateGeometry):
1349         (WebCore::RenderLayerBacking::contentChanged):
1350         (WebCore::RenderLayerBacking::updateAfterLayout): Deleted.
1351         * rendering/RenderLayerBacking.h:
1352         * rendering/RenderLayerCompositor.cpp:
1353         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1354         (WebCore::RenderLayerCompositor::layerStyleChanged):
1355         (WebCore::operator<<):
1356         * rendering/RenderLayerCompositor.h:
1357
1358 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
1359
1360         Do more math in terms of FloatSizes and FloatPoints
1361         https://bugs.webkit.org/show_bug.cgi?id=177217
1362
1363         Reviewed by Zalan Bujtas.
1364         
1365         Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
1366         FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
1367         and use them in lots of places to do math in terms of points and sizes.
1368
1369         * html/canvas/CanvasRenderingContext2D.cpp:
1370         (WebCore::CanvasRenderingContext2D::drawImage):
1371         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
1372         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1373         * page/mac/TextIndicatorWindow.mm:
1374         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
1375         * platform/Theme.cpp:
1376         (WebCore::Theme::drawNamedImage const):
1377         * platform/graphics/CrossfadeGeneratedImage.cpp:
1378         (WebCore::drawCrossfadeSubimage):
1379         (WebCore::CrossfadeGeneratedImage::draw):
1380         * platform/graphics/FloatRect.h:
1381         (WebCore::FloatRect::center const):
1382         (WebCore::FloatRect::scale):
1383         * platform/graphics/FloatSize.h:
1384         (WebCore::operator/):
1385         * platform/graphics/GradientImage.cpp:
1386         (WebCore::GradientImage::draw):
1387         * platform/graphics/GraphicsContext.cpp:
1388         (WebCore::GraphicsContext::scaleFactorForDrawing const):
1389         * platform/graphics/GraphicsContext.h:
1390         (WebCore::GraphicsContext::translate):
1391         * platform/graphics/Image.cpp:
1392         (WebCore::Image::drawTiled):
1393         * platform/graphics/ImageBuffer.cpp:
1394         (WebCore::ImageBuffer::clampedSize):
1395         (WebCore::ImageBuffer::createCompatibleBuffer):
1396         * platform/graphics/LayoutSize.h:
1397         * platform/graphics/NamedImageGeneratedImage.cpp:
1398         (WebCore::NamedImageGeneratedImage::draw):
1399         * platform/graphics/Path.cpp:
1400         (WebCore::Path::addRoundedRect):
1401         * platform/graphics/cg/ImageBufferCG.cpp:
1402         (WebCore::ImageBuffer::createCompatibleBuffer):
1403         * platform/graphics/cg/PDFDocumentImage.cpp:
1404         (WebCore::transformContextForPainting):
1405         (WebCore::applyRotationForPainting):
1406         (WebCore::PDFDocumentImage::drawPDFPage):
1407         * platform/graphics/filters/FETile.cpp:
1408         (WebCore::FETile::platformApplySoftware):
1409         * platform/graphics/transforms/AffineTransform.cpp:
1410         (WebCore::AffineTransform::translate):
1411         (WebCore::makeMapBetweenRects):
1412         * platform/graphics/transforms/AffineTransform.h:
1413         * platform/mac/ScrollbarThemeMac.mm:
1414         (WebCore::ScrollbarThemeMac::paint):
1415         * platform/mac/ThemeMac.mm:
1416         (WebCore::paintToggleButton):
1417         (WebCore::paintButton):
1418         (WebCore::paintStepper):
1419         * rendering/FilterEffectRenderer.cpp:
1420         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
1421         * rendering/RenderBoxModelObject.cpp:
1422         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
1423         (WebCore::RenderBoxModelObject::paintBoxShadow):
1424         * rendering/RenderEmbeddedObject.cpp:
1425         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
1426         * rendering/RenderLayer.cpp:
1427         (WebCore::RenderLayer::calculateClipRects const):
1428         * rendering/RenderLayerBacking.cpp:
1429         (WebCore::RenderLayerBacking::paintContents):
1430         * rendering/RenderLayerCompositor.cpp:
1431         (WebCore::paintScrollbar):
1432         (WebCore::RenderLayerCompositor::paintContents):
1433         * rendering/RenderMediaControls.cpp:
1434         (WebCore::getUnzoomedRectAndAdjustCurrentContext):
1435         * rendering/RenderThemeMac.mm:
1436         (WebCore::RenderThemeMac::paintMenuList):
1437         (WebCore::RenderThemeMac::paintSliderThumb):
1438         (WebCore::RenderThemeMac::paintSearchField):
1439         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1440         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
1441         (WebCore::RenderThemeMac::paintImageControlsButton):
1442         * rendering/svg/RenderSVGForeignObject.cpp:
1443         (WebCore::RenderSVGForeignObject::RenderSVGForeignObject):
1444         (WebCore::RenderSVGForeignObject::localToParentTransform const):
1445         * rendering/svg/RenderSVGForeignObject.h:
1446         * rendering/svg/RenderSVGResourceClipper.cpp:
1447         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1448         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
1449         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
1450         (WebCore::RenderSVGResourceClipper::resourceBoundingBox):
1451         * rendering/svg/RenderSVGResourceGradient.cpp:
1452         (WebCore::clipToTextMask):
1453         (WebCore::RenderSVGResourceGradient::applyResource):
1454         * rendering/svg/RenderSVGResourceMarker.cpp:
1455         (WebCore::RenderSVGResourceMarker::markerTransformation const):
1456         (WebCore::RenderSVGResourceMarker::markerContentTransformation const):
1457         * rendering/svg/RenderSVGResourceMasker.cpp:
1458         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
1459         (WebCore::RenderSVGResourceMasker::resourceBoundingBox):
1460         * rendering/svg/RenderSVGResourcePattern.cpp:
1461         (WebCore::RenderSVGResourcePattern::buildPattern):
1462         (WebCore::RenderSVGResourcePattern::createTileImage const):
1463         * rendering/svg/RenderSVGTransformableContainer.cpp:
1464         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
1465         * rendering/svg/SVGRenderingContext.cpp:
1466         (WebCore::SVGRenderingContext::createImageBuffer):
1467         (WebCore::SVGRenderingContext::bufferForeground):
1468         * svg/SVGAnimateMotionElement.cpp:
1469         (WebCore::SVGAnimateMotionElement::buildTransformForProgress):
1470         * svg/SVGSVGElement.cpp:
1471         (WebCore::SVGSVGElement::localCoordinateSpaceTransform const):
1472         * svg/graphics/SVGImage.cpp:
1473         (WebCore::SVGImage::draw):
1474
1475 2017-09-19  Chris Dumez  <cdumez@apple.com>
1476
1477         IDBRequest and IDBTransaction error properties should be DOMExceptions
1478         https://bugs.webkit.org/show_bug.cgi?id=177201
1479
1480         Reviewed by Alex Christensen.
1481
1482         IDBRequest and IDBTransaction error properties should be DOMExceptions:
1483         - https://w3c.github.io/IndexedDB/#idbrequest
1484         - https://w3c.github.io/IndexedDB/#transaction
1485
1486         Previously, we used a DOMError type, which is obsolete.
1487
1488         No new tests, rebaselined existing test.
1489
1490         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1491         (WebCore::IDBOpenDBRequest::onError):
1492         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
1493         * Modules/indexeddb/IDBRequest.cpp:
1494         (WebCore:: const):
1495         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
1496         (WebCore::IDBRequest::onError):
1497         * Modules/indexeddb/IDBRequest.h:
1498         * Modules/indexeddb/IDBRequest.idl:
1499         * Modules/indexeddb/IDBTransaction.cpp:
1500         (WebCore::IDBTransaction::error const):
1501         (WebCore::IDBTransaction::abortDueToFailedRequest):
1502         (WebCore::IDBTransaction::didCreateIndexOnServer):
1503         (WebCore::IDBTransaction::connectionClosedFromServer):
1504         * Modules/indexeddb/IDBTransaction.h:
1505         * Modules/indexeddb/IDBTransaction.idl:
1506         * Modules/indexeddb/shared/IDBError.cpp:
1507         (WebCore::IDBError::toDOMException const):
1508         * Modules/indexeddb/shared/IDBError.h:
1509
1510 2017-09-19  Daewoong Jang  <daewoong.jang@naverlabs.com>
1511
1512         [Curl] Fix r222147
1513         https://bugs.webkit.org/show_bug.cgi?id=177128
1514
1515         Reviewed by Alex Christensen.
1516
1517         * platform/network/curl/CurlSSLHandle.h:
1518         * platform/network/curl/CurlSSLVerifier.cpp:
1519         (WebCore::CurlSSLVerifier::certVerifyCallback):
1520         * platform/network/curl/CurlSSLVerifier.h:
1521
1522 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
1523
1524         Image subclasses should support is<> and downcast<>
1525         https://bugs.webkit.org/show_bug.cgi?id=177209
1526
1527         Reviewed by Tim Horton.
1528
1529         Add SPECIALIZE_TYPE_TRAITS_IMAGE() for Image subclasses.
1530
1531         Also use #pragma once in these headers.
1532
1533         * platform/graphics/CrossfadeGeneratedImage.h:
1534         * platform/graphics/GeneratedImage.h:
1535         * platform/graphics/GradientImage.h:
1536         * platform/graphics/Image.h:
1537         * platform/graphics/NamedImageGeneratedImage.h:
1538
1539 2017-09-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1540
1541         REGRESSION (r215613): Incorrect corners clipping with border-radius
1542         https://bugs.webkit.org/show_bug.cgi?id=176498
1543         <rdar://problem/34112607>
1544
1545         Reviewed by Tim Horton.
1546
1547         http://trac.webkit.org/r215613 introduced an optimization to bail out of repainting borders if the invalidated
1548         rect to paint is fully contained within the inner rounded rect of the border. However, due to issues with
1549         coordinate and intersection math in RoundedRect::contains() and ellipseContainsPoint(), this causes
1550         RenderBoxModelObject::paintBorder to return early even in circumstances where the border requires a repaint.
1551         This patch fixes the contains() helper in RoundedRect and adds a new API test suite for RoundedRect that covers
1552         these changes.
1553
1554         Test: WebCore.RoundedRectContainsRect
1555
1556         * platform/graphics/GeometryUtilities.cpp:
1557         (WebCore::ellipseContainsPoint):
1558
1559         This function attempts to return early if the Manhattan distance of the transformed point is less than the
1560         radius of the circle that results from applying the same transformation to the ellipse. However, this bails and
1561         returns true if `x + y <= R`, but this means that if x and y are negative, we'll always end up returning true.
1562         We fix this by adding the absolute values instead, so the check becomes: |x| + |y| <= R.
1563
1564         * platform/graphics/RoundedRect.cpp:
1565         (WebCore::RoundedRect::contains const):
1566
1567         Before this patch, otherRect's upper left location was being used to hit-test against the ellipses formed from
1568         each of the 4 corners of the rounded rect. Instead, this should use (x, y), (maxX, y), (x, maxY), (maxX, maxY)
1569         for the top left, top right, bottom left, and bottom right corners, respectively.
1570
1571         Additionally, the checks for the bottom left and bottom right to determine whether the rect corner should be
1572         checked for intersection against the ellipse's corner are incorrect. In the bottom left corner, the check for
1573         `otherRect.maxX() >= center.x()` should instead be `otherRect.x() <= center.x()`, and the check for
1574         `otherRect.x() <= center.x()` should instead be `otherRect.maxX() >= center.x()`.
1575
1576         * platform/graphics/RoundedRect.h:
1577
1578 2017-09-19  Alexey Proskuryakov  <ap@apple.com>
1579
1580         Layering violation in Editor::createFragment
1581         https://bugs.webkit.org/show_bug.cgi?id=176123
1582
1583         Reviewed by Darin Adler.
1584
1585         * WebCore.xcodeproj/project.pbxproj:
1586         * editing/cocoa/WebArchiveResourceFromNSAttributedString.h: Added.
1587         * editing/cocoa/WebArchiveResourceFromNSAttributedString.mm: Added.
1588         Added a wrapper class for ArchiveResource, suitable for use as a WebResourceHandler.
1589
1590         * editing/cocoa/WebArchiveResourceWebResourceHandler.h: Added.
1591         * editing/cocoa/WebArchiveResourceWebResourceHandler.mm: Added.
1592         Objects of this class can be passed as "WebResourceHandler", and created instances
1593         of the above class.
1594
1595         * editing/cocoa/WebContentReaderCocoa.mm:
1596         (WebCore::attributesForAttributedStringConversion):
1597         (WebCore::createFragment):
1598         On newer OS versions, don't use WebKitLegacy to convert NSAttributedString to a
1599         document fragment. We now only use system frameworks to convert the attributed
1600         string to HTML source, and parse HTML into a fragment directly in WebCore.
1601
1602         * platform/URL.h: Exported fakeURLWithRelativePart.
1603
1604 2017-09-19  Youenn Fablet  <youenn@apple.com>
1605
1606         Allow WTF::map to use any class that is iterable and has a size getter
1607         https://bugs.webkit.org/show_bug.cgi?id=177026
1608
1609         Reviewed by Darin Adler.
1610
1611         No change of behavior.
1612         Using WTF::map to go from maps to vectors.
1613
1614         * loader/appcache/ApplicationCacheHost.cpp:
1615         (WebCore::ApplicationCacheHost::resourceList):
1616         * page/DOMWindow.cpp:
1617         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
1618
1619 2017-09-19  Eric Carlson  <eric.carlson@apple.com>
1620
1621         Quiet media player private logging
1622         https://bugs.webkit.org/show_bug.cgi?id=177199
1623
1624         Reviewed by Jer Noble.
1625
1626         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1627         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1628
1629 2017-09-19  Alex Christensen  <achristensen@webkit.org>
1630
1631         Allow modern decoding of Vectors
1632         https://bugs.webkit.org/show_bug.cgi?id=177102
1633
1634         Reviewed by Andy Estes.
1635
1636         * Modules/cache/DOMCacheEngine.h:
1637         (WebCore::DOMCacheEngine::CacheInfos::decode):
1638         (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::decode):
1639         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1640         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1641         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1642         (WebCore::IDBDatabaseIdentifier::decode):
1643         * Modules/indexeddb/IDBFactory.cpp:
1644         (WebCore::IDBFactory::openInternal):
1645         (WebCore::IDBFactory::deleteDatabase):
1646         * Modules/indexeddb/IDBGetAllResult.h:
1647         (WebCore::IDBGetAllResult::decode):
1648         * Modules/indexeddb/IDBGetResult.h:
1649         (WebCore::IDBGetResult::decode):
1650         * Modules/indexeddb/IDBKeyData.h:
1651         (WebCore::IDBKeyData::decode):
1652         * Modules/indexeddb/IDBKeyRangeData.h:
1653         (WebCore::IDBKeyRangeData::decode):
1654         * Modules/indexeddb/IDBValue.h:
1655         (WebCore::IDBValue::decode):
1656         * Modules/indexeddb/shared/IDBError.h:
1657         * Modules/indexeddb/shared/IDBIterateCursorData.h:
1658         (WebCore::IDBIterateCursorData::decode):
1659         * Modules/indexeddb/shared/IDBRequestData.h:
1660         (WebCore::IDBRequestData::decode):
1661         * Modules/indexeddb/shared/IDBResultData.h:
1662         (WebCore::IDBResultData::decode):
1663         * page/SecurityOriginData.h:
1664         (WebCore::SecurityOriginData::decode):
1665         * platform/Cookie.h:
1666         (WebCore::Cookie::decode):
1667         * platform/mediastream/MediaConstraints.h:
1668         (WebCore::MediaTrackConstraintSetMap::decode):
1669         * platform/network/FormData.h:
1670         (WebCore::FormDataElement::decode):
1671         * workers/service/ServiceWorkerJobData.h:
1672         (WebCore::ServiceWorkerJobData::decode):
1673         * workers/service/ServiceWorkerRegistrationData.h:
1674         (WebCore::ServiceWorkerRegistrationData::decode):
1675         * workers/service/ServiceWorkerRegistrationKey.h:
1676         (WebCore::ServiceWorkerRegistrationKey::decode):
1677
1678 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
1679
1680         On iOS, getData can't get text set by setData during copy event
1681         https://bugs.webkit.org/show_bug.cgi?id=176980
1682         <rdar://problem/34453915>
1683
1684         Reviewed by Darin Adler.
1685
1686         The bug was caused by iOS port not implementing Pasteboard::createPrivate(). Rather than implementing this in iOS,
1687         replace its use for copy & paste events by StaticPasteboard Wenson added for input events. This makes read-write
1688         pasteboard platform agnostic and paves the way to make writing to pasteboard in a single IPC in WebKit2.
1689
1690         Also fixed a bug that iOS port's Pasteboard::types returned the list of all supported types instead of ones
1691         actually present in the pasteboard.
1692
1693         This patch also adds a vector of types to StaticPasteboard to maintain the type order.
1694
1695         Tests: editing/pasteboard/dataTransfer-types-is-initially-empty-on-copy.html
1696                editing/pasteboard/dataTransfer-types-pasting-plaintext.html
1697
1698         * dom/DataTransfer.cpp:
1699         (WebCore::DataTransfer::createForCopyAndPaste): Make StaticPasteboard instead of a private pasteboard.
1700         (WebCore::DataTransfer::createForInputEvent):
1701         * editing/Editor.cpp:
1702         (WebCore::dispatchClipboardEvent): Call newly added commitToPasteboard on StaticPasteboard.
1703         * platform/Pasteboard.h:
1704         (WebCore::Pasteboard::isStatic const):
1705         * platform/PasteboardStrategy.h:
1706         * platform/StaticPasteboard.cpp:
1707         (WebCore::StaticPasteboard::create): Deleted.
1708         (WebCore::StaticPasteboard::StaticPasteboard):
1709         (WebCore::StaticPasteboard::hasData):
1710         (WebCore::StaticPasteboard::types): Deleted. Now simply returns m_type.
1711         (WebCore::StaticPasteboard::readString): Added.
1712         (WebCore::StaticPasteboard::writeString): Added.
1713         (WebCore::StaticPasteboard::clear): Added.
1714         (WebCore::StaticPasteboard::commitToPasteboard): Added.
1715         (isType): Added.
1716         * platform/StaticPasteboard.h:
1717         (WebCore::Pasteboard::isStatic const): Added.
1718         * platform/gtk/PasteboardGtk.cpp:
1719         (WebCore::Pasteboard::createPrivate): Deleted.
1720         (WebCore::Pasteboard::writePasteboard): Deleted.
1721         * platform/ios/PasteboardIOS.mm:
1722         (WebCore::Pasteboard::createPrivate): Deleted.
1723         (WebCore::Pasteboard::writePasteboard): Deleted.
1724         (WebCore::addHTMLClipboardTypesForCocoaType):
1725         (WebCore::Pasteboard::types): Return the actual list of types in the pasteboard.
1726         * platform/mac/PasteboardMac.mm:
1727         (WebCore::Pasteboard::createPrivate): Deleted.
1728         (WebCore::Pasteboard::writePasteboard): Deleted.
1729         * platform/win/PasteboardWin.cpp:
1730         (WebCore::Pasteboard::createPrivate): Deleted.
1731         (WebCore::Pasteboard::writePasteboard): Deleted.
1732         * platform/wpe/PasteboardWPE.cpp:
1733         (WebCore::Pasteboard::createPrivate): Deleted.
1734         (WebCore::Pasteboard::writePasteboard): Deleted.
1735
1736 2017-09-19  Zalan Bujtas  <zalan@apple.com>
1737
1738         AXObjectCache::performDeferredCacheUpdate is called recursively through FrameView::layout. 
1739         https://bugs.webkit.org/show_bug.cgi?id=176218
1740         <rdar://problem/34205612>
1741
1742         Reviewed by Simon Fraser.
1743
1744         There are certain cases when we might re-enter performDeferredCacheUpdate through recursive
1745         layout calls (see webkit.org/b/177176) and mutate m_deferredTextChangedList multiple times.
1746
1747         Test: accessibility/crash-table-recursive-layout.html
1748
1749         * accessibility/AXObjectCache.cpp:
1750         (WebCore::AXObjectCache::performDeferredCacheUpdate):
1751         * accessibility/AXObjectCache.h:
1752
1753 2017-09-19  Jer Noble  <jer.noble@apple.com>
1754
1755         [Cocoa] Add an ImageDecoder subclass backed by AVFoundation
1756         https://bugs.webkit.org/show_bug.cgi?id=176825
1757
1758         Reviewed by Eric Carlson.
1759
1760         Add a new concrete subclass of ImageDecoder which uses AVFoundation to parse and decode
1761         image data.
1762
1763         AVFoundation APIs require prior knowledge of the media data's mime type to determine whether
1764         the media data is decodable, so the mime type information must be passed through from the
1765         CachedResource -> CachedImage -> ImageFrameCache -> ImageSource so as to be available when
1766         creating the ImageDecoder:
1767
1768         (Drive-by fix: the createFrameImageAtIndex() method will mutate internal state, so make it
1769         non-const.)
1770
1771         * loader/cache/CachedImage.h:
1772         * loader/cache/CachedResource.h:
1773         (WebCore::CachedResource::mimeType const):
1774         * platform/cf/CoreMediaSoftLink.cpp:
1775         * platform/cf/CoreMediaSoftLink.h:
1776         * platform/cocoa/VideoToolboxSoftLink.cpp:
1777         * platform/cocoa/VideoToolboxSoftLink.h:
1778         * platform/graphics/Image.cpp:
1779         (WebCore::Image::mimeType const):
1780         (WebCore::Image::expectedContentSize const):
1781         * platform/graphics/Image.h:
1782         * platform/graphics/ImageDecoder.cpp:
1783         (WebCore::ImageDecoder::create):
1784         * platform/graphics/ImageDecoder.h:
1785         (WebCore::ImageDecoder::setExpectedContentSize):
1786         * platform/graphics/ImageFrameCache.cpp:
1787         (WebCore::ImageFrameCache::mimeType const):
1788         * platform/graphics/ImageFrameCache.h:
1789         * platform/graphics/ImageObserver.h:
1790         * platform/graphics/ImageSource.cpp:
1791         (WebCore::ImageSource::ensureDecoderAvailable):
1792         * platform/graphics/cg/ImageDecoderCG.cpp:
1793         (WebCore::ImageDecoderCG::createFrameImageAtIndex):
1794         * platform/graphics/cg/ImageDecoderCG.h:
1795
1796         Add the new class, ImageDecoderAVFObjC:
1797
1798         AVFoundation expects to load all the media data for an AVURLAsset itself. To map between the
1799         provided SharedData and AVURLAsset's requirements, create a delegate object
1800         WebCoreSharedBufferResourceLoaderDelegate, which responds to requests from the AVURLAsset by
1801         extracting data from the SharedData object. Ensure AVURLAsset doesn't load any data outside
1802         this delegate by passing the AVURLAssetReferenceRestrictionsKey /
1803         AVAssetReferenceRestrictionForbidAll key and value in the AVURLAsset creation options.
1804
1805         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: Added.
1806         (WebCore::ImageDecoderAVFObjC::create):
1807         (WebCore::ImageDecoderAVFObjC::mimeType const):
1808         (WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const):
1809         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Added.
1810         (SOFT_LINK_CONSTANT):
1811         (-[WebCoreSharedBufferResourceLoaderDelegate initWithParent:]):
1812         (-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]):
1813         (-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]):
1814         (-[WebCoreSharedBufferResourceLoaderDelegate canFulfillRequest:]):
1815         (-[WebCoreSharedBufferResourceLoaderDelegate enqueueRequest:]):
1816         (-[WebCoreSharedBufferResourceLoaderDelegate fulfillPendingRequests]):
1817         (-[WebCoreSharedBufferResourceLoaderDelegate fulfillRequest:]):
1818         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
1819         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
1820         (WebCore::customSchemeURL):
1821         (WebCore::imageDecoderAssetOptions):
1822         (WebCore::transformToRotationProperties):
1823         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
1824         (WebCore::ImageDecoderAVFObjC::canDecodeType):
1825         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
1826         (WebCore::ImageDecoderAVFObjC::readSampleMetadata): Parses the media data using AVSampleCursor to walk
1827             the media sample table, extracting frame presentation time, decode time, and duration.
1828         (WebCore::ImageDecoderAVFObjC::readTrackMetadata): Reads the affine transform and size information from
1829             the AVAssetTrack, and transforms the transform into a rotation value.
1830         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Decompress the incoming sample data, optionally rotate
1831             the output, and store the results in the sample data vector.
1832         (WebCore::ImageDecoderAVFObjC::advanceCursor): Wrap around the end of the sample table.
1833         (WebCore::ImageDecoderAVFObjC::setTrack): Reset all sample and track metadata.
1834         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const): Retrieve from sample data.
1835         (WebCore::ImageDecoderAVFObjC::frameCount const): Ditto.
1836         (WebCore::ImageDecoderAVFObjC::repetitionCount const): Ditto.
1837         (WebCore::ImageDecoderAVFObjC::uti const): Ditto.
1838         (WebCore::ImageDecoderAVFObjC::filenameExtension const): Ditto.
1839         (WebCore::ImageDecoderAVFObjC::frameSizeAtIndex const): Ditto.
1840         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const): Ditto.
1841         (WebCore::ImageDecoderAVFObjC::frameOrientationAtIndex const): Ditto.
1842         (WebCore::ImageDecoderAVFObjC::frameDurationAtIndex const): Ditto.
1843         (WebCore::ImageDecoderAVFObjC::frameHasAlphaAtIndex const): Ditto.
1844         (WebCore::ImageDecoderAVFObjC::frameAllowSubsamplingAtIndex const): Ditto.
1845         (WebCore::ImageDecoderAVFObjC::frameBytesAtIndex const): Ditto.
1846         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): If the sample data has already been
1847             decompressed, return it. Otherwise, walk through the sample table decompressing frames
1848             until the desired frame is decoded.
1849         (WebCore::ImageDecoderAVFObjC::setData):
1850         (WebCore::ImageDecoderAVFObjC::clearFrameBufferCache):
1851
1852         Modify WebCoreDecompressionSession so that it can emit frames which have been converted from
1853         YUV -> RGB as part of the decode operation. Also, add a synchronous decoding operation
1854         method, for use in ImageDecoderAVFObjC.
1855
1856         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1857         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureDecompressionSession):
1858         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
1859         (WebCore::WebCoreDecompressionSession::createOpenGL):
1860         (WebCore::WebCoreDecompressionSession::createRGB):
1861         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1862         (WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):
1863         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
1864         (WebCore::WebCoreDecompressionSession::decodeSample):
1865         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
1866
1867         Other changes:
1868
1869         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
1870         * platform/cocoa/VideoToolboxSoftLink.cpp: Add newly referenced methods.
1871         * platform/cocoa/VideoToolboxSoftLink.h: Ditto.
1872
1873
1874 2017-09-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1875
1876         [Curl] Move Authentication related tasks into AuthenticationChallenge class
1877         https://bugs.webkit.org/show_bug.cgi?id=177105
1878
1879         Currently those codes are in ResourceHandle or related companion. It will
1880         be reused with NetworkLoadTask so that it should be separated from them.
1881
1882         Reviewed by Alex Christensen.
1883
1884         * platform/Curl.cmake:
1885         * platform/network/curl/AuthenticationChallenge.h:
1886         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted.
1887         (WebCore::AuthenticationChallenge::authenticationClient const): Deleted.
1888         (WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
1889         * platform/network/curl/AuthenticationChallengeCurl.cpp: Added.
1890         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
1891         (WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
1892         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
1893         (WebCore::AuthenticationChallenge::removeLeadingAndTrailingQuotes):
1894         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1895         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
1896         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
1897         (WebCore::removeLeadingAndTrailingQuotes): Deleted.
1898         (WebCore::ResourceHandleCurlDelegate::getProtectionSpace): Deleted.
1899         * platform/network/curl/ResourceHandleCurlDelegate.h:
1900
1901 2017-09-19  Zalan Bujtas  <zalan@apple.com>
1902
1903         Do not mutate RenderText content during layout.
1904         https://bugs.webkit.org/show_bug.cgi?id=176219
1905         <rdar://problem/34205724>
1906
1907         Reviewed by David Hyatt.
1908
1909         Update combined text when the style/content change as opposed to lazily, during layout.
1910         -content mutation during layout might make the inline tree go out of sync.
1911
1912         Test: fast/text/international/dynamic-text-combine-crash.html
1913
1914         * rendering/RenderBlockFlow.cpp:
1915         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
1916         * rendering/RenderCombineText.cpp:
1917         (WebCore::RenderCombineText::styleDidChange):
1918         (WebCore::RenderCombineText::setRenderedText):
1919         (WebCore::RenderCombineText::combineTextIfNeeded):
1920         (WebCore::RenderCombineText::combineText): Deleted.
1921         * rendering/RenderCombineText.h:
1922         * rendering/RenderText.h:
1923         * rendering/line/BreakingContext.h:
1924         (WebCore::BreakingContext::handleText):
1925         * rendering/line/LineBreaker.cpp:
1926         (WebCore::LineBreaker::skipLeadingWhitespace):
1927
1928 2017-09-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1929
1930         createMarkupInternal should protect its pointer to the Range's common ancestor
1931         https://bugs.webkit.org/show_bug.cgi?id=177033
1932         <rdar://problem/34265390>
1933
1934         Reviewed by Tim Horton.
1935
1936         Adds basic safeguarding to codepaths hit while executing an outdent command.
1937
1938         Test: editing/execCommand/outdent-with-media-query-listener-in-iframe.html
1939
1940         * editing/IndentOutdentCommand.cpp:
1941         (WebCore::IndentOutdentCommand::outdentRegion):
1942
1943         Avoid an infinite loop if endOfCurrentParagraph is a null position.
1944
1945         * editing/markup.cpp:
1946         (WebCore::createMarkupInternal):
1947
1948         Protect the raw pointer to the Range's common ancestor node.
1949
1950 2017-09-19  Ryan Haddad  <ryanhaddad@apple.com>
1951
1952         Unreviewed, rolling out r222217 and r222214.
1953         This change introduced two LayoutTest failures.
1954         https://bugs.webkit.org/show_bug.cgi?id=177026
1955
1956         * rendering/RenderBlockFlow.cpp:
1957         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
1958         * rendering/RenderCombineText.cpp:
1959         (WebCore::RenderCombineText::styleDidChange):
1960         (WebCore::RenderCombineText::setRenderedText):
1961         (WebCore::RenderCombineText::combineText):
1962         (WebCore::RenderCombineText::combineTextIfNeeded): Deleted.
1963         * rendering/RenderCombineText.h:
1964         * rendering/RenderText.cpp:
1965         * rendering/RenderText.h:
1966         * rendering/line/BreakingContext.h:
1967         (WebCore::BreakingContext::handleText):
1968         * rendering/line/LineBreaker.cpp:
1969         (WebCore::LineBreaker::skipLeadingWhitespace):
1970
1971 2017-09-19  Zalan Bujtas  <zalan@apple.com>
1972
1973         Attempt to fix Linux build.
1974
1975         * rendering/RenderText.cpp:
1976
1977 2017-09-19  Zalan Bujtas  <zalan@apple.com>
1978
1979         Do not mutate RenderText content during layout.
1980         https://bugs.webkit.org/show_bug.cgi?id=176219
1981         <rdar://problem/34205724>
1982
1983         Reviewed by David Hyatt.
1984
1985         Update combined text when the style/content change as opposed to lazily, during layout.
1986         -content mutation during layout might make the inline tree go out of sync.
1987
1988         Test: fast/text/international/dynamic-text-combine-crash.html
1989
1990         * rendering/RenderBlockFlow.cpp:
1991         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
1992         * rendering/RenderCombineText.cpp:
1993         (WebCore::RenderCombineText::styleDidChange):
1994         (WebCore::RenderCombineText::setRenderedText):
1995         (WebCore::RenderCombineText::combineTextIfNeeded):
1996         (WebCore::RenderCombineText::combineText): Deleted.
1997         * rendering/RenderCombineText.h:
1998         * rendering/RenderText.h:
1999         * rendering/line/BreakingContext.h:
2000         (WebCore::BreakingContext::handleText):
2001         * rendering/line/LineBreaker.cpp:
2002         (WebCore::LineBreaker::skipLeadingWhitespace):
2003
2004 2017-09-19  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2005
2006         [GTK] The binding code of Media Source Extension of AudioTrack, VideoTrack and TextTrack is not generated
2007         https://bugs.webkit.org/show_bug.cgi?id=174620
2008
2009         Reviewed by Michael Catanzaro.
2010
2011         Add AudioTrackMediaSource, VideoTrackMediaSource and TextTrackMediaSource IDL files in CMakeLists. Fix WPT test
2012         that checks MSE interfaces. This test failed since webm is not supported for MSE in GTK port. PR already merged
2013         in WPT repository.
2014
2015         Remove skipped test that is now passing in TestExpectation. Modify expected file for GTK (same as mac).
2016
2017         * CMakeLists.txt:
2018
2019 2017-09-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2020
2021         [Harfbuzz] adjustSelectionRectForComplexText() should also pass the character range when shaping
2022         https://bugs.webkit.org/show_bug.cgi?id=177049
2023
2024         Reviewed by Michael Catanzaro.
2025
2026         Now that the shaper support receiving a range we should use that also in
2027         adjustSelectionRectForComplexText(). This will ensure consistent results with
2028         getGlyphsAndAdvancesForComplexText().
2029
2030         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2031         (WebCore::FontCascade::adjustSelectionRectForComplexText const):
2032
2033 2017-09-19  Dean Jackson  <dino@apple.com>
2034
2035         [WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
2036         https://bugs.webkit.org/show_bug.cgi?id=176771
2037         <rdar://problem/34386621>
2038
2039         Reviewed by Antoine Quint.
2040
2041         The OpenGL context in VideoTextureCopierCV wasn't being restored to
2042         the state it had before rendering a video to a texture. Specifically
2043         the vertex attribute values were never recorded by the state saver.
2044
2045         Update the existing test of VideoTextureCopierCV so that it is
2046         explicitly doing something different from the WebCore code, which
2047         means that state will have to be correctly restored for the test
2048         to pass.
2049
2050         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2051         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
2052         to record the vertex attribute state once we know the location of the position attribute.
2053         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
2054         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2055         (WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
2056         applicable vertex attribute state information.
2057         * platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
2058         to the GC3D rather than a pointer.
2059
2060 2017-09-19  Dean Jackson  <dino@apple.com>
2061
2062         [WebGL] accelerated texImage2D for video doesn't respect flipY
2063         https://bugs.webkit.org/show_bug.cgi?id=176491
2064         <rdar://problem/33833511>
2065
2066         Reviewed by Jer Noble.
2067
2068         (Take 3 - this was rolled out due to a test failure)
2069
2070         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
2071         back to software or fail to upload texture data. Fix this by intercepting
2072         the texImage2D call, checking the orientation of the video, and running
2073         a small shader program to flip it if necessary.
2074
2075         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
2076         none of our media decoders support video with alpha, so unfortunately
2077         this will have no visible change.
2078
2079         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
2080                fast/canvas/webgl/texImage2D-video-flipY-true.html
2081
2082         * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
2083         which is used to check the orientation of the source video.
2084         * platform/cocoa/CoreVideoSoftLink.h:
2085
2086         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2087         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
2088         now handle flipped or premultiplied requests.
2089         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2090         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.
2091
2092         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2093         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
2094         simply framebuffer.
2095         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
2096         if they were created.
2097         (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
2098         and the vertex buffer for drawing. Also records the location of the uniforms.
2099         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
2100         framebuffer object, and render the video texture into that framebuffer using a
2101         shader that can flip the coordinates.
2102         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
2103         the state of the user's GraphicsContext3D while we're intercepting calls.
2104         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2105         * platform/graphics/cv/VideoTextureCopierCV.h:
2106
2107         * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
2108         compilation and attribute access. This avoids going through ANGLE.
2109         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2110         (WebCore::GraphicsContext3D::compileShader):
2111         (WebCore::GraphicsContext3D::compileShaderDirect):
2112         (WebCore::GraphicsContext3D::getAttribLocationDirect):
2113
2114 2017-09-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2115
2116         Make ImageFrame::duration() return Seconds instead of float
2117         https://bugs.webkit.org/show_bug.cgi?id=177103
2118
2119         Reviewed by Simon Fraser.
2120
2121         ScalableImageDecoder stores milliseconds for the duration of its ImageFrames.
2122         But ImageFrameCache store seconds for the duration of its ImageFrames.
2123         To fix this issue use Seconds for the ImageFrame duration.
2124
2125         * platform/graphics/BitmapImage.h:
2126         * platform/graphics/ImageDecoder.h:
2127         * platform/graphics/ImageFrame.h:
2128         (WebCore::ImageFrame::setDuration):
2129         (WebCore::ImageFrame::duration const):
2130         * platform/graphics/ImageFrameCache.cpp:
2131         (WebCore::ImageFrameCache::frameDurationAtIndex):
2132         * platform/graphics/ImageFrameCache.h:
2133         * platform/graphics/ImageSource.h:
2134         (WebCore::ImageSource::frameDurationAtIndex):
2135         * platform/graphics/cg/ImageDecoderCG.cpp:
2136         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
2137         * platform/graphics/cg/ImageDecoderCG.h:
2138         * platform/image-decoders/ScalableImageDecoder.cpp:
2139         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2140         * platform/image-decoders/ScalableImageDecoder.h:
2141         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2142         (WebCore::GIFImageDecoder::frameComplete):
2143         * platform/image-decoders/png/PNGImageDecoder.cpp:
2144         (WebCore::PNGImageDecoder::readChunks):
2145         (WebCore::PNGImageDecoder::frameHeader): Deleted.
2146         (WebCore::PNGImageDecoder::init): Deleted.
2147         (WebCore::PNGImageDecoder::clearFrameBufferCache): Deleted.
2148         (WebCore::PNGImageDecoder::initFrameBuffer): Deleted.
2149         (WebCore::PNGImageDecoder::frameComplete): Deleted.
2150         (WebCore::PNGImageDecoder::processingStart): Deleted.
2151         (WebCore::PNGImageDecoder::processingFinish): Deleted.
2152         (WebCore::PNGImageDecoder::fallbackNotAnimated): Deleted.
2153
2154 2017-09-18  Per Arne Vollan  <pvollan@apple.com>
2155
2156         [Win] Compile error in InbandTextTrackPrivateAVCF::readNativeSampleBuffer.
2157         https://bugs.webkit.org/show_bug.cgi?id=177108
2158
2159         Reviewed by Brent Fulgham.
2160
2161         The InbandTextTrackPrivateAVF::m_sampleInputBuffer is private and not accessible in this method.
2162  
2163         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
2164
2165 2017-09-18  Tim Horton  <timothy_horton@apple.com>
2166
2167         Support min() and max() in calc()
2168         https://bugs.webkit.org/show_bug.cgi?id=167000
2169         <rdar://problem/30153481>
2170
2171         Reviewed by David Hyatt.
2172         Patch originally by Myles Maxfield.
2173
2174         Add two new toplevel functions to CSS, min() and max(), which take an
2175         arbirary number of arguments and resolve to the minimum and maximum of
2176         the resolved value of the arguments, respectively. It is also possible
2177         to use min() and max() inside calc(), and to use calc()-like math
2178         inside min() and max().
2179
2180         * css/CSSCalculationValue.cpp:
2181         (WebCore::determineCategory):
2182         min and max operators don't use determineCategory; we have a specific
2183         implementation for them in createMinOrMax.
2184
2185         (WebCore::resolvedTypeForMinOrMax):
2186         The spec says that min() and max() should be marked as invalid if they
2187         have values of more than one type, but that percentages should resolve
2188         against the destination type before making this determination. So,
2189         if the destination type is length, percent turns into percent-length,
2190         and similarly for number.
2191
2192         (WebCore::isIntegerResult):
2193         Add an n-way implementation of isIntegerResult.
2194
2195         (WebCore::isSamePair):
2196         (WebCore::CSSCalcOperation::createMinOrMax): Create a min() or max()
2197         operation, as long as the types of arguments are all the same. Allow
2198         lengths to upgrade the whole operation to percent-length, and numbers
2199         to percent-number, which will cause us to use CalculationValue and friends
2200         in order to do proper resolution of all of the parameters instead of
2201         just comparing their numeric values.
2202
2203         (WebCore::CSSCalcOperation::createCalcExpression):
2204         (WebCore::CSSCalcOperation::doubleValue):
2205         (WebCore::CSSCalcOperation::computeLengthPx):
2206         (WebCore::CSSCalcOperation::customCSSText):
2207         (WebCore::CSSCalcOperation::primitiveType):
2208         (WebCore::CSSCalcOperation::CSSCalcOperation):
2209         (WebCore::CSSCalcOperation::evaluate):
2210         (WebCore::CSSCalcOperation::evaluateOperator):
2211         Adapt to child counts greater than two.
2212
2213         (WebCore::CSSCalcOperation::buildCssText):
2214         Add support for min() and max().
2215
2216         (WebCore::CSSCalcExpressionNodeParser::parseCalc):
2217         parseCalc now accepts a CSSValueID parameter indicating which calc function
2218         it should parse (calc, webkit-calc, min, or max), and delegates to either
2219         parseValueExpression or parseMinMaxExpression.
2220
2221         (WebCore::CSSCalcExpressionNodeParser::operatorValue):
2222         (WebCore::CSSCalcExpressionNodeParser::parseValue):
2223         If min() or max() are found while parsing a value (i.e. nested inside
2224         either calc or themselves), use parseMinMaxExpression on that subtree.
2225
2226         (WebCore::CSSCalcExpressionNodeParser::parseValueTerm):
2227         (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
2228         (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
2229         Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.
2230
2231         (WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
2232         Added. Parse an arbitrary number of comma-and-whitespace-separated children.
2233
2234         (WebCore::createBlendHalf):
2235         Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.
2236
2237         (WebCore::createCSS):
2238         Build the CSSCalcOperation for the platform-independent min and max operations.
2239
2240         (WebCore::CSSCalcValue::create):
2241         Pass the function being parsed and the destination calc category for the
2242         property being parsed for into create, and then into the parser so that
2243         it can know which function it is parsing for, and what kind of result it
2244         needs (as previously mentioned above in resolvedTypeForMinOrMax).
2245
2246         * css/CSSCalculationValue.h:
2247         * css/CSSValueKeywords.in:
2248         Add min and max functions as CSS keywords.
2249
2250         * css/StyleBuilderConverter.h:
2251         (WebCore::StyleBuilderConverter::convertLength):
2252         (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
2253         * platform/Length.cpp:
2254         (WebCore::convertTo100PercentMinusLength):
2255         Adapt to the CalcExpressionOperation constructor taking a vector of
2256         arguments instead of two.
2257
2258         * css/parser/CSSPropertyParserHelpers.cpp:
2259         (WebCore::CSSPropertyParserHelpers::CalcParser::CalcParser):
2260         Store and pass the specific function being parsed down into CSSCalcValue.
2261
2262         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2263         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
2264         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
2265         (WebCore::CSSPropertyParserHelpers::consumeNumber):
2266         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2267         (WebCore::CSSPropertyParserHelpers::consumeLength):
2268         (WebCore::CSSPropertyParserHelpers::consumePercent):
2269         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
2270         (WebCore::CSSPropertyParserHelpers::consumeAngle):
2271         (WebCore::CSSPropertyParserHelpers::consumeTime):
2272         Pass the destination type into each calc parser.
2273
2274         * platform/CalculationValue.cpp:
2275         (WebCore::CalcExpressionOperation::evaluate const):
2276         (WebCore::CalcExpressionOperation::operator== const):
2277         (WebCore::CalcExpressionOperation::dump const):
2278         (WebCore::operator<<):
2279         (WebCore::CalcExpressionBinaryOperation::evaluate const): Deleted.
2280         (WebCore::CalcExpressionBinaryOperation::operator== const): Deleted.
2281         (WebCore::CalcExpressionBinaryOperation::dump const): Deleted.
2282         * platform/CalculationValue.h:
2283         (WebCore::CalcExpressionOperation::CalcExpressionOperation):
2284         (WebCore::operator==):
2285         (WebCore::toCalcExpressionOperation):
2286         (WebCore::CalcExpressionBinaryOperation::CalcExpressionBinaryOperation): Deleted.
2287         (WebCore::toCalcExpressionBinaryOperation): Deleted.
2288         Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.
2289         Adjust to having n>2 children.
2290         Support min() and max() operators in various places.
2291         
2292
2293 2017-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2294
2295         [Curl] Move error generation task into ResourceError
2296         https://bugs.webkit.org/show_bug.cgi?id=176963
2297
2298         Reviewed by Alex Christensen.
2299
2300         * platform/Curl.cmake:
2301         * platform/network/curl/CurlContext.cpp:
2302         (WebCore::CurlHandle::errorDescription):
2303         (WebCore::CurlHandle::errorDescription const):
2304         * platform/network/curl/CurlContext.h:
2305         * platform/network/curl/ResourceError.h:
2306         (WebCore::ResourceError::setSslErrors):
2307         (WebCore::ResourceError::hasSSLConnectError const): Deleted.
2308         (WebCore::ResourceError::doPlatformIsolatedCopy): Deleted.
2309         * platform/network/curl/ResourceErrorCurl.cpp: Added.
2310         (WebCore::ResourceError::httpError):
2311         (WebCore::ResourceError::sslError):
2312         (WebCore::ResourceError::hasSSLConnectError const):
2313         (WebCore::ResourceError::doPlatformIsolatedCopy):
2314         (WebCore::ResourceError::platformCompare):
2315         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2316         (WebCore::ResourceHandleCurlDelegate::notifyFail):
2317         (WebCore::ResourceHandleCurlDelegate::didFail):
2318         * platform/network/curl/ResourceHandleCurlDelegate.h:
2319
2320 2017-09-18  Ryan Haddad  <ryanhaddad@apple.com>
2321
2322         Unreviewed, rolling out r222170.
2323
2324         The API test added with this change is failing.
2325
2326         Reverted changeset:
2327
2328         "Allow WTF::map to use any class that is iterable and has a
2329         size getter"
2330         https://bugs.webkit.org/show_bug.cgi?id=177026
2331         http://trac.webkit.org/changeset/222170
2332
2333 2017-09-18  Don Olmstead  <don.olmstead@sony.com>
2334
2335         [Curl] Forward declare SSL context
2336
2337         Unreviewed build fix after r222147. OpenSSL's SHA1 declaration conflicts with WTF's.
2338
2339         No new tests. No change in behavior.
2340
2341         * platform/network/curl/CurlSSLHandle.h:
2342         * platform/network/curl/CurlSSLVerifier.cpp:
2343         * platform/network/curl/CurlSSLVerifier.h:
2344
2345 2017-09-18  Ryosuke Niwa  <rniwa@webkit.org>
2346
2347         getData('text/plain') doesn't work on iOS 10
2348         https://bugs.webkit.org/show_bug.cgi?id=177034
2349
2350         Reviewed by Wenson Hsieh.
2351
2352         The bug was caused by the mispatch of UTI between reading & writing plain text.
2353         Use kUTTypeText (instead of kUTTypePlainText) to read from UIPasteboard on iOS 10.
2354
2355         Re-enabled tests were passing on iOS 11 and continues to pass after this code change.
2356
2357         Tests: editing/pasteboard/clipboard-event.html
2358                editing/pasteboard/datatransfer-items-paste-plaintext.html
2359                editing/pasteboard/get-data-text-plain-paste.html
2360
2361         * platform/ios/PasteboardIOS.mm:
2362         (WebCore::cocoaTypeFromHTMLClipboardType):
2363
2364 2017-09-18  Youenn Fablet  <youenn@apple.com>
2365
2366         Allow WTF::map to use any class that is iterable and has a size getter
2367         https://bugs.webkit.org/show_bug.cgi?id=177026
2368
2369         Reviewed by Darin Adler.
2370
2371         No change of behavior.
2372         Using WTF::map to go from maps to vectors.
2373
2374         * loader/appcache/ApplicationCacheHost.cpp:
2375         (WebCore::ApplicationCacheHost::resourceList):
2376         * page/DOMWindow.cpp:
2377         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
2378
2379 2017-09-18  Emilio Cobos Ãlvarez  <emilio@crisal.io>
2380
2381         Always update display: contents styles in RenderTreeUpdater.
2382         https://bugs.webkit.org/show_bug.cgi?id=177065
2383
2384         Reviewed by Antti Koivisto.
2385
2386         Otherwise we keep an old style around, making following style updates wrong.
2387
2388         Test: fast/css/display-contents-style-update.html
2389
2390         * style/RenderTreeUpdater.cpp:
2391         (WebCore::RenderTreeUpdater::updateElementRenderer):
2392
2393 2017-09-18  Antti Koivisto  <antti@apple.com>
2394
2395         Avoid style resolution when clearing focused element.
2396         https://bugs.webkit.org/show_bug.cgi?id=176224
2397         <rdar://problem/34206409>
2398
2399         Reviewed by Zalan Bujtas.
2400
2401         Test: fast/dom/focus-style-resolution.html
2402
2403         * dom/Document.cpp:
2404         (WebCore::Document::setFocusedElement):
2405
2406             Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
2407             Style resolution may dispatch events.
2408
2409         * html/HTMLInputElement.cpp:
2410         (WebCore::HTMLInputElement::didBlur):
2411
2412             Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.
2413
2414 2017-09-18  Antti Koivisto  <antti@apple.com>
2415
2416         Rolling out the previous to land again with a test.
2417
2418         * dom/Document.cpp:
2419         (WebCore::Document::setFocusedElement):
2420         * html/HTMLInputElement.cpp:
2421         (WebCore::HTMLInputElement::didBlur):
2422
2423 2017-09-18  Antti Koivisto  <antti@apple.com>
2424
2425         Avoid style resolution when clearing focused element.
2426         https://bugs.webkit.org/show_bug.cgi?id=176224
2427         <rdar://problem/34206409>
2428
2429         Reviewed by Zalan Bujtas.
2430
2431         Test: fast/dom/focus-style-resolution.html
2432
2433         * dom/Document.cpp:
2434         (WebCore::Document::setFocusedElement):
2435
2436             Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
2437             Style resolution may dispatch events.
2438
2439         * html/HTMLInputElement.cpp:
2440         (WebCore::HTMLInputElement::didBlur):
2441
2442             Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.
2443
2444 2017-09-18  Per Arne Vollan  <pvollan@apple.com>
2445
2446         [WK1] Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing.
2447         https://bugs.webkit.org/show_bug.cgi?id=177071
2448
2449         Reviewed by Brent Fulgham.
2450
2451         The Page pointer in the history controller's frame is null. Add a null pointer check before
2452         accessing the page. 
2453
2454         No new tests, covered by exiting tests.
2455
2456         * loader/HistoryController.cpp:
2457         (WebCore::HistoryController::updateForStandardLoad):
2458         (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
2459         (WebCore::HistoryController::updateForClientRedirect):
2460
2461 2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2462
2463         REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
2464         https://bugs.webkit.org/show_bug.cgi?id=177036
2465
2466         Reviewed by Michael Catanzaro.
2467
2468         In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
2469         multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
2470         character index.
2471
2472         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2473         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
2474         m_glyphToCharacterIndexes array.
2475
2476 2017-09-18  Jer Noble  <jer.noble@apple.com>
2477
2478         Virtualize ImageDecoder
2479         https://bugs.webkit.org/show_bug.cgi?id=176118
2480
2481         Reviewed by Eric Carlson.
2482
2483         Add an explicit, abstract base class ImageDecoder, and convert ImageDecoderCG to a true
2484         subclass. This will allow multiple ImageDecoder subclasses to exist simultaneously at
2485         runtime.
2486
2487         * CMakeLists.txt:
2488         * WebCore.xcodeproj/project.pbxproj:
2489         * platform/ImageDecoders.cmake:
2490         * platform/graphics/ImageDecoder.cpp: Added.
2491         (WebCore::ImageDecoder::create):
2492         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
2493         * platform/graphics/ImageDecoder.h: Added.
2494         (WebCore::ImageDecoder::isSizeAvailable):
2495         (WebCore::ImageDecoder::isAllDataReceived const):
2496         * platform/graphics/cg/ImageDecoderCG.cpp:
2497         (WebCore::ImageDecoderCG::ImageDecoderCG):
2498         (WebCore::ImageDecoderCG::bytesDecodedToDetermineProperties):
2499         (WebCore::ImageDecoderCG::uti const):
2500         (WebCore::ImageDecoderCG::filenameExtension const):
2501         (WebCore::ImageDecoderCG::encodedDataStatus const):
2502         (WebCore::ImageDecoderCG::frameCount const):
2503         (WebCore::ImageDecoderCG::repetitionCount const):
2504         (WebCore::ImageDecoderCG::hotSpot const):
2505         (WebCore::ImageDecoderCG::frameSizeAtIndex const):
2506         (WebCore::ImageDecoderCG::frameIsCompleteAtIndex const):
2507         (WebCore::ImageDecoderCG::frameOrientationAtIndex const):
2508         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
2509         (WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
2510         (WebCore::ImageDecoderCG::frameHasAlphaAtIndex const):
2511         (WebCore::ImageDecoderCG::frameBytesAtIndex const):
2512         (WebCore::ImageDecoderCG::createFrameImageAtIndex const):
2513         (WebCore::ImageDecoderCG::setData):
2514         (WebCore::ImageDecoder::ImageDecoder): Deleted.
2515         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
2516         (WebCore::ImageDecoder::uti const): Deleted.
2517         (WebCore::ImageDecoder::filenameExtension const): Deleted.
2518         (WebCore::ImageDecoder::encodedDataStatus const): Deleted.
2519         (WebCore::ImageDecoder::frameCount const): Deleted.
2520         (WebCore::ImageDecoder::repetitionCount const): Deleted.
2521         (WebCore::ImageDecoder::hotSpot const): Deleted.
2522         (WebCore::ImageDecoder::frameSizeAtIndex const): Deleted.
2523         (WebCore::ImageDecoder::frameIsCompleteAtIndex const): Deleted.
2524         (WebCore::ImageDecoder::frameOrientationAtIndex const): Deleted.
2525         (WebCore::ImageDecoder::frameDurationAtIndex const): Deleted.
2526         (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex const): Deleted.
2527         (WebCore::ImageDecoder::frameHasAlphaAtIndex const): Deleted.
2528         (WebCore::ImageDecoder::frameBytesAtIndex const): Deleted.
2529         (WebCore::ImageDecoder::createFrameImageAtIndex const): Deleted.
2530         (WebCore::ImageDecoder::setData): Deleted.
2531         * platform/graphics/cg/ImageDecoderCG.h:
2532         (WebCore::ImageDecoderCG::create):
2533         (WebCore::ImageDecoder::create): Deleted.
2534         (WebCore::ImageDecoder::isSizeAvailable): Deleted.
2535         (WebCore::ImageDecoder::isAllDataReceived const): Deleted.
2536         (WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
2537         * platform/graphics/win/ImageDecoderDirect2D.cpp:
2538         (WebCore::ImageDecoderDirect2D::ImageDecoderDirect2D):
2539         (WebCore::ImageDecoderDirect2D::systemImagingFactory):
2540         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties):
2541         (WebCore::ImageDecoderDirect2D::filenameExtension const):
2542         (WebCore::ImageDecoderDirect2D::isSizeAvailable const):
2543         (WebCore::ImageDecoderDirect2D::encodedDataStatus const):
2544         (WebCore::ImageDecoderDirect2D::size const):
2545         (WebCore::ImageDecoderDirect2D::frameCount const):
2546         (WebCore::ImageDecoderDirect2D::repetitionCount const):
2547         (WebCore::ImageDecoderDirect2D::hotSpot const):
2548         (WebCore::ImageDecoderDirect2D::frameSizeAtIndex const):
2549         (WebCore::ImageDecoderDirect2D::frameIsCompleteAtIndex const):
2550         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
2551         (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
2552         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
2553         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
2554         (WebCore::ImageDecoderDirect2D::frameBytesAtIndex const):
2555         (WebCore::ImageDecoderDirect2D::setTargetContext):
2556         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const):
2557         (WebCore::ImageDecoderDirect2D::setData):
2558         * platform/graphics/win/ImageDecoderDirect2D.h:
2559         (WebCore::ImageDecoderDirect2D::create):
2560         (WebCore::ImageDecoder::create): Deleted.
2561         (WebCore::ImageDecoder::isAllDataReceived const): Deleted.
2562         (WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
2563         * platform/image-decoders/ScalableImageDecoder.cpp: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.cpp.
2564         (WebCore::ScalableImageDecoder::create):
2565         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
2566         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
2567         (WebCore::ScalableImageDecoder::frameBytesAtIndex const):
2568         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2569         (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
2570         (WebCore::ScalableImageDecoder::prepareScaleDataIfNecessary):
2571         (WebCore::ScalableImageDecoder::upperBoundScaledX):
2572         (WebCore::ScalableImageDecoder::lowerBoundScaledX):
2573         (WebCore::ScalableImageDecoder::upperBoundScaledY):
2574         (WebCore::ScalableImageDecoder::lowerBoundScaledY):
2575         (WebCore::ScalableImageDecoder::scaledY):
2576         * platform/image-decoders/ScalableImageDecoder.h: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.h.
2577         (WebCore::ScalableImageDecoder::ScalableImageDecoder):
2578         (WebCore::ScalableImageDecoder::~ScalableImageDecoder):
2579         (WebCore::ScalableImageDecoder::premultiplyAlpha const):
2580         (WebCore::ScalableImageDecoder::isAllDataReceived const):
2581         (WebCore::ScalableImageDecoder::size const):
2582         (WebCore::ScalableImageDecoder::scaledSize):
2583         (WebCore::ScalableImageDecoder::setSize):
2584         (WebCore::ScalableImageDecoder::setIgnoreGammaAndColorProfile):
2585         (WebCore::ScalableImageDecoder::ignoresGammaAndColorProfile const):
2586         (WebCore::ScalableImageDecoder::rgbColorProfile):
2587         (WebCore::ScalableImageDecoder::subsamplingLevelForScale):
2588         (WebCore::ScalableImageDecoder::inputDeviceColorProfile):
2589         (WebCore::ScalableImageDecoder::setFailed):
2590         (WebCore::ScalableImageDecoder::failed const):
2591         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
2592         (WebCore::BMPImageDecoder::BMPImageDecoder):
2593         (WebCore::BMPImageDecoder::setData):
2594         (WebCore::BMPImageDecoder::setFailed):
2595         * platform/image-decoders/bmp/BMPImageDecoder.h:
2596         * platform/image-decoders/bmp/BMPImageReader.h:
2597         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2598         (WebCore::GIFImageDecoder::GIFImageDecoder):
2599         (WebCore::GIFImageDecoder::setData):
2600         (WebCore::GIFImageDecoder::setSize):
2601         (WebCore::GIFImageDecoder::setFailed):
2602         * platform/image-decoders/gif/GIFImageDecoder.h:
2603         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2604         (WebCore::ICOImageDecoder::ICOImageDecoder):
2605         (WebCore::ICOImageDecoder::setData):
2606         (WebCore::ICOImageDecoder::size):
2607         (WebCore::ICOImageDecoder::setSize):
2608         (WebCore::ICOImageDecoder::setFailed):
2609         * platform/image-decoders/ico/ICOImageDecoder.h:
2610         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2611         (WebCore::JPEGImageDecoder::JPEGImageDecoder):
2612         (WebCore::JPEGImageDecoder::setSize):
2613         (WebCore::JPEGImageDecoder::setFailed):
2614         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2615         * platform/image-decoders/png/PNGImageDecoder.cpp:
2616         (WebCore::PNGImageReader::decode):
2617         (WebCore::PNGImageDecoder::PNGImageDecoder):
2618         (WebCore::PNGImageDecoder::setSize):
2619         (WebCore::PNGImageDecoder::frameBufferAtIndex):
2620         (WebCore::PNGImageDecoder::setFailed):
2621         * platform/image-decoders/png/PNGImageDecoder.h:
2622         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2623         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
2624         (WebCore::WEBPImageDecoder::decode):
2625         * platform/image-decoders/webp/WEBPImageDecoder.h:
2626
2627 2017-09-18  Andy Estes  <aestes@apple.com>
2628
2629         [Mac] Upstream miscellaneous WebKitSystemInterface functions
2630         https://bugs.webkit.org/show_bug.cgi?id=177029
2631
2632         Reviewed by Alex Christensen.
2633
2634         * Configurations/WebCore.xcconfig: Used -force_load of libPAL instead of -ObjC. This forces
2635         the linker to load both Objective-C and C PAL symbols in WebCore. This change is needed for
2636         PAL::popUpMenu(), which is used by WebKit and WebKitLegacy but not WebCore.
2637         * platform/cocoa/LocalizedStringsCocoa.mm:
2638         (WebCore::contextMenuItemTagSearchWeb):
2639         * platform/cocoa/ScrollController.mm:
2640         (WebCore::elasticDeltaForTimeDelta):
2641         (WebCore::elasticDeltaForReboundDelta):
2642         (WebCore::reboundDeltaForElasticDelta):
2643         * platform/graphics/ca/GraphicsLayerCA.cpp:
2644         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2645         * platform/mac/CursorMac.mm:
2646         (WebCore::WKCoreCursor_coreCursorType):
2647         (WebCore::createCoreCursorClass):
2648         (WebCore::coreCursorClass):
2649         (WebCore::cursor):
2650         (WebCore::Cursor::ensurePlatformCursor const):
2651         * platform/mac/WebCoreSystemInterface.h:
2652         * platform/mac/WebCoreSystemInterface.mm:
2653         * rendering/RenderThemeMac.mm:
2654         (WebCore::RenderThemeMac::paintTextArea):
2655
2656 2017-09-18  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2657
2658         [Win][PAL] Move WebCoreHeaderDetection.h to PAL
2659         https://bugs.webkit.org/show_bug.cgi?id=176990
2660
2661         Reviewed by Alex Christensen.
2662
2663         * PlatformWin.cmake:
2664         Stop generating WebCoreHeaderDetection.h in WebCore.
2665
2666         * config.h:
2667         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2668         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2669         Include PALHeaderDetection.h instead of WebCoreHeaderDetection.h
2670
2671 2017-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2672
2673         [Curl] Create classes dedicated to handle SSL related tasks
2674         and separate verifier and certificate management.
2675         https://bugs.webkit.org/show_bug.cgi?id=176910
2676
2677         Reviewed by Alex Christensen.
2678
2679         * platform/Curl.cmake:
2680         * platform/network/curl/CurlContext.cpp:
2681         (WebCore::CurlContext::CurlContext):
2682         (WebCore::CurlHandle::setCACertPath):
2683         (WebCore::certificatePath): Deleted.
2684         (WebCore::CurlHandle::enableCAInfoIfExists): Deleted.
2685         (WebCore::CurlHandle::setSslErrors): Deleted.
2686         (WebCore::CurlHandle::getSslErrors): Deleted.
2687         * platform/network/curl/CurlContext.h:
2688         (WebCore::CurlContext::sslHandle):
2689         (WebCore::CurlContext::getCertificatePath const): Deleted.
2690         (WebCore::CurlContext::shouldIgnoreSSLErrors const): Deleted.
2691         * platform/network/curl/CurlDownload.cpp:
2692         (WebCore::CurlDownload::setupRequest):
2693         * platform/network/curl/CurlSSLHandle.cpp: Added.
2694         (WebCore::CurlSSLHandle::CurlSSLHandle):
2695         (WebCore::CurlSSLHandle::getCACertPathEnv):
2696         (WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
2697         (WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost):
2698         (WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
2699         (WebCore::CurlSSLHandle::setClientCertificateInfo):
2700         (WebCore::CurlSSLHandle::getSSLClientCertificate):
2701         * platform/network/curl/CurlSSLHandle.h: Renamed from Source/WebCore/platform/network/curl/SSLHandle.h.
2702         (WebCore::CurlSSLHandle::shouldIgnoreSSLErrors const):
2703         (WebCore::CurlSSLHandle::getCACertPath const):
2704         * platform/network/curl/CurlSSLVerifier.cpp: Renamed from Source/WebCore/platform/network/curl/SSLHandle.cpp.
2705         (WebCore::CurlSSLVerifier::setSslCtx):
2706         (WebCore::CurlSSLVerifier::certVerifyCallback):
2707         (WebCore::CurlSSLVerifier::getPemDataFromCtx):
2708         (WebCore::CurlSSLVerifier::convertToSSLCertificateFlags):
2709         * platform/network/curl/CurlSSLVerifier.h: Added.
2710         (WebCore::CurlSSLVerifier::setCurlHandle):
2711         (WebCore::CurlSSLVerifier::setHostName):
2712         (WebCore::CurlSSLVerifier::sslErrors):
2713         * platform/network/curl/ResourceHandleCurl.cpp:
2714         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
2715         (WebCore::ResourceHandle::setClientCertificateInfo):
2716         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2717         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
2718         (WebCore::ResourceHandleCurlDelegate::setupRequest):
2719         (WebCore::ResourceHandleCurlDelegate::notifyFail):
2720         (WebCore::ResourceHandleCurlDelegate::willSetupSslCtx):
2721         (WebCore::ResourceHandleCurlDelegate::willSetupSslCtxCallback):
2722         * platform/network/curl/ResourceHandleCurlDelegate.h:
2723
2724 2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2725
2726         REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
2727         https://bugs.webkit.org/show_bug.cgi?id=177036
2728
2729         Reviewed by Michael Catanzaro.
2730
2731         In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
2732         multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
2733         character index.
2734
2735         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2736         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
2737         m_glyphToCharacterIndexes array.
2738
2739 2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2740
2741         [Harfbuzz] Test fast/text/complex-text-selection.html is failing since r222090
2742         https://bugs.webkit.org/show_bug.cgi?id=177035
2743
2744         Reviewed by Michael Catanzaro.
2745
2746         The problem was not actually introduced in r222090, but revelaed by that change. The bug was added in r222086,
2747         when adding the support for shaping a range of characters. We are not correctly filtering the characters in case
2748         of rtl in some cases.
2749
2750         Fixes: fast/text/complex-text-selection.html
2751
2752         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2753         (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): When checking if the current character is inside
2754         the given range, continue or break the loop depending on whether text is rtl or not.
2755
2756 2017-09-16  Michael Catanzaro  <mcatanzaro@igalia.com>
2757
2758         [GTK] Build failure with enchant-2.1.1
2759         https://bugs.webkit.org/show_bug.cgi?id=176877
2760
2761         Unreviewed build fix for enchant 2.1.1.
2762
2763         enchant_dict_free_suggestions() has been deprecated since at least 2005. Use its
2764         replacement, enchant_dict_free_string_list(), instead. That's also been around since at
2765         least 2005.
2766
2767         * platform/text/enchant/TextCheckerEnchant.cpp:
2768         (WebCore::TextCheckerEnchant::getGuessesForWord):
2769
2770 2017-09-16  Antti Koivisto  <antti@apple.com>
2771
2772         Computing animated style should not require renderers
2773         https://bugs.webkit.org/show_bug.cgi?id=171926
2774         <rdar://problem/34428035>
2775
2776         Reviewed by Sam Weinig.
2777
2778         CSS animation system is now element rather than renderer based. This allows cleaning up
2779         style resolution and render tree update code.
2780
2781         This also fixes bug animation doesn't run if display property is animated from one rendered type
2782         to another. Added a test case for this.
2783
2784         Test: transitions/transition-display-property-2.html
2785
2786         * page/animation/CSSAnimationController.cpp:
2787         (WebCore::CSSAnimationController::updateAnimations):
2788
2789             Pass in the old style instead of getting it from the renderer.
2790             Factor to return the animated style as a return value.
2791
2792         * page/animation/CSSAnimationController.h:
2793         * rendering/RenderElement.cpp:
2794         (WebCore::RenderElement::RenderElement):
2795         (WebCore::RenderElement::willBeDestroyed):
2796
2797             Animation are now canceled by RenderTreeUpdater::tearDownRenderers.
2798
2799         * rendering/RenderElement.h:
2800         (WebCore::RenderElement::hasInitialAnimatedStyle const): Deleted.
2801         (WebCore::RenderElement::setHasInitialAnimatedStyle): Deleted.
2802
2803             We no longer need to this concept.
2804
2805         * style/RenderTreeUpdater.cpp:
2806         (WebCore::RenderTreeUpdater::updateElementRenderer):
2807         (WebCore::RenderTreeUpdater::createRenderer):
2808
2809             We now get correct animated style from style resolution in all cases so we don't need to compute
2810             it separately for new renderers.
2811
2812         (WebCore::RenderTreeUpdater::tearDownRenderers):
2813
2814             Cancel animations when render tree is fully torn down. Keep them when updating style.
2815
2816         * style/RenderTreeUpdater.h:
2817         * style/StyleTreeResolver.cpp:
2818         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2819
2820             We can now compute animated style without renderer. Special cases dealing with rendererless case
2821             can be removed.
2822
2823 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2824
2825         [Harbuzz] Test fast/text/international/harfbuzz-runs-with-no-glyph.html is crashing
2826         https://bugs.webkit.org/show_bug.cgi?id=177005
2827
2828         Reviewed by Michael Catanzaro.
2829
2830         Fixes: fast/text/international/harfbuzz-runs-with-no-glyph.html
2831
2832         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2833         (WebCore::HarfBuzzShaper::HarfBuzzRun::xPositionForOffset): Return early if there aren't glyphs.
2834
2835 2017-09-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
2836
2837         Avoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
2838         https://bugs.webkit.org/show_bug.cgi?id=177028
2839
2840         Reviewed by Tim Horton.
2841
2842         String::format() is a bigger hammer for what we need to do in this function.
2843
2844         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2845
2846 2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
2847
2848         iOS: Use blob URL instead of a WebKit fake URL when pasting an image
2849         https://bugs.webkit.org/show_bug.cgi?id=176986
2850         <rdar://problem/34455052>
2851
2852         Reviewed by Wenson Hsieh.
2853
2854         Fixed the bug that pasting an image on iOS resulted in an img element with src attribute
2855         set to a WebKit fake URL so that the Web content could never save it.
2856
2857         Like r208451 on Mac, use a Blob URL instead.
2858
2859         This patch also removes createFragmentForImageResourceAndAddResource since it's no longer used.
2860
2861         Tests: LayoutTests/editing/pasteboard/paste-image-as-blob-url.html
2862
2863         * editing/cocoa/WebContentReaderCocoa.mm:
2864         (WebCore::WebContentReader::readImage): Moved the code here from WebContentReaderMac.mm.
2865         * editing/ios/WebContentReaderIOS.mm:
2866         (WebCore::WebContentReader::readImage): Deleted. This is the code 
2867         * editing/mac/WebContentReaderMac.mm:
2868         (WebCore::WebContentReader::readImage): Moved to WebContentReaderCocoa.mm. Note that
2869         typeAsFilenameWithExtension was dead code after r208451
2870         * editing/markup.cpp:
2871         (WebCore::createFragmentForImageResourceAndAddResource): Deleted.
2872         * editing/markup.h:
2873
2874 2017-09-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2875
2876         Avoid style recomputation when forwarding a focus event to an text field's input type
2877         https://bugs.webkit.org/show_bug.cgi?id=176160
2878         <rdar://problem/34184820>
2879
2880         Reviewed by Ryosuke Niwa.
2881
2882         Currently, TextFieldInputType::forwardEvent synchronously triggers style recomputation, for the purpose of
2883         scrolling to the origin upon handling a blur event, and also for updating caps lock state after a blur or focus.
2884         In synchronously triggering style recomputation, we may end up running arbitrary JavaScript, which may change
2885         the HTMLInputElement's type and cause the current TextFieldInputType to be destroyed.
2886
2887         To mitigate this, we only update caps lock state when forwarding a focus or blur event to the InputType, and
2888         instead scroll blurred text fields to the origin later, in HTMLInputElement::didBlur (invoked from
2889         Document::setFocusedElement after blur and focusout events have fired). Instead of having the InputType update
2890         style, lift the call to Document::updateStyleIfNeeded up into HTMLInputElement so that we gracefully handle the
2891         case where the page destroys and sets a new InputType within the scope of this style update.
2892
2893         Test: fast/forms/change-input-type-in-focus-handler.html
2894
2895         * dom/Document.cpp:
2896         (WebCore::Document::setFocusedElement):
2897         * html/HTMLInputElement.cpp:
2898         (WebCore::HTMLInputElement::didBlur):
2899         * html/HTMLInputElement.h:
2900         * html/InputType.h:
2901         (WebCore::InputType::elementDidBlur):
2902         * html/TextFieldInputType.cpp:
2903         (WebCore::TextFieldInputType::forwardEvent):
2904         (WebCore::TextFieldInputType::elementDidBlur):
2905         * html/TextFieldInputType.h:
2906
2907 2017-09-15  JF Bastien  <jfbastien@apple.com>
2908
2909         WTF: use Forward.h when appropriate instead of Vector.h
2910         https://bugs.webkit.org/show_bug.cgi?id=176984
2911
2912         Reviewed by Saam Barati.
2913
2914         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
2915
2916         * Modules/entriesapi/FileSystemEntriesCallback.h:
2917         * Modules/indexeddb/IDBEventDispatcher.h:
2918         * Modules/indexeddb/IDBFactory.h:
2919         * Modules/indexeddb/client/IDBConnectionProxy.h:
2920         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2921         * Modules/webdatabase/DatabaseTask.h:
2922         * Modules/websockets/WebSocketChannelClient.h:
2923         * contentextensions/CombinedURLFilters.h:
2924         * crypto/SerializedCryptoKeyWrap.h:
2925         * css/InspectorCSSOMWrappers.h:
2926         * css/PageRuleCollector.h:
2927         * css/parser/CSSParserTokenRange.h:
2928         * dom/DocumentTouch.h:
2929         * dom/MutationCallback.h:
2930         * editing/EditingStyle.h:
2931         * editing/SpellChecker.h:
2932         * editing/markup.h:
2933         * fileapi/ThreadableBlobRegistry.h:
2934         * html/FileListCreator.h:
2935         * inspector/WebHeapAgent.h:
2936         * loader/ContentFilter.cpp:
2937         (WebCore::ContentFilter::ContentFilter):
2938         * loader/ContentFilter.h:
2939         * loader/CookieJar.h:
2940         * loader/FrameLoaderClient.h:
2941         * loader/LoaderStrategy.h:
2942         * loader/SubframeLoader.h:
2943         * page/ChromeClient.h:
2944         * page/FrameSnapshotting.h:
2945         * page/IntersectionObserverCallback.h:
2946         * page/PageSerializer.h:
2947         * page/UserContentURLPattern.h:
2948         * page/scrolling/AxisScrollSnapOffsets.h:
2949         * page/win/FrameWin.h:
2950         * platform/CookiesStrategy.h:
2951         * platform/KeyedCoding.h:
2952         * platform/PasteboardStrategy.h:
2953         * platform/SSLKeyGenerator.h:
2954         * platform/ScrollableArea.h:
2955         * platform/encryptedmedia/CDMFactory.h:
2956         * platform/gamepad/EmptyGamepadProvider.cpp:
2957         * platform/gamepad/GamepadProvider.h:
2958         * platform/gamepad/GamepadProviderClient.h:
2959         * platform/gamepad/PlatformGamepad.h:
2960         * platform/graphics/GeometryUtilities.cpp:
2961         * platform/graphics/GeometryUtilities.h:
2962         * platform/graphics/Icon.h:
2963         * platform/graphics/LayoutRect.h:
2964         * platform/graphics/Path.h:
2965         * platform/graphics/WOFFFileFormat.h:
2966         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
2967         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:
2968         * platform/graphics/ca/PlatformCAAnimation.h:
2969         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
2970         * platform/graphics/opentype/OpenTypeMathData.h:
2971         * platform/image-encoders/JPEGImageEncoder.h:
2972         * platform/image-encoders/PNGImageEncoder.h:
2973         * platform/network/BlobRegistry.h:
2974         * platform/network/HTTPParsers.h:
2975         * platform/network/PlatformCookieJar.h:
2976         * platform/network/cf/DownloadBundle.h:
2977         * platform/network/curl/CurlCacheEntry.h:
2978         * platform/network/curl/DownloadBundle.h:
2979         * platform/text/LineEnding.h:
2980         * platform/text/QuotedPrintable.cpp:
2981         * platform/text/QuotedPrintable.h:
2982         * rendering/FlexibleBoxAlgorithm.h:
2983         * rendering/style/QuotesData.h:
2984         * rendering/svg/SVGSubpathData.h:
2985         * storage/StorageEventDispatcher.h:
2986         * style/StyleInvalidator.h:
2987         * style/StyleRelations.h:
2988         * svg/SVGAltGlyphDefElement.h:
2989         * svg/SVGAltGlyphItemElement.h:
2990
2991 2017-09-15  Youenn Fablet  <youenn@apple.com>
2992
2993         ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore:WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() + 222
2994         https://bugs.webkit.org/show_bug.cgi?id=175164
2995         <rdar://problem/33712305>
2996
2997         Reviewed by Eric Carlson.
2998
2999         No observable change of behavior.
3000
3001         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3002         (WebCore::RealtimeOutgoingAudioSource::hasBufferedEngouhData):
3003         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Calling pullData only if there is at least 0.01 seconds of available data.
3004         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3005
3006 2017-09-15  Youenn Fablet  <youenn@apple.com>
3007
3008         Move code using Vector::map to WTF:map
3009         https://bugs.webkit.org/show_bug.cgi?id=176860
3010
3011         Reviewed by Jer Noble.
3012
3013         No change of behavior.
3014
3015         * loader/FormSubmission.cpp:
3016         (WebCore::FormSubmission::create): Moving to WTF::map.
3017         * page/Settings.cpp:
3018         (WebCore::Settings::setMediaContentTypesRequiringHardwareSupport): Using iterator split to not create a temporary vector.
3019         * platform/ContentType.cpp:
3020         (WebCore::ContentType::ContentType):
3021         (WebCore::splitParameters):
3022         (WebCore::ContentType::codecs const): Ditto.
3023         (WebCore::ContentType::profiles const): Ditto.
3024         (WebCore::stripHTMLWhiteSpace): Deleted.
3025         * platform/ContentType.h:
3026         (WebCore::ContentType::create): Deleted.
3027         * platform/graphics/MediaPlayer.cpp:
3028         (WebCore::MediaPlayer::load): Minor count churning change.
3029
3030 2017-09-15  Youenn Fablet  <youenn@apple.com>
3031
3032         MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData should enqueue data if still useful
3033         https://bugs.webkit.org/show_bug.cgi?id=177016
3034
3035         Reviewed by Jer Noble.
3036
3037         No change of behavior.
3038
3039         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3040         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): exciting early in block to prevent enqueueing.
3041
3042 2017-09-15  Ryan Haddad  <ryanhaddad@apple.com>
3043
3044         Unreviewed, rolling out r222040.
3045
3046         The LayoutTest added with this change is a flaky image failure
3047         on mac-wk1 debug bots.
3048
3049         Reverted changeset:
3050
3051         "Computing animated style should not require renderers"
3052         https://bugs.webkit.org/show_bug.cgi?id=171926
3053         http://trac.webkit.org/changeset/222040
3054
3055 2017-09-15  Tim Horton  <timothy_horton@apple.com>
3056
3057         Fix the macOS CMake build
3058         https://bugs.webkit.org/show_bug.cgi?id=177015
3059
3060         Reviewed by Andy Estes.
3061
3062         * CMakeLists.txt:
3063         Add Payment Request files.
3064
3065         * PlatformMac.cmake:
3066         Add the CoreServices umbrella framework to the framework search path.
3067         Add service workers directories to the forwarding headers path.
3068         Add Modules/cache directory to the forwarding headers path.
3069
3070         * rendering/svg/RenderSVGRoot.cpp:
3071         (WebCore::resolveLengthAttributeForSVG): Deleted unused function.
3072
3073 2017-09-15  John Wilander  <wilander@apple.com>
3074
3075         Storage Access API: Deny access to nested iframes
3076         https://bugs.webkit.org/show_bug.cgi?id=176939
3077         <rdar://problem/34439609>
3078
3079         Reviewed by Brent Fulgham.
3080
3081         Test: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe.html
3082
3083         * dom/Document.cpp:
3084         (WebCore::Document::requestStorageAccess):
3085
3086 2017-09-15  Antti Koivisto  <antti@apple.com>
3087
3088         AnimationBase should ref the element
3089         https://bugs.webkit.org/show_bug.cgi?id=176993
3090
3091         Reviewed by Simon Fraser.
3092
3093         We now longer have renderer pointer. Element can be reffed for safety.
3094
3095         This doesn't create reference cycle as the element pointer is cleared when render tree is
3096         torn down. This happens at the latest when the element is removed from the tree.
3097
3098         * page/animation/AnimationBase.cpp:
3099         (WebCore::AnimationBase::~AnimationBase):
3100         (WebCore::AnimationBase::clear):
3101         * page/animation/AnimationBase.h:
3102         (WebCore::AnimationBase::~AnimationBase): Deleted.
3103         (WebCore::AnimationBase::clear): Deleted.
3104         * page/animation/ImplicitAnimation.cpp:
3105         (WebCore::ImplicitAnimation::pauseAnimation):
3106         (WebCore::ImplicitAnimation::sendTransitionEvent):
3107         (WebCore::ImplicitAnimation::reset):
3108         * page/animation/KeyframeAnimation.cpp:
3109         (WebCore::KeyframeAnimation::pauseAnimation):
3110         (WebCore::KeyframeAnimation::endAnimation):
3111         (WebCore::KeyframeAnimation::sendAnimationEvent):
3112         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
3113
3114 2017-09-15  Brent Fulgham  <bfulgham@apple.com>
3115
3116         Make DocumentLoader a FrameDestructionObserver
3117         https://bugs.webkit.org/show_bug.cgi?id=176364
3118         <rdar://problem/34254780>
3119
3120         Reviewed by Alex Christensen.
3121
3122         The DocumentLoader needs to know when its Frame is destroyed so that it can
3123         perform properly cleanup.
3124
3125         Test: fast/events/beforeunload-dom-manipulation-crash.html
3126
3127         * loader/DocumentLoader.cpp:
3128         (WebCore::DocumentLoader::DocumentLoader): Call FrameDestructionObserver constructor.
3129         (WebCore::DocumentLoader::responseReceived): Drive-by fix. Make sure the current
3130         object is valid during the callback.
3131         (WebCore::DocumentLoader::attachToFrame): Use FrameDestructionObserver::observerFrame rather
3132         than setting the m_frame variable directly.
3133         (WebCore::DocumentLoader::detachFromFrame): Ditto.
3134         * loader/DocumentLoader.h:
3135         (WebCore::DocumentLoader::frame const): Deleted, as this is provided by the FrameDestructionObserver.
3136
3137 2017-09-15  Ms2ger  <Ms2ger@igalia.com>
3138
3139         Update some WebGL2 return types to match the specification.
3140         https://bugs.webkit.org/show_bug.cgi?id=176996
3141
3142         Reviewed by Alex Christensen.
3143
3144         This should not change the behavior in any way, but it makes it simpler
3145         to compare our IDL with the specification's.
3146
3147         No new tests because there is no behavior change.
3148
3149         * html/canvas/WebGL2RenderingContext.cpp:
3150         (WebCore::WebGL2RenderingContext::getUniformIndices):
3151         * html/canvas/WebGL2RenderingContext.h:
3152         * html/canvas/WebGL2RenderingContext.idl:
3153
3154 2017-09-15  Antti Koivisto  <antti@apple.com>
3155
3156         Remove FilterOperation::blendingNeedsRendererSize()
3157         https://bugs.webkit.org/show_bug.cgi?id=176994
3158
3159         Reviewed by Simon Fraser.
3160
3161         It is not used.
3162
3163         * page/animation/CSSPropertyAnimation.cpp:
3164         (WebCore::blendFunc):
3165         * platform/graphics/filters/FilterOperation.h:
3166         (WebCore::FilterOperation::blend):
3167         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin const):
3168         (WebCore::FilterOperation::blendingNeedsRendererSize const): Deleted.
3169
3170 2017-09-15  Youenn Fablet  <youenn@apple.com>
3171
3172         Add an URL method to remove both query string and fragment identifier
3173         https://bugs.webkit.org/show_bug.cgi?id=176911
3174
3175         Reviewed by Alex Christensen.
3176
3177         Covered by existing tests and new API tests.
3178
3179         * Modules/cache/DOMCache.cpp:
3180         (WebCore::DOMCache::retrieveRecords): Using new helper method.
3181         * platform/URL.cpp:
3182         (WebCore::URL::removeQueryAndFragmentIdentifier):
3183         * platform/URL.h:
3184
3185 2017-09-15  Andy Estes  <aestes@apple.com>
3186
3187         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
3188         https://bugs.webkit.org/show_bug.cgi?id=176953
3189
3190         Reviewed by Eric Carlson.
3191
3192         * platform/cocoa/VideoToolboxSoftLink.cpp:
3193         * platform/cocoa/VideoToolboxSoftLink.h:
3194         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
3195         (WebCore::queryDecoderAvailability):
3196         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
3197         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3198         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
3199         (WebCore::exernalDeviceDisplayNameForPlayer):
3200         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
3201         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3202         * platform/mac/MediaRemoteSoftLink.cpp:
3203         * platform/mac/MediaRemoteSoftLink.h:
3204         * platform/mac/WebCoreSystemInterface.h:
3205         * platform/mac/WebCoreSystemInterface.mm:
3206
3207 2017-09-15  Eric Carlson  <eric.carlson@apple.com>
3208
3209         Switch text tracks to release logging
3210         https://bugs.webkit.org/show_bug.cgi?id=176809
3211         <rdar://problem/34397605>
3212
3213         Reviewed by Jer Noble.
3214
3215         Make all track objects use the same logger and log identifier as the media element they
3216         "belong" to. Convert all track logging from debug-only to release logging.
3217
3218         * WebCore.xcodeproj/project.pbxproj:
3219         * html/HTMLMediaElement.cpp:
3220         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3221         * html/HTMLMediaElement.h:
3222         * html/track/AudioTrack.cpp:
3223         (WebCore::AudioTrack::AudioTrack):
3224         (WebCore::AudioTrack::setPrivate):
3225         (WebCore::AudioTrack::setMediaElement):
3226         * html/track/AudioTrack.h:
3227         * html/track/DataCue.cpp:
3228         (WebCore::DataCue::toString const):
3229         * html/track/DataCue.h:
3230         (PAL::LogArgument<WebCore::DataCue>::toString):
3231         * html/track/InbandDataTextTrack.cpp:
3232         (WebCore::InbandDataTextTrack::addDataCue):
3233         (WebCore::InbandDataTextTrack::updateDataCue):
3234         (WebCore::InbandDataTextTrack::removeDataCue):
3235         * html/track/InbandDataTextTrack.h:
3236         * html/track/InbandGenericTextTrack.cpp:
3237         (WebCore::InbandGenericTextTrack::addGenericCue):
3238         (WebCore::InbandGenericTextTrack::removeGenericCue):
3239         (WebCore::InbandGenericTextTrack::newCuesParsed):
3240         (WebCore::InbandGenericTextTrack::fileFailedToParse):
3241         * html/track/InbandGenericTextTrack.h:
3242         * html/track/InbandTextTrack.cpp:
3243         (WebCore::InbandTextTrack::InbandTextTrack):
3244         (WebCore::InbandTextTrack::setMediaElement):
3245         * html/track/InbandTextTrack.h:
3246         * html/track/InbandWebVTTTextTrack.cpp:
3247         (WebCore::InbandWebVTTTextTrack::newCuesParsed):
3248         (WebCore::InbandWebVTTTextTrack::fileFailedToParse):
3249         * html/track/InbandWebVTTTextTrack.h:
3250         * html/track/LoadableTextTrack.cpp:
3251         (WebCore::LoadableTextTrack::newCuesAvailable):
3252         (WebCore::LoadableTextTrack::cueLoadingCompleted):
3253         * html/track/LoadableTextTrack.h:
3254         * html/track/TextTrack.cpp:
3255         (WebCore::TextTrack::addCue):
3256         (WebCore::TextTrack::removeCue):
3257         (WebCore::TextTrack::setLanguage):
3258         * html/track/TextTrack.h:
3259         * html/track/TextTrackCue.cpp:
3260         (WebCore::TextTrackCue::toString const):
3261         * html/track/TextTrackCue.h:
3262         (PAL::LogArgument<WebCore::TextTrackCue>::toString):
3263         * html/track/TextTrackCueGeneric.cpp:
3264         (WebCore::TextTrackCueGeneric::setFontSize):
3265         (WebCore::TextTrackCueGeneric::toString const):
3266         * html/track/TextTrackCueGeneric.h:
3267         (PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString):
3268         * html/track/TrackBase.cpp:
3269         (WebCore::nextLogIdentifier):
3270         (WebCore::nullLogger):
3271         (WebCore::TrackBase::TrackBase):
3272         (WebCore::TrackBase::setMediaElement):
3273         (WebCore::TrackBase::logChannel const):
3274         (WebCore::TrackBase::~TrackBase): Deleted.
3275         * html/track/TrackBase.h:
3276         (WebCore::TrackBase::setMediaElement): Deleted.
3277         * html/track/VTTCue.cpp:
3278         (WebCore::VTTCue::setFontSize):
3279         (WebCore::VTTCue::toString const):
3280         * html/track/VTTCue.h:
3281         (PAL::LogArgument<WebCore::VTTCue>::toString):
3282         * html/track/VideoTrack.cpp:
3283         (WebCore::VideoTrack::VideoTrack):
3284         (WebCore::VideoTrack::setPrivate):
3285         (WebCore::VideoTrack::setMediaElement):
3286         * html/track/VideoTrack.h:
3287         * platform/graphics/AudioTrackPrivate.h:
3288         * platform/graphics/InbandTextTrackPrivate.h:
3289         (WebCore::InbandTextTrackPrivate::setClient):
3290         * platform/graphics/InbandTextTrackPrivateClient.h:
3291         (WebCore::GenericCueData::toString const):
3292         (PAL::LogArgument<WebCore::GenericCueData>::toString):
3293         * platform/graphics/TrackPrivateBase.cpp: Added.
3294         (WebCore::TrackPrivateBase::setLogger):
3295         (WebCore::TrackPrivateBase::logChannel const):
3296         * platform/graphics/TrackPrivateBase.h:
3297         * platform/graphics/VideoTrackPrivate.h:
3298         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3299         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
3300         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
3301         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
3302         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
3303         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3304         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
3305         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
3306         (WebCore::InbandTextTrackPrivateAVF::resetCueValues):
3307         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
3308         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
3309         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
3310         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
3311         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3312         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3313         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3314         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
3315         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3316
3317 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3318
3319         [Harfbuzz] Material icons not rendered correctly when using the web font
3320         https://bugs.webkit.org/show_bug.cgi?id=176995
3321
3322         Reviewed by Michael Catanzaro.
3323
3324         Only a few of them are correctly rendered and some others are wrong. We only render correctly the ones that
3325         don't have an underscore in their name (or that start with a number like 3d_rotation). In the cases where the
3326         name before the underscore is also an icon, we render that icon instead, that's why some of them are wrong. This
3327         is happening because the underscore is causing the HarfbuffShaper to split the text in 3 runs, one for the word
3328         before the underscore, another one for the underscore and another for the word after the underscore. So, we
3329         end up trying to shape the 3 runs independently and we fail when the icon doesn't exist, or when it exists but
3330         it's not the one we are looking for. The cause of this is that the underscore has a different script (Common)
3331         than the rest of characters (Latin) which is a condition in HarfbuffShaper to create a different run. The
3332         unicode spec says that characters with Common script should be handled differently, but we are just ignoring
3333         it. The spec proposes to use an heuristic based on simply inheriting the script of the previous character, which
3334         should work in most of the cases. We could take a more conservative approach and do that only if both characters
3335         are ASCII. We should also consider handling other cases mentioned by the spec like brackets and quotation marks,
3336         but that belongs to a different bug/commit.
3337
3338         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3339         (WebCore::scriptsAreCompatibleForCharacters): Helper function to check if the current and previous scripts are
3340         compatible,
3341         (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Use scriptsAreCompatibleForCharacters() to decided whether to
3342         finish the current run or not. In case of Common script, inherit also the script from the previous character.
3343
3344 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3345
3346         [Harfbuzz] Fix incorrect font rendering when selecting texts in pages which specifies text-rendering: optimizeLegibility
3347         https://bugs.webkit.org/show_bug.cgi?id=148220
3348
3349         Reviewed by Michael Catanzaro.
3350
3351         Add support for shaping a range of characters and return the advance to the first glyph in the range.
3352
3353         Covered by existing tests.
3354
3355         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3356         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Pass "from" and "to" parameters to
3357         HarfBuzzShaper::shape and return the x position of the selection rect.
3358         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3359         (WebCore::HarfBuzzShaper::shape): Forward "from" and "to" parameters to fillGlyphBuffer().
3360         (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): Only add glyphs for the given character range.
3361         (WebCore::HarfBuzzShaper::fillGlyphBuffer): Only consider runs in the given character range.
3362         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
3363
3364 2017-09-15  Zan Dobersek  <zdobersek@igalia.com>
3365
3366         [EME] ClearKey: list 'persistent-license' sessions as supported
3367         https://bugs.webkit.org/show_bug.cgi?id=176985
3368
3369         Reviewed by Xabier Rodriguez-Calvar.
3370
3371         The ClearKey implementation should support the 'persistent-license'
3372         session type for testing purposes. Methods in the CDMPrivateClearKey
3373         class have been updated to handle that session type as supported:
3374         - supportsSessionTypeWithConfiguration() returns true for the
3375           'persistent-license' session type values,
3376         - supportsConfiguration() allows persistent state as required in
3377           case of the configured session type being 'persistent-license',
3378         - supportsConfigurationWithRestrictions() as well allows persistent
3379         state as required for 'persistent-license' session types.
3380
3381         No new tests -- affected tests have their baselines updated.
3382
3383         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3384         (WebCore::CDMPrivateClearKey::supportsConfiguration const):
3385         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
3386         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
3387
3388 2017-09-15  Ms2ger  <Ms2ger@igalia.com>
3389
3390         Disallow passing a null program to getFragDataLocation.
3391         https://bugs.webkit.org/show_bug.cgi?id=176895
3392
3393         Reviewed by Sam Weinig.
3394
3395         This matches the specification as well as Gecko and Chromium.
3396
3397         Test: fast/canvas/webgl/webgl2/bindings.html
3398
3399         * html/canvas/WebGL2RenderingContext.cpp:
3400         (WebCore::WebGL2RenderingContext::getFragDataLocation):
3401         * html/canvas/WebGL2RenderingContext.h:
3402         * html/canvas/WebGL2RenderingContext.idl:
3403
3404 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3405
3406         [FreeType] Complex text is enabled too often after r221909
3407         https://bugs.webkit.org/show_bug.cgi?id=176907
3408
3409         Reviewed by Sergio Villar Senin.
3410