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