Unreviewed, rolling out r219194.
[WebKit.git] / Source / WebCore / ChangeLog
1 2017-07-06  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r219194.
4         https://bugs.webkit.org/show_bug.cgi?id=174207
5
6         it broke some layout tests (Requested by clopez on #webkit).
7
8         Reverted changeset:
9
10         "[GStreamer] vid.me videos do not play"
11         https://bugs.webkit.org/show_bug.cgi?id=172240
12         http://trac.webkit.org/changeset/219194
13
14 2017-07-06  David Kilzer  <ddkilzer@apple.com>
15
16         Add release assert to explore crash for <rdar://problem/32908525>
17
18         Reviewed by Brady Eidson.
19
20         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
21         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Add
22         release assert to catch cases when the IDBBackingStore is not
23         deleted before the UniqueIDBDatabase is destroyed.  The
24         IDBBackingStore should always be released on the database
25         thread.
26
27 2017-07-06  Matt Lewis  <jlewis3@apple.com>
28
29         Unreviewed, rolling out r219178.
30
31         This caused a consistent failure with the API test
32         StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.
33
34         Reverted changeset:
35
36         "[WTF] Clean up StringStatics.cpp by using
37         LazyNeverDestroyed<> for Atoms"
38         https://bugs.webkit.org/show_bug.cgi?id=174150
39         http://trac.webkit.org/changeset/219178
40
41 2017-07-06  Charlie Turner  <cturner@igalia.com>
42
43         [GStreamer] vid.me videos do not play
44         https://bugs.webkit.org/show_bug.cgi?id=172240
45
46         Reviewed by Xabier Rodriguez-Calvar.
47
48         In r142251, code to hide the WK HTTP source elements from elsewhere in
49         the pipeline was removed. This has the nasty side-effect of
50         auto-plugging the WK HTTP source into things it really should not be
51         used in, especially the adaptive streaming demuxers. The reasons this
52         is bad are documented in several places on Bugzilla, see the parent
53         bug report for more details. The high-level issue is that the WK HTTP
54         source and its use of WebCore is not thread-safe. Although work has
55         been recently done to improve this situation, it's still not perfect.
56
57         Another issue is the interface hlsdemux expects its HTTP source to
58         implement, specifically seeking in READY.
59
60         This does rely on HTTP context sharing being available in GStreamer,
61         upstream bug is here:
62         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
63         can be demonstrated with
64         https://github.com/thiagoss/adaptive-test-server but manual testing on
65         popular video hosting sites, including vid.me, shows that this doesn't
66         bite us at the moment, just something else to fix in the future.
67
68         There are some QoS issues with the adaptive streaming code in
69         GStreamer, but it seems much better to offer a below par QoS in lieu
70         of crashing/livelocking when playing certain streams, and issues can be
71         raised upstream when they arise.
72
73         This patch does take us further away from the future goal of having all
74         networking operations go through the network process, but in return it
75         solves some nasty crashes and livelocks that have been irritating
76         users for some time. With the pressure off on this issue, work can be
77         planned to consider how to make the WK HTTP source a better citizen
78         inside the GStreamer pipeline when we migrate the netcode to go
79         through the network process.
80
81         A new test is added to check that the single file HLS playlists
82         (new in version 4) can be played, which was the primary cause of
83         this bug report.
84
85         Test: http/tests/media/hls/range-request.html
86
87         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
88         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
89         some trickery to make sure that we only ever fetch URLs handed to
90         us by WebCore. Any further URLs discovered inside the pipeline
91         will not get WKWS auto-plugged, since they'll be plain https?
92         schemas.
93         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
94         setPlaybinURL helper method.
95         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
96         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
97         the setPlaybinURL helper method.
98         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
99         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
100         ensures we won't get auto-plugged by pipeline elements asking for
101         an element to fetch https? resources (like adaptive demuxers).
102         (convertPlaybinURI): Undo the trick when another element asks us
103         for our URI.
104
105 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
106
107         [SVG] Leak in SVGAnimatedListPropertyTearOff
108         https://bugs.webkit.org/show_bug.cgi?id=172545
109
110         Reviewed by Said Abou-Hallawa.
111
112         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
113         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
114         reference to SVGAnimatedProperty.
115
116         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
117         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
118         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
119         is going to be added to. This effectively creates a reference cycle between the
120         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
121
122         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
123
124         * svg/properties/SVGAnimatedListPropertyTearOff.h:
125
126 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
127
128         [WTF] Move SoftLinking.h into WTF
129         https://bugs.webkit.org/show_bug.cgi?id=174000
130
131         Reviewed by Alex Christensen.
132
133         No new tests. No change in functionality
134
135         * Modules/applepay/PaymentRequest.cpp:
136         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
137         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
138         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
139         * WebCore.xcodeproj/project.pbxproj:
140         * editing/cocoa/EditorCocoa.mm:
141         * editing/cocoa/HTMLConverter.mm:
142         * editing/ios/EditorIOS.mm:
143         * page/CaptionUserPreferencesMediaAF.cpp:
144         * page/cocoa/SettingsCocoa.mm:
145         * page/ios/UserAgentIOS.mm:
146         * page/mac/ServicesOverlayController.mm:
147         * platform/audio/ios/AudioDestinationIOS.cpp:
148         * platform/audio/ios/AudioFileReaderIOS.cpp:
149         * platform/audio/ios/AudioSessionIOS.mm:
150         * platform/audio/ios/MediaSessionManagerIOS.mm:
151         * platform/cf/CoreMediaSoftLink.cpp:
152         * platform/cf/CoreMediaSoftLink.h:
153         * platform/cf/MediaAccessibilitySoftLink.cpp:
154         * platform/cf/MediaAccessibilitySoftLink.h:
155         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
156         * platform/cocoa/CoreVideoSoftLink.cpp:
157         * platform/cocoa/CoreVideoSoftLink.h:
158         * platform/cocoa/DataDetectorsCoreSoftLink.h:
159         * platform/cocoa/NetworkExtensionContentFilter.mm:
160         * platform/cocoa/ParentalControlsContentFilter.mm:
161         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
162         * platform/cocoa/VideoToolboxSoftLink.cpp:
163         * platform/cocoa/VideoToolboxSoftLink.h:
164         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
165         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
166         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
167         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
168         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
169         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
170         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
171         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
172         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
173         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
174         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
175         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
176         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
177         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
178         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
179         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
180         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
181         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
182         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
183         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
184         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
185         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
186         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
187         * platform/graphics/cocoa/FontCascadeCocoa.mm:
188         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
189         * platform/graphics/cv/PixelBufferConformerCV.cpp:
190         * platform/graphics/ios/FontCacheIOS.mm:
191         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
192         * platform/graphics/mac/FontCacheMac.mm:
193         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
194         * platform/graphics/mac/MediaTimeQTKit.mm:
195         * platform/graphics/mac/PDFDocumentImageMac.mm:
196         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
197         * platform/ios/DragImageIOS.mm:
198         * platform/ios/PlatformPasteboardIOS.mm:
199         * platform/ios/PlatformScreenIOS.mm:
200         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
201         * platform/ios/QuickLookSoftLink.h:
202         * platform/ios/QuickLookSoftLink.mm:
203         * platform/ios/RemoteCommandListenerIOS.mm:
204         * platform/ios/ThemeIOS.mm:
205         * platform/ios/ValidationBubbleIOS.mm:
206         * platform/ios/WebCoreMotionManager.mm:
207         * platform/ios/WebItemProviderPasteboard.mm:
208         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
209         * platform/mac/DragImageMac.mm:
210         * platform/mac/MediaRemoteSoftLink.cpp:
211         * platform/mac/MediaRemoteSoftLink.h:
212         * platform/mac/SerializedPlatformRepresentationMac.mm:
213         * platform/mac/WebPlaybackControlsManager.mm:
214         * platform/mac/WebVideoFullscreenController.mm:
215         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
216         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
217         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
218         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
219         * platform/network/cf/CookieJarCFNet.cpp:
220         * platform/network/ios/NetworkStateNotifierIOS.mm:
221         * platform/network/ios/PreviewConverter.mm:
222         * platform/network/mac/BlobDataFileReferenceMac.mm:
223         * platform/spi/cocoa/AVKitSPI.h:
224         (-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Deleted.
225         * platform/spi/cocoa/NSAttributedStringSPI.h:
226         * platform/spi/ios/DataDetectorsUISPI.h:
227         * platform/spi/mac/AVFoundationSPI.h:
228         * platform/spi/mac/DataDetectorsSPI.h:
229         * platform/spi/mac/LookupSPI.h:
230         * platform/spi/mac/TUCallSPI.h:
231         * platform/win/ScrollbarThemeWin.cpp:
232         * rendering/RenderThemeCocoa.mm:
233         * rendering/RenderThemeIOS.mm:
234         * rendering/RenderThemeWin.cpp:
235         * testing/Internals.mm:
236         * xml/XSLStyleSheetLibxslt.cpp:
237         * xml/XSLTExtensions.cpp:
238         * xml/XSLTProcessorLibxslt.cpp:
239         * xml/XSLTUnicodeSort.cpp:
240
241 2017-07-05  Zalan Bujtas  <zalan@apple.com>
242
243         REGRESSION: Stack overflow in RenderBlockFlow::layoutBlock after increasing the font size to max in some RTL vertical books.
244         https://bugs.webkit.org/show_bug.cgi?id=174144
245         <rdar://problem/32781038>
246
247         Reviewed by Simon Fraser.
248
249         We set the start/end margin on the ruby renderer to support overhanging content. The margins ensure that
250         adjacent boxes on the line are placed properly respecting the overhanging content.
251         The line breaking algorithm also takes this value into account as it affects the line's available width.
252         We need to reset this value before laying out the lines, otherwise we might end up using this value on the line twice;
253         first as the renderer's margins (as the result of the previous layout) and second as the renderer's overhanging value.
254         Since this is not strictly part of the renderer's layout context (i.e. we set them during the line layout and not at
255         RenderRubyRun::layout) we can't rely on the ruby's layout logic to reset them.
256
257         Test: fast/ruby/ruby-overhang-margin-crash.html
258
259         * rendering/RenderBlockLineLayout.cpp:
260         (WebCore::RenderBlockFlow::layoutLineBoxes):
261
262 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
263
264         Upgrade GCC baseline
265         https://bugs.webkit.org/show_bug.cgi?id=174155
266
267         Reviewed by Michael Catanzaro.
268
269         Remove workaround for old GCC.
270
271         * CMakeLists.txt:
272
273 2017-07-05  Chris Dumez  <cdumez@apple.com>
274
275         Unreviewed attempt to fix iOS build after r219177.
276
277         * page/ios/UserAgentIOS.mm:
278         * platform/spi/ios/UIKitSPI.h:
279
280 2017-07-05  Chris Dumez  <cdumez@apple.com>
281
282         Unreviewed attempt to fix iOS build after r219177.
283
284         * page/ios/UserAgentIOS.mm:
285         * platform/spi/ios/UIKitSPI.h:
286
287 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
288
289         Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
290         https://bugs.webkit.org/show_bug.cgi?id=174148
291
292         Reviewed by Mark Lam.
293
294         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
295         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC):
296
297 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
298
299         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
300         https://bugs.webkit.org/show_bug.cgi?id=174150
301
302         Reviewed by Mark Lam.
303
304         * Modules/mediacontrols/MediaControlsHost.cpp:
305         (WebCore::MediaControlsHost::captionDisplayMode):
306         * Modules/mediastream/RTCDataChannel.cpp:
307         (WebCore::RTCDataChannel::binaryType):
308         * accessibility/AXObjectCache.cpp:
309         (WebCore::createFromRenderer):
310         * accessibility/AccessibilityMediaControls.cpp:
311         (WebCore::AccessibilityMediaControl::controlTypeName):
312         * accessibility/AccessibilityObject.cpp:
313         (WebCore::AccessibilityObject::language):
314         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
315         (WebCore::AccessibilityObject::actionVerb):
316         (WebCore::AccessibilityObject::getAttribute):
317         (WebCore::AccessibilityObject::placeholderValue):
318         * accessibility/AccessibilityObject.h:
319         (WebCore::AccessibilityObject::accessKey):
320         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
321         * accessibility/AccessibilityRenderObject.cpp:
322         (WebCore::AccessibilityRenderObject::accessKey):
323         (WebCore::AccessibilityRenderObject::actionVerb):
324         * bindings/js/JSCustomElementInterface.cpp:
325         (WebCore::JSCustomElementInterface::constructElementWithFallback):
326         * bindings/js/JSCustomElementRegistryCustom.cpp:
327         (WebCore::JSCustomElementRegistry::define):
328         * bindings/scripts/CodeGeneratorJS.pm:
329         (GenerateDefaultValue):
330         * bindings/scripts/test/JS/JSTestObj.cpp:
331         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
332         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
333         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
334         * css/CSSPageRule.cpp:
335         (WebCore::CSSPageRule::selectorText):
336         * css/CSSPrimitiveValue.cpp:
337         (WebCore::valueName):
338         * css/CSSSelector.cpp:
339         (WebCore::simpleSelectorSpecificityInternal):
340         (WebCore::CSSSelector::specificityForPage):
341         (WebCore::CSSSelector::RareData::RareData):
342         * css/CSSSelector.h:
343         (WebCore::CSSSelector::argument):
344         * css/CSSSelectorList.cpp:
345         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
346         * css/PageRuleCollector.cpp:
347         (WebCore::checkPageSelectorComponents):
348         * css/RuleSet.cpp:
349         (WebCore::computeMatchBasedOnRuleHash):
350         (WebCore::RuleSet::addRule):
351         * css/SelectorChecker.cpp:
352         (WebCore::tagMatches):
353         * css/SelectorFilter.cpp:
354         (WebCore::collectDescendantSelectorIdentifierHashes):
355         * css/StyleBuilderConverter.h:
356         (WebCore::StyleBuilderConverter::convertStringOrAuto):
357         (WebCore::StyleBuilderConverter::convertStringOrNone):
358         * css/StyleBuilderCustom.h:
359         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
360         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
361         (WebCore::StyleBuilderCustom::applyValueContent):
362         (WebCore::StyleBuilderCustom::applyValueAlt):
363         * css/StyleSheetContents.cpp:
364         (WebCore::StyleSheetContents::StyleSheetContents):
365         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
366         * css/makeprop.pl:
367         * css/parser/CSSParserImpl.cpp:
368         (WebCore::CSSParserImpl::parsePageSelector):
369         * css/parser/CSSSelectorParser.cpp:
370         (WebCore::CSSSelectorParser::consumeCompoundSelector):
371         (WebCore::CSSSelectorParser::consumeName):
372         (WebCore::CSSSelectorParser::consumeAttribute):
373         (WebCore::CSSSelectorParser::defaultNamespace):
374         (WebCore::CSSSelectorParser::determineNamespace):
375         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
376         * cssjit/SelectorCompiler.cpp:
377         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
378         (WebCore::SelectorCompiler::equalTagNames):
379         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
380         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
381         * dom/Attr.cpp:
382         (WebCore::Attr::setPrefix):
383         (WebCore::Attr::attachToElement):
384         * dom/Attribute.h:
385         (WebCore::Attribute::nameMatchesFilter):
386         * dom/ConstantPropertyMap.cpp:
387         (WebCore::ConstantPropertyMap::nameForProperty):
388         * dom/ContainerNode.cpp:
389         (WebCore::ContainerNode::getElementsByTagName):
390         (WebCore::ContainerNode::getElementsByTagNameNS):
391         * dom/CustomElementReactionQueue.cpp:
392         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
393         * dom/DatasetDOMStringMap.cpp:
394         (WebCore::convertPropertyNameToAttributeName):
395         * dom/Document.cpp:
396         (WebCore::createUpgradeCandidateElement):
397         (WebCore::Document::createElementForBindings):
398         (WebCore::Document::importNode):
399         (WebCore::Document::hasValidNamespaceForElements):
400         (WebCore::Document::processBaseElement):
401         (WebCore::Document::dir):
402         (WebCore::Document::bgColor):
403         (WebCore::Document::fgColor):
404         (WebCore::Document::alinkColor):
405         (WebCore::Document::linkColorForBindings):
406         (WebCore::Document::vlinkColor):
407         * dom/Document.h:
408         * dom/Element.cpp:
409         (WebCore::Element::setBooleanAttribute):
410         (WebCore::Element::synchronizeAttribute):
411         (WebCore::Element::getAttribute):
412         (WebCore::Element::getAttributeNS):
413         (WebCore::Element::setAttribute):
414         (WebCore::Element::parserSetAttributes):
415         (WebCore::Element::didMoveToNewDocument):
416         (WebCore::Element::setPrefix):
417         (WebCore::Element::insertedInto):
418         (WebCore::Element::removedFrom):
419         (WebCore::Element::removeAttributeInternal):
420         (WebCore::Element::addAttributeInternal):
421         (WebCore::Element::removeAttributeNS):
422         (WebCore::Element::getAttributeNodeNS):
423         (WebCore::Element::hasAttributeNS):
424         (WebCore::Element::computeInheritedLanguage):
425         (WebCore::Element::updateNameForDocument):
426         (WebCore::Element::updateIdForDocument):
427         (WebCore::Element::didAddAttribute):
428         (WebCore::Element::didRemoveAttribute):
429         (WebCore::Element::cloneAttributesFromElement):
430         * dom/Element.h:
431         (WebCore::Element::attributeWithoutSynchronization):
432         (WebCore::Element::idForStyleResolution):
433         (WebCore::Element::getIdAttribute):
434         (WebCore::Element::getNameAttribute):
435         * dom/EventTarget.cpp:
436         (WebCore::legacyType):
437         * dom/MutationRecord.h:
438         (WebCore::MutationRecord::attributeName):
439         (WebCore::MutationRecord::attributeNamespace):
440         * dom/NamedNodeMap.cpp:
441         (WebCore::NamedNodeMap::removeNamedItemNS):
442         * dom/Node.cpp:
443         (WebCore::Node::prefix):
444         (WebCore::Node::localName):
445         (WebCore::Node::namespaceURI):
446         (WebCore::Node::checkSetPrefix):
447         (WebCore::locateDefaultNamespace):
448         (WebCore::Node::isDefaultNamespace):
449         (WebCore::Node::lookupNamespaceURI):
450         (WebCore::locateNamespacePrefix):
451         (WebCore::Node::lookupPrefix):
452         * dom/NodeRareData.h:
453         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
454         (WebCore::NodeListsNodeData::addCachedCollection):
455         (WebCore::NodeListsNodeData::cachedCollection):
456         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
457         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
458         (WebCore::NodeListsNodeData::removeCachedCollection):
459         * dom/PseudoElement.cpp:
460         (WebCore::pseudoElementTagName):
461         * dom/QualifiedName.cpp:
462         (WebCore::QualifiedName::init):
463         (WebCore::nullQName):
464         (WebCore::createQualifiedName):
465         * dom/QualifiedName.h:
466         (WebCore::QualifiedName::hasPrefix):
467         * dom/SelectorQuery.cpp:
468         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
469         * dom/SlotAssignment.cpp:
470         (WebCore::slotNameFromAttributeValue):
471         * dom/SlotAssignment.h:
472         (WebCore::SlotAssignment::defaultSlotName):
473         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
474         (WebCore::ShadowRoot::didChangeDefaultSlot):
475         * dom/TagCollection.cpp:
476         (WebCore::TagCollection::TagCollection):
477         (WebCore::HTMLTagCollection::HTMLTagCollection):
478         * dom/TagCollection.h:
479         (WebCore::TagCollectionNS::elementMatches):
480         * dom/make_names.pl:
481         (printNamesCppFile):
482         (printDefinitions):
483         (printFactoryCppFile):
484         * editing/CompositeEditCommand.cpp:
485         (WebCore::CompositeEditCommand::removeNodeAttribute):
486         * editing/Editing.cpp:
487         (WebCore::createHTMLElement):
488         * editing/MarkupAccumulator.cpp:
489         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
490         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
491         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
492         (WebCore::MarkupAccumulator::appendNamespace):
493         (WebCore::MarkupAccumulator::appendOpenTag):
494         (WebCore::MarkupAccumulator::appendAttribute):
495         * editing/gtk/EditorGtk.cpp:
496         (WebCore::elementURL):
497         * editing/markup.cpp:
498         (WebCore::AttributeChange::AttributeChange):
499         * html/Autocapitalize.cpp:
500         (WebCore::stringForAutocapitalizeType):
501         * html/Autofill.cpp:
502         (WebCore::AutofillData::createFromHTMLFormControlElement):
503         * html/DOMTokenList.h:
504         (WebCore::DOMTokenList::item):
505         * html/FormAssociatedElement.cpp:
506         (WebCore::FormAssociatedElement::name):
507         * html/HTMLButtonElement.cpp:
508         (WebCore::HTMLButtonElement::formControlType):
509         * html/HTMLDetailsElement.cpp:
510         (WebCore::HTMLDetailsElement::toggleOpen):
511         * html/HTMLDocument.cpp:
512         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
513         * html/HTMLElement.cpp:
514         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
515         (WebCore::toValidDirValue):
516         * html/HTMLImageElement.cpp:
517         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
518         * html/HTMLInputElement.cpp:
519         (WebCore::HTMLInputElement::name):
520         (WebCore::HTMLInputElement::updateType):
521         * html/HTMLMediaElement.cpp:
522         (WebCore::HTMLMediaElement::doesHaveAttribute):
523         * html/HTMLOptionElement.cpp:
524         (WebCore::HTMLOptionElement::createForJSConstructor):
525         * html/HTMLParamElement.cpp:
526         (WebCore::HTMLParamElement::name):
527         * html/HTMLSelectElement.cpp:
528         (WebCore::HTMLSelectElement::setMultiple):
529         * html/HTMLTableCellElement.cpp:
530         (WebCore::HTMLTableCellElement::scope):
531         * html/HTMLTrackElement.cpp:
532         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
533         * html/LabelableElement.cpp:
534         (WebCore::LabelableElement::labels):
535         * html/LabelsNodeList.cpp:
536         (WebCore::LabelsNodeList::~LabelsNodeList):
537         * html/MediaController.cpp:
538         (MediaController::playbackState):
539         (eventNameForReadyState):
540         * html/MediaDocument.cpp:
541         (WebCore::MediaDocumentParser::createDocumentStructure):
542         * html/parser/AtomicHTMLToken.h:
543         (WebCore::AtomicHTMLToken::initializeAttributes):
544         * html/parser/HTMLConstructionSite.cpp:
545         (WebCore::HTMLConstructionSite::createElement):
546         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
547         * html/parser/HTMLParserIdioms.cpp:
548         (WebCore::stripLeadingAndTrailingHTMLSpaces):
549         (WebCore::parseHTMLHashNameReference):
550         * html/parser/HTMLTreeBuilder.cpp:
551         (WebCore::createForeignAttributesMap):
552         * html/track/InbandTextTrack.cpp:
553         (WebCore::InbandTextTrack::InbandTextTrack):
554         * html/track/LoadableTextTrack.cpp:
555         (WebCore::LoadableTextTrack::id):
556         * html/track/TextTrack.cpp:
557         (WebCore::TextTrack::captionMenuOffItem):
558         (WebCore::TextTrack::captionMenuAutomaticItem):
559         * html/track/TrackBase.cpp:
560         (WebCore::MediaTrackBase::setKindInternal):
561         * html/track/VTTRegion.cpp:
562         (WebCore::VTTRegion::scroll):
563         * html/track/WebVTTElement.cpp:
564         (WebCore::nodeTypeToTagName):
565         * html/track/WebVTTElement.h:
566         * html/track/WebVTTToken.h:
567         (WebCore::WebVTTToken::StartTag):
568         * loader/FrameLoader.cpp:
569         (WebCore::FrameLoader::clear):
570         * loader/FrameLoader.h:
571         * loader/ImageLoader.cpp:
572         (WebCore::ImageLoader::clearFailedLoadURL):
573         * loader/NavigationAction.h:
574         * loader/PolicyChecker.cpp:
575         (WebCore::PolicyChecker::checkNavigationPolicy):
576         * page/DOMWindow.cpp:
577         (WebCore::DOMWindow::showModalDialog):
578         * page/EventHandler.cpp:
579         (WebCore::eventNameForTouchPointState):
580         * page/FrameTree.cpp:
581         (WebCore::FrameTree::setName):
582         (WebCore::FrameTree::clearName):
583         * page/Page.cpp:
584         (WebCore::Page::groupName):
585         * platform/graphics/ComplexTextController.cpp:
586         (WebCore::ComplexTextController::offsetForPosition):
587         * platform/graphics/FontCache.cpp:
588         (WebCore::FontCache::alternateFamilyName):
589         * platform/graphics/FontDescription.h:
590         (WebCore::FontCascadeDescription::initialLocale):
591         * platform/graphics/FontGenericFamilies.cpp:
592         (WebCore::genericFontFamilyForScript):
593         * platform/graphics/InbandTextTrackPrivate.h:
594         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
595         * platform/graphics/TrackPrivateBase.h:
596         (WebCore::TrackPrivateBase::id):
597         (WebCore::TrackPrivateBase::label):
598         (WebCore::TrackPrivateBase::language):
599         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
600         (WebCore::AVTrackPrivateAVFObjCImpl::id):
601         (WebCore::AVTrackPrivateAVFObjCImpl::label):
602         (WebCore::AVTrackPrivateAVFObjCImpl::language):
603         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
604         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
605         (WebCore::InbandTextTrackPrivateAVCF::label):
606         (WebCore::InbandTextTrackPrivateAVCF::language):
607         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
608         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
609         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
610         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
611         (WebCore::InbandTextTrackPrivateAVFObjC::label):
612         (WebCore::InbandTextTrackPrivateAVFObjC::language):
613         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
614         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
615         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
616         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
617         (WebCore::metadataType):
618         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
619         * platform/graphics/cocoa/FontCacheCoreText.cpp:
620         (WebCore::FontCache::platformAlternateFamilyName):
621         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
622         (WebCore::FontCascadeDescription::effectiveFamilyAt):
623         * platform/graphics/freetype/FontCacheFreeType.cpp:
624         (WebCore::FontCache::platformAlternateFamilyName):
625         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
626         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
627         * platform/graphics/win/FontCacheWin.cpp:
628         (WebCore::FontCache::platformAlternateFamilyName):
629         * platform/mediastream/AudioTrackPrivateMediaStream.h:
630         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
631         (WebCore::RealtimeMediaSourceSettings::facingMode):
632         * platform/mediastream/VideoTrackPrivateMediaStream.h:
633         * rendering/HitTestResult.cpp:
634         (WebCore::HitTestResult::linkSuggestedFilename):
635         * rendering/InlineTextBox.cpp:
636         (WebCore::InlineTextBox::paint):
637         * rendering/RenderListItem.cpp:
638         (WebCore::RenderListItem::markerText):
639         * rendering/RenderText.cpp:
640         (WebCore::RenderText::previousOffset):
641         (WebCore::RenderText::nextOffset):
642         * rendering/RenderTreeAsText.cpp:
643         (WebCore::RenderTreeAsText::writeRenderObject):
644         * rendering/TextPainter.cpp:
645         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
646         * rendering/style/RenderStyle.cpp:
647         (WebCore::RenderStyle::textEmphasisMarkString):
648         * rendering/style/RenderStyle.h:
649         (WebCore::RenderStyle::initialHyphenationString):
650         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
651         (WebCore::RenderStyle::initialContentAltText):
652         (WebCore::RenderStyle::initialLineGrid):
653         (WebCore::RenderStyle::initialFlowThread):
654         (WebCore::RenderStyle::initialRegionThread):
655         * style/StyleScope.cpp:
656         (WebCore::Style::Scope::collectActiveStyleSheets):
657         * svg/SVGElement.cpp:
658         (WebCore::SVGElement::getPresentationAttribute):
659         * svg/SVGElement.h:
660         (WebCore::SVGAttributeHashTranslator::hash):
661         * svg/SVGUseElement.cpp:
662         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
663         * svg/animation/SVGSMILElement.cpp:
664         (WebCore::SVGSMILElement::constructAttributeName):
665         * testing/MockCDMFactory.cpp:
666         (WebCore::MockCDMInstance::requestLicense):
667         * xml/XMLErrors.cpp:
668         (WebCore::createXHTMLParserErrorHeader):
669         * xml/XPathStep.cpp:
670         (WebCore::XPath::nodeMatchesBasicTest):
671         (WebCore::XPath::Step::nodesInAxis):
672         * xml/parser/XMLDocumentParserLibxml2.cpp:
673         (WebCore::XMLDocumentParser::XMLDocumentParser):
674         (WebCore::handleNamespaceAttributes):
675         (WebCore::handleElementAttributes):
676
677 2017-07-05  Chris Dumez  <cdumez@apple.com>
678
679         [iOS] User agent string incorrectly says "iPhone" instead of "iPad" on newer iPads
680         https://bugs.webkit.org/show_bug.cgi?id=174182
681         <rdar://problem/32868369>
682
683         Reviewed by Tim Horton.
684
685         In deviceNameForUserAgent() on iOS, we were forcefully returning "iPhone" if
686         [UIApplication _isClassic] returns true. Update check to return "iPad" if
687         [UIApplication _isClassic] returns true but [UIApplication _classMode] returns
688         UIApplicationSceneClassicModeOriginalPad.
689
690         * page/ios/UserAgentIOS.mm:
691         (WebCore::isClassicPad):
692         (WebCore::isClassicPhone):
693         (WebCore::osNameForUserAgent):
694         (WebCore::deviceNameForUserAgent):
695         * platform/spi/ios/UIKitSPI.h:
696
697 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
698
699         WTF::Thread should have the threads stack bounds.
700         https://bugs.webkit.org/show_bug.cgi?id=173975
701
702         Reviewed by Keith Miller.
703
704         When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread
705         and share it with WebThread.
706         The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators.
707         It allocates AtomicString, which requires WTFThreadData.
708
709         Before this patch, it was OK because WTFThreadData does not touch threading related
710         things except for ThreadSpecific<>. However, after this patch, it touches
711         WTF::Thread::current() which requires WTF::initializeThreading().
712
713         In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData.
714         And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since
715         WebCore::ThreadGlobalData allocates AtomicString.
716
717         This fixes crashes in the iOS web threading environment (UIWebView).
718
719         * platform/ios/wak/WebCoreThread.mm:
720         (StartWebThread):
721
722 2017-07-05  Myles C. Maxfield  <mmaxfield@apple.com>
723
724         CSSFontStyleValue::isItalic seems a bit bogus.
725         https://bugs.webkit.org/show_bug.cgi?id=174149
726
727         Reviewed by Tim Horton.
728
729         Simple typo.
730
731         Test: editing/execCommand/italicizeByCharacter-normal.html
732
733         * css/CSSFontStyleValue.h:
734
735 2017-07-05  Brady Eidson  <beidson@apple.com>
736
737         Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".
738         <rdar://problem/22485589> and https://bugs.webkit.org/show_bug.cgi?id=174178
739
740         Reviewed by Alex Christensen.
741
742         Test: loader/navigation-policy/should-open-external-urls/subframe-navigated-programatically-by-main-frame.html
743
744         This patch introduces a new flag to FrameLoadRequest to track when it is known with certainty that a 
745         FrameLoadRequest originates from the main frame.
746         
747         Later, when calculating the final ShouldOpenExternalURLsPolicy, main frames navigating iframes get to propagate
748         their permissions to the iframe.
749         
750         * bindings/js/CommonVM.cpp:
751         (WebCore::lexicalFrameFromCommonVM): Helper to grab the current frame associated with the current JS callstack.
752         * bindings/js/CommonVM.h:
753
754         * inspector/InspectorFrontendClientLocal.cpp:
755         (WebCore::InspectorFrontendClientLocal::openInNewTab):
756
757         * inspector/InspectorPageAgent.cpp:
758         (WebCore::InspectorPageAgent::navigate):
759
760         Add the new flag to FrameLoadRequest (and force almost everybody to explicitly include the flag):
761         * loader/FrameLoadRequest.cpp:
762         (WebCore::FrameLoadRequest::FrameLoadRequest):
763         * loader/FrameLoadRequest.h:
764         (WebCore::FrameLoadRequest::FrameLoadRequest):
765         (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame):
766
767         * loader/FrameLoader.cpp:
768         (WebCore::FrameLoader::urlSelected):
769         (WebCore::FrameLoader::loadURLIntoChildFrame):
770         (WebCore::shouldOpenExternalURLsPolicyToApply): Helper that takes the new flag into account when deciding
771           what the final ShouldOpenExternalURLsPolicy will be.
772         (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
773         (WebCore::FrameLoader::loadURL):
774         (WebCore::FrameLoader::load):
775         (WebCore::FrameLoader::loadWithNavigationAction):
776         (WebCore::FrameLoader::reloadWithOverrideEncoding):
777         (WebCore::FrameLoader::reload):
778         (WebCore::FrameLoader::loadPostRequest):
779         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
780         (WebCore::FrameLoader::loadDifferentDocumentItem):
781         (WebCore::createWindow):
782         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Deleted.
783         * loader/FrameLoader.h:
784
785         * loader/FrameLoaderTypes.h:
786
787         * loader/NavigationAction.h:
788         (WebCore::NavigationAction::navigationInitiatedByMainFrame):
789         * loader/NavigationScheduler.cpp:
790         (WebCore::ScheduledNavigation::ScheduledNavigation): Grab the "initiating frame" at the time the 
791           ScheduledNavigation is created, as it dictates the policy we decide later.
792         (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame):
793         (WebCore::NavigationScheduler::scheduleLocationChange):
794
795         * page/ContextMenuController.cpp:
796         (WebCore::openNewWindow):
797         (WebCore::ContextMenuController::contextMenuItemSelected):
798
799         * page/DOMWindow.cpp:
800         (WebCore::DOMWindow::createWindow):
801
802 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
803
804         Another build fix, for Mac.
805
806         * platform/graphics/cocoa/IOSurface.mm:
807         (WebCore::IOSurface::surfaceID):
808
809 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
810
811         Further attempts to fix the iOS public SDK build.
812
813         * platform/graphics/cocoa/IOSurface.mm:
814         (WebCore::IOSurface::surfaceID):
815         * platform/spi/cocoa/IOSurfaceSPI.h:
816
817 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
818
819         [WinCairo] Consolidate CMake code related to CURL
820         https://bugs.webkit.org/show_bug.cgi?id=170860
821
822         Reviewed by Alex Christensen.
823
824         No new tests. No change in functionality.
825
826         * PlatformWinCairo.cmake:
827         * platform/Curl.cmake: Added.
828
829 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
830
831         Remove copy of ICU headers from WebKit
832         https://bugs.webkit.org/show_bug.cgi?id=116407
833
834         Reviewed by Alex Christensen.
835
836         Use WTF's copy of ICU headers.
837
838         No new tests because there is no behavior change.
839
840         * Configurations/WebCore.xcconfig:
841         * icu/unicode/bytestream.h: Removed.
842         * icu/unicode/localpointer.h: Removed.
843         * icu/unicode/parseerr.h: Removed.
844         * icu/unicode/platform.h: Removed.
845         * icu/unicode/ptypes.h: Removed.
846         * icu/unicode/putil.h: Removed.
847         * icu/unicode/rep.h: Removed.
848         * icu/unicode/std_string.h: Removed.
849         * icu/unicode/strenum.h: Removed.
850         * icu/unicode/stringpiece.h: Removed.
851         * icu/unicode/ubrk.h: Removed.
852         * icu/unicode/uchar.h: Removed.
853         * icu/unicode/ucnv.h: Removed.
854         * icu/unicode/ucnv_err.h: Removed.
855         * icu/unicode/ucol.h: Removed.
856         * icu/unicode/uconfig.h: Removed.
857         * icu/unicode/ucurr.h: Removed.
858         * icu/unicode/uenum.h: Removed.
859         * icu/unicode/uiter.h: Removed.
860         * icu/unicode/uloc.h: Removed.
861         * icu/unicode/umachine.h: Removed.
862         * icu/unicode/unistr.h: Removed.
863         * icu/unicode/unorm.h: Removed.
864         * icu/unicode/unorm2.h: Removed.
865         * icu/unicode/uobject.h: Removed.
866         * icu/unicode/urename.h: Removed.
867         * icu/unicode/uscript.h: Removed.
868         * icu/unicode/uset.h: Removed.
869         * icu/unicode/ustring.h: Removed.
870         * icu/unicode/utext.h: Removed.
871         * icu/unicode/utf.h: Removed.
872         * icu/unicode/utf16.h: Removed.
873         * icu/unicode/utf8.h: Removed.
874         * icu/unicode/utf_old.h: Removed.
875         * icu/unicode/utypes.h: Removed.
876         * icu/unicode/uvernum.h: Removed.
877         * icu/unicode/uversion.h: Removed.
878         * platform/graphics/FontCache.h:
879         (WebCore::FontDescriptionKey::makeFlagsKey):
880
881 2017-07-05  Wenson Hsieh  <wenson_hsieh@apple.com>
882
883         When dragging a selection, clearing the selection in dragstart should not crash the web process
884         https://bugs.webkit.org/show_bug.cgi?id=174142
885         <rdar://problem/33067501>
886
887         Reviewed by Tim Horton.
888
889         Currenly, if the page clears the current selection after dragging starts on selected content, the web process
890         will crash while attempting to write pasteboard data for a nonexistent selection. This patch adds a trivial
891         check for this case, bailing if no DHTML dragging data was specified by the page during a selection drag and the
892         selection has been cleared.
893
894         Also removes some unused code for estimating the bounds of the current selection. On iOS, dragging was actually
895         crashing earlier, in this codepath. However, this information isn't even used anymore, since the drag anchor
896         point is no longer necessary on iOS.
897
898         Test: DataInteractionTests.DoNotCrashWhenSelectionIsClearedInDragStart
899
900         * page/DragController.cpp:
901         (WebCore::DragController::startDrag):
902
903 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
904
905         Try to fix iOS 10.3 public SDK builds.
906
907         * platform/spi/cocoa/IOSurfaceSPI.h:
908
909 2017-07-05  Zalan Bujtas  <zalan@apple.com>
910
911         REGRESSION (r217522): "Show My Relationship" link in familysearch.org does not work.
912         https://bugs.webkit.org/show_bug.cgi?id=174070
913         <rdar://problem/32940653>
914
915         Reviewed by Simon Fraser.
916
917         Decouple in- and out-of-flow computed position values. Now we match blink's implementation on
918         in-flow values.
919         This also fixes the flickering content while scrolling on hbr.org.  
920
921         Covered by existing test cases.
922
923         * css/CSSComputedStyleDeclaration.cpp:
924         (WebCore::positionOffsetValue):
925
926 2017-07-05  Devin Rousso  <drousso@apple.com>
927
928         Web Inspector: Allow users to log any tracked canvas context
929         https://bugs.webkit.org/show_bug.cgi?id=173397
930         <rdar://problem/33111581>
931
932         Reviewed by Joseph Pecoraro.
933
934         Tests: inspector/canvas/resolveCanvasContext-2d.html
935                inspector/canvas/resolveCanvasContext-webgl.html
936                inspector/canvas/resolveCanvasContext-webgl2.html
937                inspector/canvas/resolveCanvasContext-webgpu.html
938
939         * inspector/InspectorCanvasAgent.h:
940         * inspector/InspectorCanvasAgent.cpp:
941         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
942         (WebCore::contextAsScriptValue):
943         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
944
945 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
946
947         Style sharing check for fullscreen element seems bogus.
948         https://bugs.webkit.org/show_bug.cgi?id=160196
949
950         Reviewed by Antti Koivisto.
951
952         No new tests (no easy way to test this reliably).
953
954         * style/StyleSharingResolver.cpp:
955         (WebCore::Style::SharingResolver::canShareStyleWithElement):
956
957 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
958
959         Add a logging channel for IOSurface allocations
960         https://bugs.webkit.org/show_bug.cgi?id=174167
961
962         Reviewed by Tim Horton.
963
964         Add an "IOSurface" log channel, make IOSurface TextStream-loggable, and log cached
965         and new IOSurface allocations. Do some namespace-related cleanup.
966
967         * platform/Logging.h:
968         * platform/graphics/cocoa/IOSurface.h:
969         * platform/graphics/cocoa/IOSurface.mm:
970         (WebCore::WebCore::IOSurface::create):
971         (WebCore::WebCore::IOSurface::surfaceID):
972         (WebCore::operator<<):
973
974 2017-07-05  Antti Koivisto  <antti@apple.com>
975
976         Low memory notification shouldn't cause style recalc
977         https://bugs.webkit.org/show_bug.cgi?id=173574
978         <rdar://problem/32616997>
979
980         Reviewed by Andreas Kling.
981
982         Patch mostly by Myles.
983
984         When we receive a low memory warning, we clear the style resolver. Previously, we were using
985         this as an opportunity to also purge the CSSFontSelector. However, purging the font selector
986         is wasteful, since the exact same set of CSSFontFace objects will be recreated as soon as the
987         CSSFontSelector is recreated. It's also harmful because this purge operation causes fonts to
988         be removed from the document's working set, and therefore triggers a relayout. Instead, this
989         call should be softened to only delete any transitory caches the CSSFontSelector owns.
990
991         We can simply delay the rebuild of the CSSFontSelector to
992         StyleResolver::appendAuthorStyleSheets(), when it's really needed. This way, we can sidestep
993         this whole problem.
994
995         There's also an added benefit: Now, buildStarted() doesn't have to be idempotent, so we can
996         enforce a stricter calling sequence with ASSERT()s.
997
998         * css/CSSFontFaceSet.cpp:
999         (WebCore::CSSFontFaceSet::emptyCaches):
1000         * css/CSSFontFaceSet.h:
1001         * css/CSSFontSelector.cpp:
1002         (WebCore::CSSFontSelector::emptyCaches):
1003
1004             Add a separate function to clear font selector caches.
1005
1006         (WebCore::CSSFontSelector::buildStarted):
1007         (WebCore::CSSFontSelector::buildCompleted):
1008         (WebCore::CSSFontSelector::addFontFaceRule):
1009         (WebCore::CSSFontSelector::fontModified):
1010
1011             No need to invalidate while building.
1012
1013         (WebCore::CSSFontSelector::fontRangesForFamily):
1014         * css/CSSFontSelector.h:
1015         * css/StyleResolver.cpp:
1016         (WebCore::StyleResolver::StyleResolver):
1017         (WebCore::StyleResolver::addCurrentSVGFontFaceRules):
1018
1019             Factor into a function from the constructor.
1020
1021         (WebCore::StyleResolver::appendAuthorStyleSheets):
1022
1023             Font selector build is now started and finished by StyleScope.
1024
1025         * css/StyleResolver.h:
1026         * dom/Document.cpp:
1027         (WebCore::Document::resolveStyle):
1028
1029             Call FrameView::styleDidChange() to update any custom scrollbars.
1030             This bug was hidden by spurious style recalcs, tested by fast/css/scrollbar-dynamic-style-change.html
1031
1032         (WebCore::Document::userAgentShadowTreeStyleResolver):
1033         (WebCore::Document::didClearStyleResolver):
1034
1035             Don't start the font selector rebuild after clearing the resolver. It would cause style recalc trashing.
1036             Instead the build starts when the new resolver is constructed.
1037
1038         * page/MemoryRelease.cpp:
1039         (WebCore::releaseCriticalMemory):
1040
1041             Release font selector caches.
1042
1043         * style/StyleScope.cpp:
1044         (WebCore::Style::Scope::resolver):
1045
1046 2017-07-05  Brent Fulgham  <bfulgham@apple.com>
1047
1048         [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events
1049         https://bugs.webkit.org/show_bug.cgi?id=174062\
1050         <rdar://problem/33086744>
1051
1052         Reviewed by Chris Dumez.
1053
1054         Treat DISPATCH_VNODE_DELETE, DISPATCH_VNODE_RENAME, and DISPATCH_VNODE_REVOKE as equivalent
1055         "file is unavailable" events, and act as though the file was deleted. Don't listen for
1056         DISPATCH_VNODE_EXTEND, since we always get a DISPATCH_VNODE_WRITE as well, and we only
1057         want to read once.
1058
1059         Finally, add some logging to support future investigations.
1060
1061         * platform/FileMonitor.h:
1062         (WebCore::FileMonitor::platformMonitor): Expose dispatch_source_t for logging purposes.
1063         * platform/cocoa/FileMonitorCocoa.mm:
1064         (WebCore::FileMonitor::startMonitoring): Add logging.
1065         (WebCore::FileMonitor::stopMonitoring): Ditto.
1066
1067 2017-07-05  Jonathan Bedard  <jbedard@apple.com>
1068
1069         Add WebKitPrivateFrameworkStubs for iOS 11
1070         https://bugs.webkit.org/show_bug.cgi?id=173988
1071
1072         Reviewed by David Kilzer.
1073
1074         * Configurations/WebCore.xcconfig: iphoneos and iphonesimulator should use the
1075         same directory for private framework stubs.
1076
1077 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
1078
1079         Don't resolve an extra computed style for getComputedStyle in a display: none subtree.
1080         https://bugs.webkit.org/show_bug.cgi?id=174145
1081
1082         Before this, we were also resolving the first ancestor's style as
1083         inheriting from itself, which felt pretty wrong (though I think it's
1084         not observable).
1085
1086         Reviewed by Antti Koivisto.
1087
1088         No new tests (non-observable behavior).
1089
1090         * dom/Element.cpp:
1091         (WebCore::Element::resolveComputedStyle):
1092
1093 2017-07-05  Frederic Wang  <fwang@igalia.com>
1094
1095         Move ScrolledContentsLayer property to ScrollingStateScrollingNode
1096         https://bugs.webkit.org/show_bug.cgi?id=174134
1097
1098         Reviewed by Simon Fraser.
1099
1100         ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode both use a
1101         ScrolledContentsLayer property for the same purpose. This commit moves that property into
1102         their parent class ScrollingStateScrollingNode, so that more code is shared between the two
1103         classes. This will also help the refactoring in bug 174130.
1104
1105         No new tests, only dumped tree may change a bit.
1106
1107         * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Remove scrolled contents layer.
1108         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1109         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
1110         (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer): Deleted.
1111         * page/scrolling/ScrollingStateFrameScrollingNode.h: Ditto.
1112         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Ditto.
1113         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
1114         (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
1115         (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer): Deleted.
1116         * page/scrolling/ScrollingStateOverflowScrollingNode.h: Ditto.
1117         (): Deleted.
1118         (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer): Deleted.
1119         * page/scrolling/ScrollingStateScrollingNode.cpp: Add scrolled contents layer.
1120         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
1121         (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer):
1122         (WebCore::ScrollingStateScrollingNode::dumpProperties): Use the label from the overflow class
1123         which is different from the frame class. The dumping order may change a bit too.
1124         * page/scrolling/ScrollingStateScrollingNode.h: Add ScrolledContentsLayer to the enum and
1125         scrolled contents layer.
1126         (WebCore::ScrollingStateScrollingNode::scrolledContentsLayer):
1127         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1128         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): Adjust enum value
1129         to use ScrollingStateScrollingNode::ScrolledContentsLayer.
1130
1131 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
1132
1133         ProcessingInstruction::clearExistingCachedSheet doesn't really exist.
1134         https://bugs.webkit.org/show_bug.cgi?id=174146
1135
1136         Reviewed by Chris Dumez.
1137
1138         No new tests (no functionality change).
1139
1140         * dom/ProcessingInstruction.h: Remove dead declaration.
1141
1142 2017-07-05  Matt Lewis  <jlewis3@apple.com>
1143
1144         Unreviewed, rolling out r219128.
1145
1146         Spoke with engineer who originally submitted, Patch for APi
1147         test to follow.
1148
1149         Reverted changeset:
1150
1151         "Unreviewed, rolling out r219070."
1152         https://bugs.webkit.org/show_bug.cgi?id=174082
1153         http://trac.webkit.org/changeset/219128
1154
1155 2017-07-05  Matt Lewis  <jlewis3@apple.com>
1156
1157         Unreviewed, rolling out r219070.
1158
1159         This revision caused consistent failures of the API test
1160         UIPasteboardTests.DoNotPastePlainTextAsURL on iOS.
1161
1162         Reverted changeset:
1163
1164         "Pasting single words copied to UIPasteboard inserts URLs in
1165         editable areas"
1166         https://bugs.webkit.org/show_bug.cgi?id=174082
1167         http://trac.webkit.org/changeset/219070
1168
1169 2017-07-05  Youenn Fablet  <youenn@apple.com>
1170
1171         Receiving tracks should be ended when peer connection is being closed
1172         https://bugs.webkit.org/show_bug.cgi?id=174109
1173
1174         Reviewed by Eric Carlson.
1175
1176         Test: webrtc/peer-connection-track-end.html
1177
1178         As per https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close, tracks should be ended when peer connection is closed.
1179         Also updating transceiver stopped state.
1180
1181         * Modules/mediastream/RTCPeerConnection.cpp:
1182         (WebCore::RTCPeerConnection::doClose):
1183         * Modules/mediastream/RTCRtpReceiver.cpp:
1184         (WebCore::RTCRtpReceiver::stop):
1185         * Modules/mediastream/RTCRtpReceiver.h:
1186
1187 2017-07-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1188
1189         Unreviewed, review follow-up after r218961
1190
1191         * platform/graphics/BitmapImage.cpp:
1192         (WebCore::BitmapImage::updateFromSettings):
1193
1194 2017-07-04  Antti Koivisto  <antti@apple.com>
1195
1196         RenderThemeCocoa::mediaControlsFormattedStringForDuration is leaking NSDateComponentsFormatters
1197         https://bugs.webkit.org/show_bug.cgi?id=174138
1198
1199         Reviewed by Ryosuke Niwa.
1200
1201         Saw a random spin here during media playback. Looks like we are leaking.
1202
1203         * rendering/RenderThemeCocoa.h:
1204         * rendering/RenderThemeCocoa.mm:
1205         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
1206
1207             Reuse NSDateComponentsFormatter.
1208
1209 2017-07-04  Antti Koivisto  <antti@apple.com>
1210
1211         FrameView should not set RenderView::logicalWidth directly for printing
1212         https://bugs.webkit.org/show_bug.cgi?id=174135
1213
1214         Reviewed by Zalan Bujtas.
1215
1216         Renderer logicalWidth should be set by layout. Direct override by RenderView when printing means
1217         that we don't layout children in all cases when the width changes. This is currently mostly hidden
1218         by spurious layouts but causes problems when trying to fix other things that reduces those.
1219
1220         * page/FrameView.cpp:
1221         (WebCore::FrameView::forceLayoutForPagination):
1222
1223             Instead of calling setLogicalWidth directly call the new setPageLogicalSize that sets both the width
1224             and the height uniformly.
1225
1226         * rendering/RenderView.cpp:
1227         (WebCore::RenderView::updateLogicalWidth):
1228
1229             Use pageLogicalSize->width() in printing state instead of skipping the logical width update entirely.
1230             This ensures that the layout will progress to children when the page logical width changes.
1231
1232         (WebCore::RenderView::initializeLayoutState):
1233         (WebCore::RenderView::layout):
1234         (WebCore::RenderView::pageOrViewLogicalHeight):
1235         (WebCore::RenderView::setPageLogicalSize):
1236         * rendering/RenderView.h:
1237
1238             Replace the existing m_pageLogicalHeight with std::optional m_pageLogicalSize.
1239
1240 2017-07-04  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1241
1242         [EME] Solve a couple of compiler warnings
1243         https://bugs.webkit.org/show_bug.cgi?id=174020
1244
1245         Reviewed by Michael Catanzaro.
1246
1247         * Modules/encryptedmedia/CDM.cpp:
1248         (WebCore::CDM::isPersistentType): Added default return and
1249         assertion.
1250         * Modules/encryptedmedia/MediaKeySession.cpp:
1251         (WebCore::MediaKeySession::updateKeyStatuses): This warning was
1252         already solved but I think adding an assertion for the default
1253         case can help catch errors in the future.
1254
1255 2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
1256
1257         Cleanup some StringBuilder use
1258         https://bugs.webkit.org/show_bug.cgi?id=174118
1259
1260         Reviewed by Andreas Kling.
1261
1262         * Modules/mediastream/PeerConnectionBackend.cpp:
1263         (WebCore::filterICECandidate):
1264         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1265         * contentextensions/ContentExtension.cpp:
1266         (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
1267         * css/CSSFontStyleRangeValue.cpp:
1268         (WebCore::CSSFontStyleRangeValue::customCSSText):
1269         * css/CSSFontStyleValue.cpp:
1270         (WebCore::CSSFontStyleValue::customCSSText):
1271         * css/CSSGridAutoRepeatValue.cpp:
1272         (WebCore::CSSGridAutoRepeatValue::customCSSText):
1273         * css/parser/CSSParser.cpp:
1274         (WebCore::CSSParser::parseFontFaceDescriptor):
1275         * dom/Attr.cpp:
1276         * html/canvas/WebGPURenderingContext.cpp:
1277         * html/parser/HTMLParserIdioms.cpp:
1278         * platform/network/ParsedContentType.cpp:
1279         * platform/network/cocoa/CookieCocoa.mm:
1280         * platform/text/mac/LocaleMac.mm:
1281         * xml/XMLHttpRequest.cpp:
1282         (WebCore::XMLHttpRequest::getAllResponseHeaders):
1283
1284 2017-07-03  Andreas Kling  <akling@apple.com>
1285
1286         Null RenderLayer* deref in FrameView::adjustTiledBackingCoverage()
1287         https://bugs.webkit.org/show_bug.cgi?id=174106
1288         <rdar://problem/33085838>
1289
1290         Reviewed by Tim Horton.
1291
1292         I haven't been able to reproduce this crash locally, but I have seen
1293         video of someone who can, so here's a null check for the RenderView::layer()
1294         which could be null if we're called between RenderView construction
1295         and the first callback to RenderLayerModelObject::styleDidChange().
1296
1297         * page/FrameView.cpp:
1298         (WebCore::FrameView::adjustTiledBackingCoverage):
1299
1300 2017-07-03  Matt Rajca  <mrajca@apple.com>
1301
1302         Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called
1303         https://bugs.webkit.org/show_bug.cgi?id=174103
1304
1305         Reviewed by Alex Christensen.
1306
1307         Test: Added API test.
1308
1309         Added support for updating rate change behavior restrictions on media elements that have already
1310         been created.
1311
1312         * html/HTMLMediaElement.cpp:
1313         (WebCore::HTMLMediaElement::updateRateChangeRestrictions):
1314         * html/HTMLMediaElement.h:
1315         * page/Page.cpp:
1316         (WebCore::Page::updateMediaElementRateChangeRestrictions):
1317         * page/Page.h:
1318
1319 2017-07-03  Matt Lewis  <jlewis3@apple.com>
1320
1321         Unreviewed, rolling out r219103.
1322
1323         Caused multiple build failures.
1324
1325         Reverted changeset:
1326
1327         "Remove copy of ICU headers from WebKit"
1328         https://bugs.webkit.org/show_bug.cgi?id=116407
1329         http://trac.webkit.org/changeset/219103
1330
1331 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
1332
1333         Remove copy of ICU headers from WebKit
1334         https://bugs.webkit.org/show_bug.cgi?id=116407
1335
1336         Reviewed by Alex Christensen.
1337
1338         Use WTF's copy of ICU headers.
1339
1340         No new tests because there is no behavior change.
1341
1342         * Configurations/WebCore.xcconfig:
1343         * icu/unicode/bytestream.h: Removed.
1344         * icu/unicode/localpointer.h: Removed.
1345         * icu/unicode/parseerr.h: Removed.
1346         * icu/unicode/platform.h: Removed.
1347         * icu/unicode/ptypes.h: Removed.
1348         * icu/unicode/putil.h: Removed.
1349         * icu/unicode/rep.h: Removed.
1350         * icu/unicode/std_string.h: Removed.
1351         * icu/unicode/strenum.h: Removed.
1352         * icu/unicode/stringpiece.h: Removed.
1353         * icu/unicode/ubrk.h: Removed.
1354         * icu/unicode/uchar.h: Removed.
1355         * icu/unicode/ucnv.h: Removed.
1356         * icu/unicode/ucnv_err.h: Removed.
1357         * icu/unicode/ucol.h: Removed.
1358         * icu/unicode/uconfig.h: Removed.
1359         * icu/unicode/ucurr.h: Removed.
1360         * icu/unicode/uenum.h: Removed.
1361         * icu/unicode/uiter.h: Removed.
1362         * icu/unicode/uloc.h: Removed.
1363         * icu/unicode/umachine.h: Removed.
1364         * icu/unicode/unistr.h: Removed.
1365         * icu/unicode/unorm.h: Removed.
1366         * icu/unicode/unorm2.h: Removed.
1367         * icu/unicode/uobject.h: Removed.
1368         * icu/unicode/urename.h: Removed.
1369         * icu/unicode/uscript.h: Removed.
1370         * icu/unicode/uset.h: Removed.
1371         * icu/unicode/ustring.h: Removed.
1372         * icu/unicode/utext.h: Removed.
1373         * icu/unicode/utf.h: Removed.
1374         * icu/unicode/utf16.h: Removed.
1375         * icu/unicode/utf8.h: Removed.
1376         * icu/unicode/utf_old.h: Removed.
1377         * icu/unicode/utypes.h: Removed.
1378         * icu/unicode/uvernum.h: Removed.
1379         * icu/unicode/uversion.h: Removed.
1380
1381 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
1382
1383         REGRESSION(Variation Fonts): Specifying Skia by PostScript name does not yield the expected result
1384         https://bugs.webkit.org/show_bug.cgi?id=174079
1385         <rdar://problem/33040854>
1386
1387         Reviewed by Alex Christensen.
1388
1389         Because Skia is a variation font, its PostScript name contains values to apply to its variation
1390         axes. However, WebKit's variation code was overwriting these intrinsive values with ones specified
1391         by CSS. Therefore, the intrinsic ones were being ignored. The solution is just to pass a flag from
1392         the lookup code to the variations code describing if the font was created via a PostScript name,
1393         and to not apply the CSS properties to it if it was.
1394
1395         Test: fast/text/variations/skia-postscript-name.html
1396
1397         * platform/graphics/FontCache.h:
1398         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1399         (WebCore::preparePlatformFont):
1400         (WebCore::platformFontLookupWithFamily):
1401         (WebCore::fontWithFamily):
1402
1403 2017-07-03  Brady Eidson  <beidson@apple.com>
1404
1405         Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism.
1406         https://bugs.webkit.org/show_bug.cgi?id=174073
1407
1408         Reviewed by Andy Estes.
1409
1410         Covered by existing API test.
1411
1412         * loader/DocumentLoader.cpp:
1413         (WebCore::DocumentLoader::startIconLoading):
1414         * loader/EmptyClients.cpp:
1415         * loader/FrameLoaderClient.h:
1416
1417 2017-07-03  Sam Weinig  <sam@webkit.org>
1418
1419         [WebIDL] Remove more unnecessary uses of the preprocessor in idl files
1420         https://bugs.webkit.org/show_bug.cgi?id=174083
1421
1422         Reviewed by Alex Christensen.
1423
1424         Purge as much preprocessor use as possible.
1425
1426         * Configurations/FeatureDefines.xcconfig:
1427         Add ENABLE_NAVIGATOR_STANDALONE.
1428
1429         * animation/Animatable.idl:
1430         Remove unnecessary check for LANGUAGE_OBJECTIVE_C. We no longer generate those bindings.
1431
1432         * html/MediaError.idl:
1433         Use [Conditional] rather than the preprocessor.
1434
1435         * page/Navigator.idl:
1436         Use [Conditional] rather than the preprocessor with the new ENABLE_NAVIGATOR_STANDALONE.
1437
1438         * testing/Internals.cpp:
1439         * testing/Internals.h:
1440         Expose setQuickLookPassword on all platforms, as it doesn't hurt since it is only for testing,
1441         but make the implementation do nothing.
1442
1443         * testing/Internals.idl:
1444         Use [Conditional] rather than the preprocessor.
1445
1446 2017-07-03  Daewoong Jang  <daewoong.jang@navercorp.com>
1447
1448         [Curl] Fix compilation errors
1449         https://bugs.webkit.org/show_bug.cgi?id=174085
1450
1451         Reviewed by Alex Christensen.
1452
1453         * platform/network/curl/CurlContext.cpp:
1454         (WebCore::CurlContext::initCookieSession):
1455         * platform/network/curl/CurlContext.h:
1456
1457 2017-07-03  Youenn Fablet  <youenn@apple.com>
1458
1459         WebAudioSourceProviderAVFObjC should not reconfigure for each data call
1460         https://bugs.webkit.org/show_bug.cgi?id=174101
1461
1462         Reviewed by Eric Carlson.
1463
1464         Covered by manual testing, in particular
1465         https://webrtc.github.io/samples/src/content/peerconnection/webaudio-output/
1466         and https://webrtc.github.io/samples/src/content/getusermedia/volume/.
1467         Also improved LayoutTests web audio peer connection tests to make them more robust.
1468
1469         Before the patch, reconfiguration of the web audio provider was happening for every audioSamplesAvailable call.
1470         It is now happening only when the format of the audio samples is changing.
1471         Changed some member fields from uinque_ptr to optional as a minor improvement.
1472
1473         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
1474         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1475         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
1476         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
1477         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
1478         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
1479
1480 2017-06-30  Alex Christensen  <achristensen@webkit.org>
1481
1482         Stop using dispatch_async in ResourceHandleCFURLConnectionDelegateWithOperationQueue
1483         https://bugs.webkit.org/show_bug.cgi?id=174059
1484
1485         Reviewed by Andy Estes.
1486
1487         Use dispatch_async_f and callOnMainThread instead.
1488         No change in behavior.
1489         This will allow me to use this code on Windows.
1490
1491         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1492         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1493         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1494         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1495         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1496         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1497         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1498         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
1499         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1500         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1501
1502 2017-07-03  Andy Estes  <aestes@apple.com>
1503
1504         [Xcode] Add an experimental setting to build with ccache
1505         https://bugs.webkit.org/show_bug.cgi?id=173875
1506
1507         Reviewed by Tim Horton.
1508
1509         * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
1510
1511 2017-07-02  Ryosuke Niwa  <rniwa@webkit.org>
1512
1513         REGRESSION(r218910): Crash inside textMarkerDataForFirstPositionInTextControl
1514         https://bugs.webkit.org/show_bug.cgi?id=174077
1515         <rdar://problem/33083972>
1516
1517         Reviewed by Chris Fleizach.
1518
1519         The bug was caused by textMarkerDataForFirstPositionInTextControl assuming that
1520         there is always a root editable element (a.k.a. editing host) in the text control.
1521         When the text control is readonly or disabled, this is not the case.
1522
1523         Fixed the bug by adding an early exit when there is no editing host.
1524
1525         Test: accessibility/mac/input-type-change-crash.html
1526
1527         * accessibility/AXObjectCache.cpp:
1528         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
1529
1530 2017-07-03  Devin Rousso  <drousso@apple.com>
1531
1532         Web Inspector: Support listing WebGL2 and WebGPU contexts
1533         https://bugs.webkit.org/show_bug.cgi?id=173396
1534
1535         Reviewed by Joseph Pecoraro.
1536
1537         Tests: inspector/canvas/create-context-2d.html
1538                inspector/canvas/create-context-webgl.html
1539                inspector/canvas/create-context-webgl2.html
1540                inspector/canvas/create-context-webgpu.html
1541
1542         Split "inspector/canvas/create-canvas-contexts.html" into a test for each context type.
1543
1544         * html/HTMLCanvasElement.cpp:
1545         (WebCore::HTMLCanvasElement::getContextWebGPU):
1546         * inspector/InspectorCanvasAgent.cpp:
1547         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
1548
1549 2017-07-03  Alex Christensen  <achristensen@webkit.org>
1550
1551         REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
1552         https://bugs.webkit.org/show_bug.cgi?id=174051
1553
1554         Reviewed by Tim Horton.
1555
1556         In r215096 I added ' to the set of characters to be percent-encoded in queries,
1557         but for interoperability and compatibility we need to do this only for special schemes, like http.
1558
1559         Covered by new API tests.
1560
1561         * platform/URLParser.cpp:
1562         (WebCore::isC0Control):
1563         (WebCore::shouldPercentEncodeQueryByte):
1564         (WebCore::URLParser::utf8QueryEncode):
1565         (WebCore::URLParser::encodeQuery):
1566
1567 2017-07-03  Chris Fleizach  <cfleizach@apple.com>
1568
1569         AX: role="none" (or presentation) does not work on iframes
1570         https://bugs.webkit.org/show_bug.cgi?id=173930
1571         <rdar://problem/33034347>
1572
1573         Reviewed by Ryosuke Niwa.
1574
1575         Support setting a presentational role on an iframe so that the AXWebArea disappears from the hierarchy.
1576         Accomplish this by adding children for attachment and scroll view elements the way other children are added.
1577         That is, only add the non-ignored children directly (which means move the addChild logic into AccessibilityObject.)
1578
1579         Test: accessibility/presentation-role-iframe.html
1580
1581         * accessibility/AccessibilityNodeObject.cpp:
1582         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
1583         (WebCore::AccessibilityNodeObject::insertChild): Deleted.
1584         (WebCore::AccessibilityNodeObject::addChild): Deleted.
1585         * accessibility/AccessibilityNodeObject.h:
1586         * accessibility/AccessibilityObject.cpp:
1587         (WebCore::AccessibilityObject::AccessibilityObject):
1588         (WebCore::AccessibilityObject::insertChild):
1589         (WebCore::AccessibilityObject::addChild):
1590         (WebCore::nodeHasPresentationRole):
1591         * accessibility/AccessibilityObject.h:
1592         (WebCore::AccessibilityObject::addChild): Deleted.
1593         (WebCore::AccessibilityObject::insertChild): Deleted.
1594         * accessibility/AccessibilityRenderObject.cpp:
1595         (WebCore::webAreaIsPresentational):
1596         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1597         (WebCore::AccessibilityRenderObject::addAttachmentChildren):
1598         * accessibility/AccessibilityScrollView.cpp:
1599         (WebCore::AccessibilityScrollView::addChildren):
1600
1601 2017-07-03  Matt Lewis  <jlewis3@apple.com>
1602
1603         Unreviewed, rolling out r219024.
1604
1605         This patch cause 3 didferent test to fail.
1606
1607         Reverted changeset:
1608
1609         "REGRESSION(r215096) Queries of URLs with non-special schemes
1610         should not percent-encode single quotes"
1611         https://bugs.webkit.org/show_bug.cgi?id=174051
1612         http://trac.webkit.org/changeset/219024
1613
1614 2017-07-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1615
1616         Pasting single words copied to UIPasteboard inserts URLs in editable areas
1617         https://bugs.webkit.org/show_bug.cgi?id=174082
1618         <rdar://problem/33046992>
1619
1620         Reviewed by Tim Horton.
1621
1622         Currently, our heuristics for coercing plain text to URLs when reading URLs off of the UIPasteboard allows URLs
1623         to be created as long as -[UIPasteboard valuesForPasteboardType:inItemSet:] returns a non-null NSURL. However,
1624         UIPasteboard automatically coerces any NSString into an NSURL if it initializes an NSURL via +URLWithString:.
1625         Thus, single-word strings such as "hello" that are written to the pasteboard as "public.utf8-plain-text" can
1626         be read back as NSURLs for "public.url". This currently causes bugs in shipping software: e.g. copying and
1627         pasting a single word from an editable input or textarea and pasting into a rich contenteditable area using
1628         WebKit1 inserts a link. However, when combined with another change in WebKit that attempts to read "public.url"
1629         before "public.text" when reading plain text from the pasteboard, this now also affects pasting in plain text
1630         areas, where pasted plain-text strings that are not URLs will paste as URL-encoded strings anyways (for
1631         instance, replacing "[hello]" with "%5Bhello%5D").
1632
1633         To fix this, and existing issues with pasting single words in contenteditables, we make
1634         PlatformPasteboard::readString and PlatformPasteboard::readURL only accept a coerced NSURL as an URL if it also
1635         parses as a valid URL in WebKit (otherwise, we return an empty string).
1636
1637         Tests:
1638             UIPasteboardTests.DoNotPastePlainTextAsURL
1639             UIPasteboardTests.PastePlainTextAsURL
1640             UIPasteboardTests.PasteURLWithPlainTextAsURL
1641
1642         * platform/PlatformPasteboard.h:
1643         * platform/ios/AbstractPasteboard.h:
1644         * platform/ios/PlatformPasteboardIOS.mm:
1645         (WebCore::PlatformPasteboard::allowReadingURLAtIndex):
1646
1647         Allow an URL to be read if either (1) an URL was explicitly specified in the UIPasteboard, or (2) the "proposed"
1648         URL returned from -valuesForPasteboardType: is valid.
1649
1650         (WebCore::PlatformPasteboard::readString):
1651         (WebCore::PlatformPasteboard::readURL):
1652
1653         Consult allowReadingURLAtIndex here (in the case of ::readString, only if the given pasteboard type is
1654         "public.url").
1655
1656         * platform/ios/WebItemProviderPasteboard.h:
1657         * platform/ios/WebItemProviderPasteboard.mm:
1658         (-[WebItemProviderPasteboard itemProviders]):
1659         (-[WebItemProviderPasteboard setItemProviders:]):
1660
1661 2017-07-03  Zan Dobersek  <zdobersek@igalia.com>
1662
1663         [GCrypt] Implement CryptoKeyEC SPKI exports
1664         https://bugs.webkit.org/show_bug.cgi?id=173646
1665
1666         Reviewed by Jiewen Tan.
1667
1668         No new tests -- affected tests are now passing and are unskipped.
1669
1670         Implement libgcrypt-based support for SPKI exports of EC keys.
1671
1672         Initially, the ECParameters structure is created so that it will be later embedded
1673         into the SubjectPublicKeyInfo structure. First the root element of this structure
1674         is written into, specifying namedCurve as the chosen member (even if other choices
1675         are not really available). We then write out the object identifier into this
1676         namedCurve member that properly represents this key's curve type.
1677
1678         The SubjectPublicKeyInfo structure is created next. We write out id-ecPublicKey
1679         identifier as the chosen algorithm identifier. Web Crypto specification demands
1680         that the id-ecDH identifier is used in case of ECDH keys, but no existing test in
1681         the W3C test suite expects this, so this should be revisited later. Data of the
1682         previously-constructed ECParameters structure is written out into the
1683         AlgorithmIdentifier's parameters member.
1684
1685         The `q` MPI data is then retrieved. Its size is validated, as well as the first
1686         byte of data in order to ensure the MPI represents an uncompressed EC point.
1687         The data is then written into the subjectPublicKey member.
1688
1689         Finally the encoded SubjectPublicKeyInfo structure data is extracted and returned
1690         from the platformExportSpki() function, completion the export operation.
1691
1692         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1693         (WebCore::curveIdentifier):
1694         (WebCore::CryptoKeyEC::platformExportSpki):
1695
1696 2017-07-02  Sam Weinig  <sam@webkit.org>
1697
1698         [WebIDL] Remove special casing for RegExp which is no longer required by the spec
1699         https://bugs.webkit.org/show_bug.cgi?id=174025
1700
1701         Reviewed by Chris Dumez.
1702
1703         * bindings/scripts/CodeGeneratorJS.pm:
1704         (GenerateDictionaryImplementationContent):
1705         (GenerateOverloadDispatcher):
1706         Remove special casing.
1707
1708         * bindings/scripts/IDLParser.pm:
1709         (parseNonAnyType):
1710         Remove parsing of RegExp.
1711
1712         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1713         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1714         * bindings/scripts/test/JS/JSTestObj.cpp:
1715         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1716         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1717         Update test results.
1718
1719 2017-07-02  Youenn Fablet  <youenn@apple.com>
1720
1721         RealtimeOutgoingVideoSource should pass frame timestamp
1722         https://bugs.webkit.org/show_bug.cgi?id=174055
1723
1724         Reviewed by Eric Carlson.
1725
1726         Covered by manual testing since this only affects video encoding quality.
1727
1728         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1729         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
1730
1731 2017-07-01  Dan Bernstein  <mitz@apple.com>
1732
1733         <rdar://problem/33096441> r219055 broke non-iOS builds.
1734
1735         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1736         (WebCore::lookupFallbackFont):
1737
1738 2017-07-01  Dan Bernstein  <mitz@apple.com>
1739
1740         [iOS] Remove code only needed when building for iOS 9.x
1741         https://bugs.webkit.org/show_bug.cgi?id=174068
1742
1743         Reviewed by Tim Horton.
1744
1745         * Configurations/FeatureDefines.xcconfig:
1746         * editing/cocoa/DataDetection.mm:
1747         (WebCore::DataDetection::isDataDetectorLink):
1748         (WebCore::DataDetection::shouldCancelDefaultAction):
1749         (WebCore::constructURLStringForResult):
1750         (WebCore::DataDetection::detectContentInRange):
1751         * page/cocoa/ResourceUsageThreadCocoa.mm:
1752         (WebCore::vmPageSize):
1753         * platform/cocoa/DataDetectorsCoreSoftLink.h:
1754         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
1755         * platform/graphics/FontPlatformData.cpp:
1756         * platform/graphics/FontPlatformData.h:
1757         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1758         (layerContentsFormat):
1759         (PlatformCALayerCocoa::updateContentsFormat):
1760         (PlatformCALayerCocoa::backingStoreBytesPerPixel):
1761         * platform/graphics/cg/GraphicsContextCG.cpp:
1762         (WebCore::extendedSRGBColorSpaceRef):
1763         * platform/graphics/cg/PDFDocumentImage.cpp:
1764         (WebCore::PDFDocumentImage::drawPDFPage):
1765         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1766         (WebCore::lookupFallbackFont):
1767         * platform/graphics/cocoa/FontCocoa.mm:
1768         (WebCore::Font::variantCapsSupportsCharacterForSynthesis):
1769         (WebCore::Font::platformWidthForGlyph):
1770         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1771         (WebCore::FontPlatformData::FontPlatformData):
1772         (WebCore::FontPlatformData::ctFont):
1773         * platform/graphics/cocoa/IOSurface.mm:
1774         (WebCore::IOSurface::sinkIntoImage):
1775         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1776         (WebCore::WebCoreDecompressionSession::setTimebase):
1777         * platform/graphics/ios/FontCacheIOS.mm:
1778         (WebCore::systemFontModificationAttributes):
1779         (WebCore::systemFontDescriptor):
1780         * platform/graphics/mac/FontCustomPlatformData.cpp:
1781         (WebCore::FontCustomPlatformData::supportsFormat):
1782         * platform/ios/LegacyTileGridTile.mm:
1783         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
1784         * platform/ios/PlatformScreenIOS.mm:
1785         (WebCore::screenSupportsExtendedColor):
1786         * platform/ios/RemoteCommandListenerIOS.mm:
1787         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
1788         (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS):
1789         (WebCore::RemoteCommandListenerIOS::updateSupportedCommands):
1790         * platform/spi/cf/CFNetworkSPI.h:
1791         * platform/spi/cg/CoreGraphicsSPI.h:
1792         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
1793         * platform/spi/cocoa/QuartzCoreSPI.h:
1794         * platform/spi/mac/AVFoundationSPI.h:
1795
1796 2017-07-01  Myles C. Maxfield  <mmaxfield@apple.com>
1797
1798         REGRESSION(r218371): Reeder's default font is Times instead of San Francisco
1799         https://bugs.webkit.org/show_bug.cgi?id=173617
1800         <rdar://problem/32969819>
1801
1802         Reviewed by Simon Fraser.
1803
1804         On systems where USE_PLATFORM_SYSTEM_FALLBACK_LIST is set to true, the code in
1805         platformFontWithFamilySpecialCase() is still used when @font-face blocks specify
1806         src:local(system-ui), which made the assertion erroneously fire.
1807
1808         Unfortunately, our architecture is such that an @font-face block represents a
1809         single entry in the font-family fallback list, which means it would be quite
1810         difficult to make local(system-ui) in an @font-face block expand at the level
1811         of the font cascade. So, this patch simply reverts to the previous behavior for
1812         local(system-ui) (which doesn't include the entire Core Text cascade list).
1813         This means that "font-family: system-ui" and "src: local(system-ui)" have
1814         different behavior, which is undesirable, but architecturally difficult to
1815         solve. I've added some FIXMEs to the code in the relevant places and filed
1816         https://bugs.webkit.org/show_bug.cgi?id=174023.
1817
1818         Test: fast/text/font-face-local-system.html
1819
1820         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1821         (WebCore::FontCascadeDescription::effectiveFamilyAt):
1822         * platform/graphics/ios/FontCacheIOS.mm:
1823         (WebCore::systemFontDescriptor):
1824         (WebCore::platformFontWithFamilySpecialCase):
1825         * platform/graphics/mac/FontCacheMac.mm:
1826         (WebCore::platformFontWithFamilySpecialCase):
1827
1828 2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>
1829
1830         Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
1831         https://bugs.webkit.org/show_bug.cgi?id=174004
1832
1833         Reviewed by Simon Fraser.
1834
1835         Made FrameLoader and NavigationScheduler UniqueRef in Frame so that we can forward declare them,
1836         and forward declared IntPoint and IntRect to avoid including FrameLoader.h, IntRect.h,
1837         and NavigationScheduler.h in Frame.h
1838
1839         * Modules/mediastream/MediaStream.cpp:
1840         * Modules/webaudio/AudioContext.cpp:
1841         * Modules/websockets/WebSocket.cpp:
1842         (WebCore::WebSocket::connect): Avoid calling loader().mixedContentChecker().canRunInsecureContent(~)
1843         on a nullptr even though this used to work because we weren't de-referencing it.
1844         * bindings/js/ScriptController.cpp:
1845         * dom/Document.cpp:
1846         * dom/EventDispatcher.cpp:
1847         * editing/Editor.cpp:
1848         * editing/cocoa/EditorCocoa.mm:
1849         * editing/ios/EditorIOS.mm:
1850         * editing/mac/EditorMac.mm:
1851         * history/CachedPage.cpp:
1852         * html/HTMLObjectElement.cpp:
1853         * html/parser/HTMLDocumentParser.cpp:
1854         (WebCore::DocumentLoader::~DocumentLoader): Check !isLoading() before accessing frameLoader to avoid
1855         accessing m_frame->loader() inside ~FrameLoader.
1856         * html/parser/XSSAuditor.cpp:
1857         * html/parser/XSSAuditorDelegate.cpp:
1858         * inspector/InspectorInstrumentation.h:
1859         * loader/CrossOriginPreflightChecker.cpp:
1860         * loader/FrameLoader.cpp:
1861         (WebCore::FrameLoader::setOpener): Avoid accessing this FrameLoader via m_opener->loader() when it's
1862         this FrameLoader inside ~FrameLoader since UniqueRef<FrameLoader> is clears itself before calling
1863         the destructor of FrameLoader.
1864         * loader/ImageLoader.cpp:
1865         * loader/LinkLoader.cpp:
1866         * loader/SubframeLoader.cpp:
1867         * loader/appcache/ApplicationCacheGroup.cpp:
1868         * loader/appcache/DOMApplicationCache.cpp:
1869         * mathml/MathMLElement.cpp:
1870         * page/DOMWindow.cpp:
1871         * page/Frame.cpp:
1872         (WebCore::Frame::Frame):
1873         (WebCore::Frame::init): Moved here from Frame.h
1874         (WebCore::Frame::setDocument):
1875         * page/Frame.h:
1876         (WebCore::Frame::loader):
1877         (WebCore::Frame::navigationScheduler):
1878         * page/History.cpp:
1879         * page/Location.cpp:
1880         * page/PerformanceLogging.cpp:
1881         * page/PerformanceNavigation.cpp:
1882         * page/UserContentProvider.cpp:
1883         * page/ios/FrameIOS.mm:
1884         (WebCore::Frame::initWithSimpleHTMLDocument):
1885         * plugins/PluginInfoProvider.cpp:
1886         * replay/ReplayInputCreationMethods.cpp:
1887         * replay/UserInputBridge.cpp:
1888         * xml/XSLTProcessorLibxslt.cpp:
1889         * xml/parser/XMLDocumentParserLibxml2.cpp:
1890
1891 2017-07-01  Dan Bernstein  <mitz@apple.com>
1892
1893         [macOS] Remove code only needed when building for OS X Yosemite
1894         https://bugs.webkit.org/show_bug.cgi?id=174067
1895
1896         Reviewed by Tim Horton.
1897
1898         * Configurations/Base.xcconfig:
1899         * Configurations/DebugRelease.xcconfig:
1900         * Configurations/FeatureDefines.xcconfig:
1901         * Configurations/Version.xcconfig:
1902         * accessibility/AXObjectCache.cpp:
1903         (WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):
1904         * html/HTMLCanvasElement.cpp:
1905         * page/WheelEventDeltaFilter.cpp:
1906         (WebCore::WheelEventDeltaFilter::create):
1907         * page/mac/WheelEventDeltaFilterMac.h:
1908         * page/mac/WheelEventDeltaFilterMac.mm:
1909         * page/scrolling/ScrollingMomentumCalculator.cpp:
1910         * page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
1911         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
1912         * platform/cocoa/NetworkExtensionContentFilter.mm:
1913         (replacementDataFromDecisionInfo):
1914         (WebCore::NetworkExtensionContentFilter::initialize):
1915         (WebCore::NetworkExtensionContentFilter::willSendRequest):
1916         (WebCore::NetworkExtensionContentFilter::responseReceived):
1917         (WebCore::NetworkExtensionContentFilter::addData):
1918         (WebCore::NetworkExtensionContentFilter::finishedAddingData):
1919         (WebCore::NetworkExtensionContentFilter::unblockHandler):
1920         * platform/graphics/ComplexTextController.h:
1921         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
1922         (PlatformCAAnimationCocoa::setTimingFunction):
1923         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1924         (WebCore::FontCache::platformAlternateFamilyName):
1925         * platform/graphics/cocoa/FontCocoa.mm:
1926         (WebCore::Font::platformInit):
1927         * platform/graphics/cocoa/IOSurface.mm:
1928         (WebCore::IOSurface::sinkIntoImage):
1929         * platform/graphics/cocoa/WebGPULayer.mm:
1930         (-[WebGPULayer initWithGPUDevice:]):
1931         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1932         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
1933         * platform/graphics/mac/WebGLLayer.mm:
1934         (-[WebGLLayer initWithGraphicsContext3D:]):
1935         * platform/mac/BlacklistUpdater.mm:
1936         * platform/mac/PlatformScreenMac.mm:
1937         (WebCore::screenSupportsExtendedColor):
1938         * platform/mac/ValidationBubbleMac.mm:
1939         (WebCore::ValidationBubble::ValidationBubble):
1940         * platform/mac/WebGLBlacklist.mm:
1941         (WebCore::WebGLBlacklist::create):
1942         * platform/network/cocoa/WebCoreNSURLSession.h:
1943         * platform/network/cocoa/WebCoreNSURLSession.mm:
1944         * platform/network/mac/CertificateInfoMac.mm:
1945         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
1946         * platform/network/mac/CookieJarMac.mm:
1947         (WebCore::setCookiesFromDOM):
1948         * platform/spi/cf/CFNetworkSPI.h:
1949         * platform/spi/cg/CoreGraphicsSPI.h:
1950         * platform/spi/cocoa/NEFilterSourceSPI.h:
1951         * platform/spi/cocoa/NSURLConnectionSPI.h:
1952         * platform/spi/cocoa/QuartzCoreSPI.h:
1953         * platform/spi/mac/NSScrollingInputFilterSPI.h:
1954         * platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
1955         * platform/spi/mac/TUCallSPI.h:
1956         * rendering/RenderThemeMac.mm:
1957         (WebCore::RenderThemeMac::levelIndicatorFor):
1958         * svg/SVGToOTFFontConversion.cpp:
1959         (WebCore::SVGToOTFFontConverter::appendKERNTable):
1960         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1961
1962 2017-06-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1963
1964         If an image appears more than once on a page, decoding for painting one instance repaints them all
1965         https://bugs.webkit.org/show_bug.cgi?id=169944
1966
1967         Reviewed by Simon Fraser.
1968
1969         Make the Image::draw*() and GraphicsContext::draw*() functions return an
1970         ImageDrawResult which indicates whether the image is drawn or has requested
1971         an asynchronous image decoding.
1972
1973         If the image requested an asynchronous image decoding, the issuer of the
1974         Image::draw(), which is of type CachedImageClient, will add itself to a
1975         set of m_pendingImageDrawingClients, which owned by CachedImage.
1976
1977         When receiving the imageFrameAvailable() notification for a lrage image 
1978         from the decoding thread, CachedImage will loop through the clients that
1979         are only in m_pendingImageDrawingClients to ask them to repaint their
1980         rectangles.
1981
1982         Test: fast/images/async-image-multiple-clients-repaint.html
1983
1984         * loader/cache/CachedImage.cpp:
1985         (WebCore::CachedImage::didRemoveClient):
1986         (WebCore::CachedImage::addPendingImageDrawingClient):
1987         (WebCore::CachedImage::allClientsRemoved):
1988         (WebCore::CachedImage::clear):
1989         (WebCore::CachedImage::imageFrameAvailable):
1990         * loader/cache/CachedImage.h:
1991         * platform/graphics/BitmapImage.cpp:
1992         (WebCore::BitmapImage::draw):
1993         * platform/graphics/BitmapImage.h:
1994         * platform/graphics/CrossfadeGeneratedImage.cpp:
1995         (WebCore::CrossfadeGeneratedImage::draw):
1996         * platform/graphics/CrossfadeGeneratedImage.h:
1997         * platform/graphics/GeneratedImage.h:
1998         * platform/graphics/GradientImage.cpp:
1999         (WebCore::GradientImage::draw):
2000         * platform/graphics/GradientImage.h:
2001         * platform/graphics/GraphicsContext.cpp:
2002         (WebCore::GraphicsContext::drawImage):
2003         (WebCore::GraphicsContext::drawTiledImage):
2004         * platform/graphics/GraphicsContext.h:
2005         * platform/graphics/Image.cpp:
2006         (WebCore::Image::drawTiled):
2007         * platform/graphics/Image.h:
2008         * platform/graphics/ImageTypes.h:
2009         * platform/graphics/NamedImageGeneratedImage.cpp:
2010         (WebCore::NamedImageGeneratedImage::draw):
2011         * platform/graphics/NamedImageGeneratedImage.h:
2012         * platform/graphics/cg/PDFDocumentImage.cpp:
2013         (WebCore::PDFDocumentImage::draw):
2014         * platform/graphics/cg/PDFDocumentImage.h:
2015         * rendering/RenderBoxModelObject.cpp:
2016         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2017         * rendering/RenderImage.cpp:
2018         (WebCore::RenderImage::paintIntoRect):
2019         * svg/graphics/SVGImage.cpp:
2020         (WebCore::SVGImage::drawForContainer):
2021         (WebCore::SVGImage::draw):
2022         * svg/graphics/SVGImage.h:
2023         * svg/graphics/SVGImageForContainer.cpp:
2024         (WebCore::SVGImageForContainer::draw):
2025         * svg/graphics/SVGImageForContainer.h:
2026
2027 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
2028
2029         REGRESSION(r214194): Safari leaves a popup window open opened during before unload
2030         https://bugs.webkit.org/show_bug.cgi?id=174016
2031
2032         Reviewed by Chris Dumez.
2033
2034         Address Dan's review comments.
2035
2036         * loader/NavigationDisabler.h:
2037         (WebCore::NavigationDisabler::NavigationDisabler):
2038         (WebCore::NavigationDisabler::~NavigationDisabler):
2039
2040 2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2041
2042         [iOS DnD] Text indicators for dragged links should always be legible if the link is legible
2043         https://bugs.webkit.org/show_bug.cgi?id=173860
2044         <rdar://problem/32974385>
2045
2046         Reviewed by Tim Horton.
2047
2048         Currently, TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges ensures that links backed by a
2049         RenderReplaced element don't render blank text indicators by additionally forcing the
2050         TextIndicatorOptionPaintAllContent option in order to capture the RenderReplaced content. If estimated
2051         background color is requested, this patch adds an additional path for "upgrading" the text indicator to paint
2052         all content: if the text color is not legible against the estimated background color, then it is likely that the
2053         background color estimate failed or the link itself was not legible in the first place; in the former case, to
2054         ensure that the link is still legible, we upgrade the given TextIndicatorOptions to paint all contents in the
2055         range.
2056
2057         There is currently no way to test this, and also no simple way to introduce infrastructure to test text
2058         indicators.
2059
2060         * page/TextIndicator.cpp:
2061         (WebCore::estimatedTextColorsForRange):
2062
2063         Estimates all text colors that appear in a range by iterating over the text node renderers and consulting their
2064         render styles.
2065
2066         (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
2067
2068         If foreground text color is deemed not legible, force TextIndicatorOptionPaintAllContent instead of
2069         TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges.
2070
2071         (WebCore::initializeIndicator):
2072         * rendering/TextPaintStyle.cpp:
2073         (WebCore::textColorIsLegibleAgainstBackgroundColor):
2074         (WebCore::adjustColorForVisibilityOnBackground):
2075
2076         Allow other parts of WebCore to check the legibility of text against a background color.
2077
2078         * rendering/TextPaintStyle.h:
2079
2080 2017-06-30  Alex Christensen  <achristensen@webkit.org>
2081
2082         REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
2083         https://bugs.webkit.org/show_bug.cgi?id=174051
2084         <rdar://problem/33002846>
2085
2086         Reviewed by Tim Horton.
2087
2088         In r215096 I added ' to the set of characters to be percent-encoded in queries,
2089         but for interoperability and compatibility we need to do this only for special schemes, like http.
2090
2091         Covered by new API tests.
2092
2093         * platform/URLParser.cpp:
2094         (WebCore::isC0Control):
2095         (WebCore::shouldPercentEncodeQueryByte):
2096         (WebCore::URLParser::utf8QueryEncode):
2097         (WebCore::URLParser::encodeQuery):
2098
2099 2017-06-30  Daniel Bates  <dabates@apple.com>
2100
2101         Attempt to fix the build following <https://trac.webkit.org/changeset/219019>
2102         (https://bugs.webkit.org/show_bug.cgi?id=165160)
2103
2104         Export the FrameLoadRequest move constructor and move operator so that they
2105         can be used from WebKit.
2106
2107         * loader/FrameLoadRequest.h:
2108
2109 2017-06-30  Don Olmstead  <don.olmstead@sony.com>
2110
2111         [WebCore] Update AXObjectCache for !HAVE(ACCESSIBILITY)
2112         https://bugs.webkit.org/show_bug.cgi?id=174045
2113
2114         Reviewed by Konstantin Tokarev.
2115
2116         No new tests. No change in behavior.
2117
2118         * accessibility/AXObjectCache.h:
2119         (WebCore::AXObjectCache::checkedStateChanged):
2120         (WebCore::AXObjectCache::childrenChanged):
2121         (WebCore::AXObjectCache::deferRecomputeIsIgnored):
2122         (WebCore::AXObjectCache::deferTextChangedIfNeeded):
2123         (WebCore::AXObjectCache::focusAriaModalNodeTimerFired):
2124         (WebCore::AXObjectCache::handleAriaExpandedChange):
2125         (WebCore::AXObjectCache::handleAriaRoleChanged):
2126         (WebCore::AXObjectCache::handleAttributeChanged):
2127         (WebCore::AXObjectCache::handleScrollbarUpdate):
2128         (WebCore::AXObjectCache::liveRegionChangedNotificationPostTimerFired):
2129         (WebCore::AXObjectCache::notificationPostTimerFired):
2130         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
2131         (WebCore::AXObjectCache::performDeferredCacheUpdate):
2132         (WebCore::AXObjectCache::postNotification):
2133         (WebCore::AXObjectCache::postPlatformNotification):
2134         (WebCore::AXObjectCache::postTextReplacementNotification):
2135         (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl):
2136         (WebCore::AXObjectCache::postTextStateChangeNotification):
2137         (WebCore::AXObjectCache::recomputeIsIgnored):
2138         (WebCore::AXObjectCache::textChanged):
2139         (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached):
2140         (WebCore::AXObjectCache::focusAriaModalNode): Deleted.
2141
2142 2017-06-30  Daniel Bates  <dabates@apple.com>
2143
2144         Attempt to fix the Apple Windows build following <https://trac.webkit.org/changeset/219013>
2145         (https://bugs.webkit.org/show_bug.cgi?id=165160)
2146
2147         Make FrameLoadRequest move constructor and move operator out-of-line so that callers
2148         do not need to include header SecurityOrigin.h.
2149
2150         * loader/FrameLoadRequest.cpp:
2151         * loader/FrameLoadRequest.h:
2152
2153 2017-06-30  Alex Christensen  <achristensen@webkit.org>
2154
2155         Stop soft linking with CFNetwork
2156         https://bugs.webkit.org/show_bug.cgi?id=174029
2157
2158         Reviewed by Jer Noble.
2159
2160         We link directly with CFNetwork.  There's no reason to soft link, 
2161         and it is causing a problem with linking when doing interesting things with CFNetwork.
2162
2163         * platform/spi/cf/CFNetworkSPI.h:
2164
2165 2017-06-30  Daniel Bates  <dabates@apple.com>
2166
2167         API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo
2168         https://bugs.webkit.org/show_bug.cgi?id=165160
2169         <rdar://problem/29451999>
2170
2171         Reviewed by Brady Eidson.
2172
2173         Pass the document that is requesting the load to the loader.
2174
2175         * inspector/InspectorFrontendClientLocal.cpp:
2176         (WebCore::InspectorFrontendClientLocal::openInNewTab): Pass the document when instantiating the FrameLoadRequest.
2177         Also use C++11 brace initialization to instantiate ResourceRequest.
2178         * inspector/InspectorPageAgent.cpp:
2179         (WebCore::InspectorPageAgent::navigate): Pass the document when instantiating the FrameLoadRequest.
2180         * loader/FrameLoadRequest.cpp:
2181         (WebCore::FrameLoadRequest::FrameLoadRequest): Moved from FrameLoadRequest.h.
2182         (WebCore::FrameLoadRequest::requester): Added.
2183         (WebCore::FrameLoadRequest::requesterSecurityOrigin): Added.
2184         * loader/FrameLoadRequest.h:
2185         (WebCore::FrameLoadRequest::FrameLoadRequest): Marked as WEBCORE_EXPORT and modified to take
2186         the document that requested the load.
2187         (WebCore::FrameLoadRequest::requester): Deleted; made out-of-line/moved to FrameLoadRequest.cpp.
2188         * loader/FrameLoader.cpp:
2189         (WebCore::FrameLoader::urlSelected): Pass the document when instantiating the FrameLoadRequest. Also use C++11
2190         brace initialization to instantiate ResourceRequest.
2191         (WebCore::FrameLoader::loadURLIntoChildFrame): Pass the document when instantiating the FrameLoadRequest.
2192         (WebCore::FrameLoader::loadFrameRequest): Substitute FrameLoadRequest::requesterSecurityOrigin() for
2193         FrameLoadRequest::requester() as the former replaces the latter.
2194         (WebCore::FrameLoader::loadURL): Pass the document when instantiating the NavigationAction.
2195         (WebCore::FrameLoader::load): Ditto.
2196         (WebCore::FrameLoader::loadWithDocumentLoader): Pass the document when instantiating the NavigationAction.
2197         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
2198         (WebCore::FrameLoader::reload): Ditto.
2199         (WebCore::FrameLoader::loadPostRequest): Ditto.
2200         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Pass the document when instantiating the NavigationAction.
2201         (WebCore::FrameLoader::loadDifferentDocumentItem): Pass the document when instantiating the NavigationAction.
2202         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
2203         (WebCore::createWindow): Pass the document when instantiating the NavigationAction.
2204         * loader/NavigationAction.cpp:
2205         (WebCore::NavigationAction::NavigationAction): Modified to take the source document.
2206         * loader/NavigationAction.h:
2207         (WebCore::NavigationAction::isEmpty): Consider a NavigationAction empty if does not have a source document
2208         or the associated ResourceRequest has an empty URL.
2209         (WebCore::NavigationAction::sourceDocument): Added.
2210         (WebCore::NavigationAction::NavigationAction): Deleted; made out-of-line/moved to NavigationAction.cpp to
2211         avoid the need to include the header Document.h.
2212         * loader/NavigationScheduler.cpp:
2213         (WebCore::ScheduledURLNavigation::ScheduledURLNavigation): Store the document that scheduled the navigation.
2214         Also use C++11 brace initialization to instantiate in the member initialization list.
2215         (WebCore::ScheduledURLNavigation::initiatingDocument): Added. Retrieves the document that scheduled the navigation.
2216         (WebCore::NavigationScheduler::scheduleLocationChange): Pass the document when instantiating the FrameLoadRequest.
2217         * loader/PolicyChecker.cpp:
2218         (WebCore::PolicyChecker::checkNavigationPolicy): Pass the document when instantiating the NavigationAction.
2219         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
2220         * page/ContextMenuController.cpp:
2221         (WebCore::openNewWindow):
2222         (WebCore::ContextMenuController::contextMenuItemSelected): Pass the document when instantiating the FrameLoadRequest.
2223         Also use C++11 brace initialization syntax to instantiate the FrameLoadRequest.
2224         * page/DOMWindow.cpp:
2225         (WebCore::DOMWindow::createWindow): Pass the document when instantiating the FrameLoadRequest.
2226
2227 2017-06-29  Jer Noble  <jer.noble@apple.com>
2228
2229         Make Legacy EME API controlled by RuntimeEnabled setting.
2230         https://bugs.webkit.org/show_bug.cgi?id=173994
2231
2232         Reviewed by Sam Weinig.
2233
2234         Add a new RuntimeEnabledFeatures setting to control the availability of the WebKit prefixed EME APIs.
2235
2236         * Configurations/FeatureDefines.xcconfig:
2237         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
2238         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
2239         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl:
2240         * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
2241         * dom/Element.idl:
2242         * html/HTMLMediaElement.cpp:
2243         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
2244         (WebCore::HTMLMediaElement::webkitSetMediaKeys):
2245         (WebCore::HTMLMediaElement::keyAdded):
2246         * html/HTMLMediaElement.idl:
2247         * html/WebKitMediaKeyError.idl:
2248         * page/RuntimeEnabledFeatures.h:
2249         (WebCore::RuntimeEnabledFeatures::setLegacyEncryptedMediaAPIEnabled):
2250         (WebCore::RuntimeEnabledFeatures::legacyEncryptedMediaAPIEnabled):
2251
2252 2017-06-30  Chris Dumez  <cdumez@apple.com>
2253
2254         Move ResourceLoadStatisticsStore to WebKit2/UIProcess
2255         https://bugs.webkit.org/show_bug.cgi?id=174033
2256
2257         Reviewed by Brent Fulgham.
2258
2259         Move ResourceLoadStatisticsStore to WebKit2/UIProcess since it is only
2260         used in the WebKit2 UIProcess.
2261
2262         * CMakeLists.txt:
2263         * WebCore.xcodeproj/project.pbxproj:
2264         * loader/ResourceLoadObserver.cpp:
2265         (WebCore::primaryDomain):
2266         * loader/ResourceLoadStatistics.cpp:
2267         (WebCore::ResourceLoadStatistics::primaryDomain):
2268         * loader/ResourceLoadStatistics.h:
2269
2270 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
2271
2272         Ran sort-Xcode-project-file.
2273
2274         * WebCore.xcodeproj/project.pbxproj:
2275
2276 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
2277
2278         REGRESSION(r214194): Safari leaves a popup window open opened during before unload
2279         https://bugs.webkit.org/show_bug.cgi?id=174016
2280
2281         Reviewed by Chris Dumez.
2282
2283         The bug was caused by WebKit allowing the opening of a new window via window.open but disallowing
2284         the initial navigation within the newly opened window while a beforeunload event is being dispatched.
2285
2286         Because some websites which opens a window during a beforeunload event relies on the opened page
2287         to communicate back in order to close it. This resulted in a newly opened popup window with about:blank
2288         being left out on those websites.
2289
2290         Fixed the bug by allowing the navigation of a new window as well as an existing another window.
2291         More concretely, we disallow navigations within the same frame tree as the one in which a beforeunload
2292         event is being dispatched, and allow navigations elsewhere (i.e. different window / page).
2293         During the destruction of a frame-less document, disallow all the navigations.
2294
2295         Tests: fast/events/before-unload-navigate-different-window.html
2296                fast/events/before-unload-open-window.html
2297                fast/events/before-unload-sibling-frame.html
2298
2299         * WebCore.xcodeproj/project.pbxproj:
2300         * dom/Document.cpp:
2301         (WebCore::Document::prepareForDestruction):
2302         * loader/FrameLoader.cpp:
2303         (WebCore::FrameLoader::isNavigationAllowed):
2304         (WebCore::FrameLoader::shouldClose):
2305         * loader/NavigationDisabler.h: Added. Extracted from NavigationScheduler.h
2306         (WebCore::NavigationDisabler::NavigationDisabler): Increment the newly added counter on MainFrame unless
2307         the frame is null (during the destruction of a frameless document) in which case we increment the global
2308         disable count.
2309         (WebCore::NavigationDisabler::~NavigationDisabler): Ditto for decrementation.
2310         (WebCore::NavigationDisabler::isNavigationAllowed): Only allow the navigation when there is no frameless
2311         document in destruction, and none of the frame in the same frame tree as the one given is currently in
2312         the process of dispatching a beforeunload event.
2313         * loader/NavigationScheduler.cpp:
2314         (WebCore::NavigationScheduler::shouldScheduleNavigation):
2315         * loader/NavigationScheduler.h:
2316         (WebCore::NavigationDisabler): Moved to NavigationDisabler.h.
2317         * page/MainFrame.h:
2318         (WebCore::MainFrame): Added s_globalNavigationDisableCount.
2319
2320 2017-06-30  Sam Weinig  <sam@webkit.org>
2321
2322         [WebIDL] Add support for conditionally read-write attributes
2323         https://bugs.webkit.org/show_bug.cgi?id=173993
2324
2325         Reviewed by Alex Christensen.
2326
2327         The MEDIA_SOURCE feature/conditional requires changing a few readonly
2328         attributes into read-write attributes. In the past we handled this with
2329         custom bindings. This patch adds a new extended attribute, ConditionallyReadWrite
2330         which achieves the same result.
2331
2332         * WebCore.xcodeproj/project.pbxproj:
2333         Move a few custom binding to the "GC / Wrapping Only" group.
2334
2335         * bindings/js/JSAudioTrackCustom.cpp:
2336         (WebCore::JSAudioTrack::setKind): Deleted.
2337         (WebCore::JSAudioTrack::setLanguage): Deleted.
2338         * bindings/js/JSTextTrackCustom.cpp:
2339         (WebCore::JSTextTrack::setLanguage): Deleted.
2340         * bindings/js/JSVideoTrackCustom.cpp:
2341         (WebCore::JSVideoTrack::setKind): Deleted.
2342         (WebCore::JSVideoTrack::setLanguage): Deleted.
2343         Remove no longer needed custom bindings.
2344
2345         * bindings/scripts/CodeGeneratorJS.pm:
2346         (GeneratePropertiesHashTable):
2347         (GenerateImplementation):
2348         (GenerateAttributeSetterDefinition):
2349         (GenerateCallbackImplementationContent):
2350         (GenerateHashTableValueArray):
2351         (GenerateHashTable):
2352         Pipe ConditionallyReadWrite through the generator.
2353
2354         * bindings/scripts/IDLAttributes.json:
2355         Add ConditionallyReadWrite.
2356
2357         * bindings/scripts/test/JS/JSTestObj.cpp:
2358         * bindings/scripts/test/TestObj.idl:
2359         Add tests for ConditionallyReadWrite.
2360
2361         * html/track/AudioTrack.idl:
2362         * html/track/TextTrack.idl:
2363         * html/track/VideoTrack.idl:
2364         Replace [Custom] with [ConditionallyReadWrite].
2365
2366 2017-06-30  Chris Dumez  <cdumez@apple.com>
2367
2368         ResourceLoadObserver does not need a ResourceLoadStatisticsStore
2369         https://bugs.webkit.org/show_bug.cgi?id=174013
2370
2371         Reviewed by Brent Fulgham.
2372
2373         ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs.
2374         ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess in a follow-up.
2375
2376         * Modules/websockets/WebSocket.cpp:
2377         (WebCore::WebSocket::connect):
2378         * dom/UserGestureIndicator.cpp:
2379         (WebCore::UserGestureIndicator::UserGestureIndicator):
2380         * loader/DocumentLoader.cpp:
2381         (WebCore::DocumentLoader::willSendRequest):
2382         * loader/FrameLoader.cpp:
2383         (WebCore::FrameLoader::loadResourceSynchronously):
2384         * loader/ResourceLoadObserver.cpp:
2385         (WebCore::ResourceLoadObserver::shared):
2386         (WebCore::ResourceLoadObserver::setNotificationCallback):
2387         (WebCore::ResourceLoadObserver::shouldLog):
2388         (WebCore::ResourceLoadObserver::logFrameNavigation):
2389         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2390         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2391         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2392         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain):
2393         (WebCore::ResourceLoadObserver::takeResourceStatisticsForPrimaryDomain):
2394         (WebCore::ResourceLoadObserver::isPrevalentResource):
2395         (WebCore::ResourceLoadObserver::statisticsForOrigin):
2396         (WebCore::ResourceLoadObserver::takeStatistics):
2397         * loader/ResourceLoadObserver.h:
2398         * loader/ResourceLoadStatisticsStore.cpp:
2399         * loader/ResourceLoadStatisticsStore.h:
2400         * loader/SubresourceLoader.cpp:
2401         (WebCore::SubresourceLoader::willSendRequestInternal):
2402         * testing/Internals.cpp:
2403         (WebCore::Internals::resourceLoadStatisticsForOrigin):
2404
2405 2017-06-30  Fujii Hironori  <Hironori.Fujii@sony.com>
2406
2407         ASSERTION FAILED: !canAnimate() && !m_currentFrame
2408         https://bugs.webkit.org/show_bug.cgi?id=173089
2409
2410         Reviewed by Said Abou-Hallawa.
2411
2412         WebCore::BitmapImage::draw() has an assertion which ensures
2413         m_currentFrame is zero in case of async decoding. But, this
2414         assertion failed if an GIF animation image which have finished its
2415         animation was repainted. In that time, m_currentFrame was the last
2416         frame index of the image.
2417
2418         Test: fast/images/animated-gif-paint-after-animation.html
2419
2420         * platform/graphics/BitmapImage.cpp:
2421         (WebCore::BitmapImage::draw): Assert m_currentFrame is zero or the animation finished.
2422         Call requestFrameAsyncDecodingAtIndex with m_currentFrame instead of zero.
2423
2424 2017-06-30  Ross Kirsling  <ross.kirsling@sony.com>
2425
2426         [PAL] Move Sound into PAL
2427         https://bugs.webkit.org/show_bug.cgi?id=173999
2428
2429         Reviewed by Alex Christensen.
2430
2431         * Configurations/WebCore.xcconfig:
2432         * PlatformGTK.cmake:
2433         * PlatformMac.cmake:
2434         * PlatformWPE.cmake:
2435         * PlatformWin.cmake:
2436         * WebCore.xcodeproj/project.pbxproj:
2437         * editing/Editor.cpp:
2438         (WebCore::Editor::cut):
2439         (WebCore::Editor::copy):
2440         (WebCore::Editor::performDelete):
2441         * editing/EditorCommand.cpp:
2442         (WebCore::executeSelectToMark):
2443         (WebCore::executeSwapWithMark):
2444         * editing/mac/EditorMac.mm:
2445         (WebCore::Editor::takeFindStringFromSelection):
2446         * inspector/InspectorFrontendHost.cpp:
2447         (WebCore::InspectorFrontendHost::beep):
2448         * platform/Sound.h: Removed.
2449
2450 2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2451
2452         [iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes
2453         https://bugs.webkit.org/show_bug.cgi?id=174017
2454         <rdar://problem/32959782>
2455
2456         Reviewed by Simon Fraser.
2457
2458         We're currenly computing the drag caret rect (for the purposes of presentation at the client layers)
2459         incorrectly, in per-frame document coordinates instead of root view coordinates in the mainframe. This means
2460         drag caret geometry from embedded iframes in the document will show up in the content view with a rect in the
2461         coordinate space of the iframe.
2462
2463         To fix this, we need to convert the drag caret rect to root view coordinates. This patch teaches
2464         DragCaretController to do this, and tweaks WebKit/WebKit2 to use caretRectInRootViewCoordinates.
2465
2466         Test: DataInteractionTests.ExternalSourcePlainTextToIFrame
2467
2468         * editing/FrameSelection.cpp:
2469         (WebCore::DragCaretController::caretRectInRootViewCoordinates):
2470         * editing/FrameSelection.h:
2471
2472 2017-06-30  Sam Weinig  <sam@webkit.org>
2473
2474         [WebIDL] Replace use of __is_polymorphic with standard std::is_polymorphic<>::value
2475         https://bugs.webkit.org/show_bug.cgi?id=174012
2476
2477         Reviewed by Alex Christensen.
2478
2479         * bindings/scripts/CodeGeneratorJS.pm:
2480         (GenerateImplementation):
2481         Replace __is_polymorphic with standard std::is_polymorphic<>::value. Remove clang
2482         specific guard now that we are using something other compilers support.
2483
2484         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2485         * bindings/scripts/test/JS/JSMapLike.cpp:
2486         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2487         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2488         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2489         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2490         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2491         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2492         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2493         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2494         * bindings/scripts/test/JS/JSTestException.cpp:
2495         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2496         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2497         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2498         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2499         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2500         * bindings/scripts/test/JS/JSTestInterface.cpp:
2501         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2502         * bindings/scripts/test/JS/JSTestIterable.cpp:
2503         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2504         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2505         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2506         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2507         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2508         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2509         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2510         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2511         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2512         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2513         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2514         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2515         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2516         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2517         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2518         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2519         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2520         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2521         * bindings/scripts/test/JS/JSTestNode.cpp:
2522         * bindings/scripts/test/JS/JSTestObj.cpp:
2523         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2524         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2525         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2526         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2527         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2528         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2529         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2530         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2531         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2532         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2533         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2534         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2535         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2536         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2537         Update test results.
2538
2539 2017-06-30  Youenn Fablet  <youenn@apple.com>
2540
2541        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
2542        https://bugs.webkit.org/show_bug.cgi?id=169389
2543
2544        Reviewed by Alex Christensen.
2545
2546        Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
2547        Updated test is showing some more failing but this is due to the fact that we are no longer totally lying on the configuration of the
2548         underlying libwebrtc backend.
2549
2550         Previously, we were creating a libwebrtc peer connection and then setting its configuration.
2551         libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
2552         Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.
2553
2554         ICE candidate pool size is disabled as it is creating issues with running tests on bots.
2555
2556         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2557         (WebCore::MediaEndpointPeerConnection::setConfiguration):
2558         * Modules/mediastream/MediaEndpointPeerConnection.h:
2559         * Modules/mediastream/PeerConnectionBackend.h:
2560         * Modules/mediastream/RTCPeerConnection.cpp:
2561         (WebCore::RTCPeerConnection::initializeWith):
2562         (WebCore::iceServersFromConfiguration):
2563         (WebCore::RTCPeerConnection::initializeConfiguration):
2564         (WebCore::RTCPeerConnection::setConfiguration):
2565         * Modules/mediastream/RTCPeerConnection.h:
2566         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2567         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
2568         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
2569         (WebCore::LibWebRTCMediaEndpoint::stop):
2570         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2571         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2572         (WebCore::configurationFromMediaEndpointConfiguration):
2573         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
2574         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2575         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2576         (WebCore::createActualPeerConnection):
2577         (WebCore::LibWebRTCProvider::createPeerConnection):
2578         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2579
2580
2581 2017-06-30  Antoine Quint  <graouts@apple.com>
2582
2583         Top controls bars should invert with right-to-left user interface layout direction locale
2584         https://bugs.webkit.org/show_bug.cgi?id=173989
2585         <rdar://problem/32863552>
2586
2587         Reviewed by Dean Jackson.
2588
2589         When the user interface layout direction is set by the locale to be right-to-left, we now:
2590
2591             - invert the two top controls bars
2592             - invert the layout order for the fullscreen / PiP controls bar
2593             - orient the volume button the opposite direction when presented in a top controls bar
2594
2595         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html
2596
2597         * Modules/modern-media-controls/controls/icon-service.js: Add new RTL variants for the mute and unmute icons.
2598         * Modules/modern-media-controls/controls/inline-media-controls.css: Invert the position of the two top controls
2599         bars when we switch user interface layout direction.
2600         (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-left,):
2601         (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-right,):
2602         (.media-controls.inline > .controls-bar.top-left): Deleted.
2603         (.media-controls.inline > .controls-bar.top-right): Deleted.
2604         * Modules/modern-media-controls/controls/inline-media-controls.js:
2605         (InlineMediaControls.prototype.layout): Default to using the LTR variant for the mute button icon since
2606         it should only use the RTL variant in case the locale requires it *and* we display the mute button in a
2607         top controls bar rather than the bottom controls bar (ie. when width becomes constrained).
2608         (InlineMediaControls.prototype._topLeftContainerButtons): Invert the order of the fullscreen and PiP
2609         buttons based on the user interface layout direction.
2610         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
2611         (InlineMediaControls):
2612         * Modules/modern-media-controls/controls/media-controls.js:
2613         (MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection): Schedule a layout when the user interface
2614         layout direction changes.
2615         * Modules/modern-media-controls/controls/mute-button.js: Add a new "usesRTLIconVariant" property, false by
2616         default, to indicate we want to use the RTL variant of the button's icon.
2617         (MuteButton):
2618         (MuteButton.prototype.get muted):
2619         (MuteButton.prototype.set muted):
2620         (MuteButton.prototype.set usesRTLIconVariant):
2621         (MuteButton.prototype.layout):
2622         * Modules/modern-media-controls/images/iOS/Mute-RTL.svg: Added.
2623         * Modules/modern-media-controls/images/iOS/VolumeHi-RTL.svg: Added.
2624         * Modules/modern-media-controls/images/macOS/Mute-RTL.svg: Added.
2625         * Modules/modern-media-controls/images/macOS/VolumeHi-RTL.svg: Added.
2626         * Modules/modern-media-controls/media/media-controller.js: Use an ivar to track when it's worth notifying the
2627         media controls that the user interface layout direction has changed. This means we won't need to schedule a
2628         layout in case it's set to the current value.
2629         (MediaController):
2630         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
2631
2632 2017-06-29  Zalan Bujtas  <zalan@apple.com>
2633
2634         BreakingContext::handleReplaced() should use replacedBox instead of m_current.renderer().
2635         https://bugs.webkit.org/show_bug.cgi?id=174011
2636
2637         Reviewed by Simon Fraser.
2638
2639         No change in functionality.
2640
2641         * rendering/line/BreakingContext.h:
2642         (WebCore::BreakingContext::handleReplaced):
2643         * rendering/line/LineWidth.cpp:
2644         (WebCore::LineWidth::applyOverhang):
2645         * rendering/line/LineWidth.h:
2646
2647 2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2648
2649         [iOS DnD] Web content process crashes when the selection is moved far offscreen in dragstart
2650         https://bugs.webkit.org/show_bug.cgi?id=174010
2651         <rdar://problem/32597802>
2652
2653         Reviewed by Tim Horton.
2654
2655         The TextIndicator snapshot generated in createDragImageForSelection is not guaranteed to succeed; this patch
2656         adds a null check following TextIndicator::createWithSelectionInFrame and bails early if the snapshot was not
2657         successful.
2658
2659         Test: DataInteractionTests.DoNotCrashWhenSelectionMovesOffscreenAfterDragStart
2660
2661         * platform/ios/DragImageIOS.mm:
2662         (WebCore::createDragImageForSelection):
2663
2664 2017-06-29  Chris Fleizach  <cfleizach@apple.com>
2665
2666         AX: Cannot call setValue() on contenteditable or ARIA text controls
2667         https://bugs.webkit.org/show_bug.cgi?id=173520
2668
2669         Reviewed by Ryosuke Niwa.
2670
2671         Add support for changing the value of a contenteditable and any other aria text control in setValue().
2672  
2673         Test: accessibility/mac/set-value-editable-types.html
2674
2675         * accessibility/AccessibilityRenderObject.cpp:
2676         (WebCore::AccessibilityRenderObject::setValue):
2677
2678 2017-06-28  Simon Fraser  <simon.fraser@apple.com>
2679
2680         getBoundingClientRect returns wrong value for combination of page zoom and scroll
2681         https://bugs.webkit.org/show_bug.cgi?id=173841
2682         rdar://problem/32983841
2683
2684         Reviewed by Dean Jackson.
2685
2686         The layout viewport returned by FrameView::layoutViewportRect() is affected by page (Command-+) zooming,
2687         since it's computed using scroll positions, so when we use its origin to convert into client coordinates
2688         (which are zoom-agnostic), we need to account for page zoom, so fix FrameView::documentToClientOffset()
2689         to do this.
2690
2691         Callers of documentToClientOffset() were checked, revealing that event client coordinates were also
2692         wrong with page zoom and are fixed in the same way. It was found that SimulatedClick was using an
2693         entirely wrong rect to compute its location: Element::clientRect() is NOT in client coordinates,
2694         so change this code to use getBoundingClientRect() instead.
2695
2696         Minor refactoring in MouseRelatedEvent to make getting to the FrameView cleaner.
2697
2698         Some geometry types enhanced to have non-mutating scale functions.
2699
2700         Tests: fast/events/simulated-click-zoomed.html
2701                fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html
2702
2703         * dom/MouseRelatedEvent.cpp:
2704         (WebCore::MouseRelatedEvent::init):
2705         (WebCore::MouseRelatedEvent::initCoordinates):
2706         (WebCore::MouseRelatedEvent::frameView):
2707         (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor):
2708         (WebCore::MouseRelatedEvent::computePageLocation):
2709         (WebCore::MouseRelatedEvent::computeRelativePosition):
2710         (WebCore::pageZoomFactor): Deleted.
2711         (WebCore::frameScaleFactor): Deleted.
2712         * dom/MouseRelatedEvent.h:
2713         (WebCore::MouseRelatedEvent::absoluteLocation):
2714         (WebCore::MouseRelatedEvent::setAbsoluteLocation): Deleted.
2715         * dom/SimulatedClick.cpp:
2716         * page/FrameView.cpp:
2717         (WebCore::FrameView::layoutViewportRect): baseLayoutViewportSize() is the same as the old code.
2718         (WebCore::FrameView::documentToAbsoluteScaleFactor):
2719         (WebCore::FrameView::absoluteToDocumentScaleFactor):
2720         (WebCore::FrameView::absoluteToDocumentPoint):
2721         (WebCore::FrameView::documentToClientOffset):
2722         * page/FrameView.h:
2723         * platform/graphics/FloatPoint.h:
2724         (WebCore::FloatPoint::scale):
2725         (WebCore::FloatPoint::scaled):
2726         * platform/graphics/FloatSize.h:
2727         (WebCore::FloatSize::scaled):
2728         * platform/graphics/LayoutPoint.h:
2729         (WebCore::LayoutPoint::scaled):
2730
2731 2017-06-29  Megan Gardner  <megan_gardner@apple.com>
2732
2733         Unreviewed, fixing Window's build after r218976
2734
2735         * rendering/ScrollAlignment.cpp:
2736         (WebCore::operator<<):
2737
2738 2017-06-29  Megan Gardner  <megan_gardner@apple.com>
2739
2740         Add TextStream operators for Range, VisiblePosition, VisibleSelection, and ScrollAlignment
2741         https://bugs.webkit.org/show_bug.cgi?id=173997
2742
2743         Reviewed by Simon Fraser.
2744
2745         Adding logging that can be used with TextStream-based LOG_WITH_STREAM.
2746
2747         * dom/Range.cpp:
2748         (WebCore::operator<<):
2749         * dom/Range.h:
2750         * editing/VisiblePosition.h:
2751         * editing/VisibleSelection.cpp:
2752         (WebCore::operator<<):
2753         * editing/VisibleSelection.h:
2754         * rendering/ScrollAlignment.cpp:
2755         (WebCore::operator<<):
2756         * rendering/ScrollAlignment.h:
2757
2758 2017-06-29  Matt Lewis  <jlewis3@apple.com>
2759
2760         Unreviewed, rolling out r218903.
2761
2762         This patch and its fix cause immediate flakiness on all WK2
2763         testers
2764
2765         Reverted changeset:
2766
2767         "Support PeerConnectionStates::BundlePolicy::MaxBundle when
2768         setting rtc configuration"
2769         https://bugs.webkit.org/show_bug.cgi?id=169389
2770         http://trac.webkit.org/changeset/218903
2771
2772 2017-06-29  Matt Lewis  <jlewis3@apple.com>
2773
2774         Unreviewed, rolling out r218963.
2775
2776         This patch and its fix cause immediate flakiness on all WK2
2777         testers
2778
2779         Reverted changeset:
2780
2781         "Support PeerConnectionStates::BundlePolicy::MaxBundle when
2782         setting rtc configuration"
2783         https://bugs.webkit.org/show_bug.cgi?id=169389
2784         http://trac.webkit.org/changeset/218963
2785
2786 2017-06-29  Chris Dumez  <cdumez@apple.com>
2787
2788         Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess
2789         https://bugs.webkit.org/show_bug.cgi?id=173990
2790
2791         Reviewed by Brent Fulgham.
2792
2793         Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess.
2794         They really have different API and there is therefore close to no code duplication.
2795
2796         * loader/ResourceLoadObserver.cpp:
2797         (WebCore::primaryDomain):
2798         (WebCore::ResourceLoadObserver::setStatisticsQueue):
2799         (WebCore::ResourceLoadObserver::shouldLog):
2800         * loader/ResourceLoadObserver.h:
2801         * loader/ResourceLoadStatisticsStore.cpp:
2802         (WebCore::ResourceLoadStatisticsStore::primaryDomain):
2803         * loader/ResourceLoadStatisticsStore.h:
2804         * platform/URL.h:
2805
2806 2017-06-29  Sam Weinig  <sam@webkit.org>
2807
2808         [WebIDL] Remove custom binding for UserMessageHandlersNamespace
2809         https://bugs.webkit.org/show_bug.cgi?id=173956
2810
2811         Reviewed by Darin Adler.
2812
2813         * CMakeLists.txt:
2814         * WebCore.xcodeproj/project.pbxproj:
2815         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp: Removed.
2816         Remove JSUserMessageHandlersNamespaceCustom.cpp
2817
2818         * bindings/scripts/CodeGeneratorJS.pm:
2819         (GenerateNamedGetterLambda):
2820         Add support for calling named getters with additional arguments from [CallWith].
2821
2822         (GenerateAttributeGetterBodyDefinition):
2823         (GenerateAttributeSetterBodyDefinition):
2824         (GenerateCallWithUsingReferences):
2825         (GenerateCallWithUsingPointers):
2826         (GenerateConstructorCallWithUsingPointers):
2827         (GenerateCallWith):
2828         (GenerateParametersCheck):
2829         Update arguments to GenerateCallWith(Using...) to no longer pass an operation,
2830         which was only needed for the no longer used ScriptArguments, pass a thisObject
2831         reference, and optionally pass an indentation.
2832
2833         * bindings/scripts/IDLAttributes.json:
2834         Remove no longer used ScriptArguments and CallStack, add World.
2835
2836         * bindings/scripts/test/JS/JSTestObj.cpp:
2837         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttributeGetter): Deleted.
2838         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
2839         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttributeSetter): Deleted.
2840         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
2841         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackBody): Deleted.
2842         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack): Deleted.
2843         * bindings/scripts/test/TestObj.idl:
2844         Remove tests of ScriptArguments and CallStack.
2845
2846         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: Added.
2847         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: Added.
2848         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: Added.
2849         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: Added.
2850         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: Added.
2851         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: Added.
2852         * bindings/scripts/test/TestNamedGetterCallWith.idl: Added.
2853         * bindings/scripts/test/TestNamedGetterNoIdentifier.idl: Added.
2854         * bindings/scripts/test/TestNamedGetterWithIdentifier.idl: Added.
2855         Add basic named getter tests and a specific test of named getters using CallWith.
2856
2857         * page/UserMessageHandlersNamespace.cpp:
2858         (WebCore::UserMessageHandlersNamespace::supportedPropertyNames):
2859         (WebCore::UserMessageHandlersNamespace::namedItem):
2860         (WebCore::UserMessageHandlersNamespace::handler): Deleted.
2861         * page/UserMessageHandlersNamespace.h:
2862         Rename handler to namedItem, matching convention and the expectations of the
2863         bindings generator and swap the order of the arguments for the same reason.
2864
2865         * page/UserMessageHandlersNamespace.idl:
2866         Remove CustomGetOwnPropertySlotAndDescriptor, and add the anonymous named getter.
2867
2868 2017-06-29  Chris Dumez  <cdumez@apple.com>
2869
2870         Avoid copying ResourceLoadStatistics objects
2871         https://bugs.webkit.org/show_bug.cgi?id=173972
2872
2873         Reviewed by Brent Fulgham.
2874
2875         Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
2876         to avoid such mistakes in the future.
2877
2878         * loader/ResourceLoadObserver.cpp:
2879         (WebCore::ResourceLoadObserver::logFrameNavigation):
2880         * loader/ResourceLoadStatistics.h:
2881         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
2882
2883 2017-06-29  John Wilander  <wilander@apple.com>
2884
2885         Fix for intermittent Layout Test fail http/tests/loading/resourceLoadStatistics/telemetry-generation.html
2886         https://bugs.webkit.org/show_bug.cgi?id=173940
2887         <rdar://problem/33018125>
2888
2889         Reviewed by Brent Fulgham.
2890
2891         No new tests. This change enables the exiting test to pass.
2892
2893         * loader/ResourceLoadStatisticsStore.cpp:
2894         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
2895             Added an assert.
2896
2897 2017-06-29  Youenn Fablet  <youenn@apple.com>
2898
2899         Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
2900         https://bugs.webkit.org/show_bug.cgi?id=169389
2901
2902         Unreviewed.
2903
2904         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2905         (WebCore::configurationFromMediaEndpointConfiguration): Reactivating CPU overuse detection as it might be the cause of the bots regressions.
2906
2907 2017-06-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2908
2909         [Curl] ResourceHandleManager violate the class responsibility of ResourceHandle
2910         https://bugs.webkit.org/show_bug.cgi?id=173630
2911
2912         Reviewed by Alex Christensen.
2913
2914         * platform/network/ResourceHandle.h:
2915         * platform/network/curl/ResourceHandleCurl.cpp:
2916         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2917         (WebCore::calculateWebTimingInformations):
2918         (WebCore::handleLocalReceiveResponse):
2919         (WebCore::writeCallback):
2920         (WebCore::isHttpInfo):
2921         (WebCore::isHttpRedirect):
2922         (WebCore::isHttpAuthentication):
2923         (WebCore::isHttpNotModified):
2924         (WebCore::isAppendableHeader):
2925         (WebCore::removeLeadingAndTrailingQuotes):
2926         (WebCore::getProtectionSpace):
2927         (WebCore::headerCallback):
2928         (WebCore::readCallback):
2929         (WebCore::getFormElementsCount):
2930         (WebCore::setupFormData):
2931         (WebCore::ResourceHandle::setupPUT):
2932         (WebCore::ResourceHandle::setupPOST):
2933         (WebCore::ResourceHandle::handleDataURL):
2934         (WebCore::ResourceHandle::dispatchSynchronousJob):
2935         (WebCore::ResourceHandle::applyAuthentication):
2936         (WebCore::ResourceHandle::initialize):
2937         (WebCore::ResourceHandle::handleCurlMsg):
2938         * platform/network/curl/ResourceHandleManager.cpp:
2939         (WebCore::ResourceHandleManager::downloadTimerCallback):
2940         (WebCore::ResourceHandleManager::startJob):
2941         (WebCore::calculateWebTimingInformations): Deleted.
2942         (WebCore::isHttpInfo): Deleted.
2943         (WebCore::isHttpRedirect): Deleted.
2944         (WebCore::isHttpAuthentication): Deleted.
2945         (WebCore::isHttpNotModified): Deleted.
2946         (WebCore::handleLocalReceiveResponse): Deleted.
2947         (WebCore::writeCallback): Deleted.
2948         (WebCore::isAppendableHeader): Deleted.
2949         (WebCore::removeLeadingAndTrailingQuotes): Deleted.
2950         (WebCore::getProtectionSpace): Deleted.
2951         (WebCore::headerCallback): Deleted.
2952         (WebCore::readCallback): Deleted.
2953         (WebCore::getFormElementsCount): Deleted.
2954         (WebCore::setupFormData): Deleted.
2955         (WebCore::ResourceHandleManager::setupPUT): Deleted.
2956         (WebCore::ResourceHandleManager::setupPOST): Deleted.
2957         (WebCore::handleDataURL): Deleted.
2958         (WebCore::ResourceHandleManager::dispatchSynchronousJob): Deleted.
2959         (WebCore::ResourceHandleManager::applyAuthenticationToRequest): Deleted.
2960         (WebCore::ResourceHandleManager::initializeHandle): Deleted.
2961         * platform/network/curl/ResourceHandleManager.h:
2962
2963 2017-06-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
2964
2965         Async image decoding should be disabled for iBooks on tvOS
2966         https://bugs.webkit.org/show_bug.cgi?id=173945
2967
2968         Reviewed by Simon Fraser.
2969
2970         The iBooks on tvOS is an AppStore application. We need to disable async
2971         image decoding for iBooks on tvOS permanently through WebKit.
2972
2973         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2974         (WebCore::IOSApplication::isIBooks):
2975         * platform/graphics/BitmapImage.cpp:
2976         (WebCore::BitmapImage::updateFromSettings):
2977
2978 2017-06-29  Sam Weinig  <sam@webkit.org>
2979
2980         [WebIDL] Add a new extended attribute to model the forced return value optimization used on Node and Crypto
2981         https://bugs.webkit.org/show_bug.cgi?id=173961
2982
2983         Reviewed by Darin Adler.
2984
2985         Node and Crypto were both using custom bindings to implement an optimization
2986         for operations that always returned one one of the arguments passed in. The
2987         optimization directly returns the JSValue argument, avoiding wrapping and 
2988         unwrapping, and all the cache lookups that might entail. This allows that 
2989         optimization to work without custom bindings by adding a new extended attribute
2990         [ReturnValue] that can annotate an argument. When used, the implementation
2991         function is expected to return either void or ExceptionOr<void>.
2992
2993         * CMakeLists.txt:
2994         * WebCore.xcodeproj/project.pbxproj:
2995         * bindings/js/JSBindingsAllInOne.cpp:
2996         * bindings/js/JSCryptoCustom.cpp: Removed.
2997         Remove JSCryptoCustom.cpp.
2998
2999         * bindings/js/JSNodeCustom.cpp:
3000         (WebCore::JSNode::insertBefore): Deleted.
3001         (WebCore::JSNode::replaceChild): Deleted.
3002         (WebCore::JSNode::removeChild): Deleted.
3003         (WebCore::JSNode::appendChild): Deleted.
3004         Remove custom functions.
3005
3006         * bindings/scripts/CodeGeneratorJS.pm:
3007         (OperationHasForcedReturnValue):
3008         Add helper to determine if an operation has [ReturnValue] on any argument.
3009
3010         (NeedsExplicitPropagateExceptionCall):
3011         We must treat operations with a [ReturnValue] argument like we do operations
3012         returning void, and explicitly check for exceptions.
3013
3014         (GenerateParametersCheck):
3015         Pull out the argument in a variable called 'returnValue' if it is annotated
3016         with [ReturnValue].
3017
3018         (GenerateImplementationFunctionCall):
3019         Special case operations with a [ReturnValue] argument to return the previously
3020         set aside 'returnValue' variable.
3021
3022         * bindings/scripts/IDLAttributes.json:
3023         Add [ReturnValue].
3024
3025         * bindings/scripts/test/JS/JSTestObj.cpp:
3026         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationBody):
3027         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimization):
3028         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithExceptionBody):
3029         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithException):
3030         * bindings/scripts/test/TestObj.idl:
3031         Add tests for [ReturnValue].
3032
3033         * dom/Node.idl:
3034         * page/Crypto.idl:
3035         Add [ReturnValue] annotations and remove [Custom] annotations.
3036
3037 2017-06-29  Chris Dumez  <cdumez@apple.com>
3038
3039         Unreviewed, rolling out r218944.
3040
3041         Optimization is incorrect
3042
3043         Reverted changeset:
3044
3045         "Avoid copying ResourceLoadStatistics objects"
3046         https://bugs.webkit.org/show_bug.cgi?id=173972
3047         http://trac.webkit.org/changeset/218944
3048
3049 2017-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3050
3051         REGRESSION(r218896): ASSERT in WebPageProxy::dataCallback
3052         https://bugs.webkit.org/show_bug.cgi?id=173968
3053
3054         Reviewed by Michael Catanzaro.
3055
3056         The problem is that WebPageProxy::getLoadDecisionForIcon() sends 0 as callback ID when the decision is to not
3057         load the icon. Since r218896 we always notify the client even when the decision is to not load the icon, in
3058         which case the UI doesn't really expect a callback. When WebPageProxy::dataCallback is called with a 0 callback ID,
3059         CallbackMap::take() crashes in RELEASE_ASSERT(callbackID).
3060
3061         Fixes several GTK+ unit tests that are crashing.
3062
3063         * loader/DocumentLoader.cpp:
3064         (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Return earlier if decision is false or frame is nullptr.
3065         (WebCore::DocumentLoader::finishedLoadingIcon): Move RELEASE_ASSERT to notifyFinishedLoadingIcon().
3066         (WebCore::DocumentLoader::notifyFinishedLoadingIcon): Assert if callbackIdentifier is 0 or m_frame is nullptr,
3067         since it's no longer expected to happen.
3068
3069 2017-06-29  Chris Dumez  <cdumez@apple.com>
3070
3071         statistics.mostRecentUserInteraction should be of type WallTime
3072         https://bugs.webkit.org/show_bug.cgi?id=173974
3073
3074         Reviewed by Brent Fulgham.
3075
3076         statistics.mostRecentUserInteraction should be of type WallTime for clarity.
3077
3078         * loader/ResourceLoadObserver.cpp:
3079         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3080         (WebCore::ResourceLoadObserver::logUserInteraction):
3081         (WebCore::ResourceLoadObserver::clearUserInteraction):
3082         * loader/ResourceLoadStatistics.cpp:
3083         (WebCore::ResourceLoadStatistics::encode):
3084         (WebCore::ResourceLoadStatistics::decode):
3085         (WebCore::ResourceLoadStatistics::toString):
3086         (WebCore::ResourceLoadStatistics::merge):
3087         * loader/ResourceLoadStatistics.h:
3088         (WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime): Deleted.
3089         * loader/ResourceLoadStatisticsStore.cpp:
3090         (WebCore::shouldPartitionCookies):
3091         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
3092         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
3093
3094 2017-06-29  JF Bastien  <jfbastien@apple.com>
3095
3096         WebAssembly: disable some APIs under CSP
3097         https://bugs.webkit.org/show_bug.cgi?id=173892
3098         <rdar://problem/32914613>
3099
3100         Reviewed by Daniel Bates.
3101
3102         This does the basic separation of eval-blocked and
3103         WebAssembly-blocked, but currently only blocks neither or both. I
3104         think we'll eventually consider allowing one to be blocked but not
3105         the other, so this separation makes sense and means that when we
3106         want to do the change it'll be tiny. At a minimum we want a
3107         different error message, which this patch provides (a lot of the
3108         code ties blocking to the error message).
3109
3110         Tests: http/tests/security/contentSecurityPolicy/WebAssembly-allowed.html
3111                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-about-blank-iframe.html
3112                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-external-script.html
3113                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-subframe.html
3114                http/tests/security/contentSecurityPolicy/WebAssembly-blocked.html
3115
3116         * bindings/js/ScriptController.cpp:
3117         (WebCore::ScriptController::enableWebAssembly):
3118         (WebCore::ScriptController::disableWebAssembly):
3119         * bindings/js/ScriptController.h:
3120         * bindings/js/WorkerScriptController.cpp:
3121         (WebCore::WorkerScriptController::disableWebAssembly):
3122         * bindings/js/WorkerScriptController.h:
3123         * dom/Document.cpp:
3124         (WebCore::Document::disableWebAssembly):
3125         * dom/Document.h:
3126         * dom/ScriptExecutionContext.h:
3127         * page/csp/ContentSecurityPolicy.cpp:
3128         (WebCore::ContentSecurityPolicy::didCreateWindowProxy):
3129         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext):
3130         * page/csp/ContentSecurityPolicy.h:
3131         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
3132         (WebCore::ContentSecurityPolicyDirectiveList::create):
3133         * page/csp/ContentSecurityPolicyDirectiveList.h:
3134         (WebCore::ContentSecurityPolicyDirectiveList::webAssemblyDisabledErrorMessage):
3135         (WebCore::ContentSecurityPolicyDirectiveList::setWebAssemblyDisabledErrorMessage):
3136         * workers/WorkerGlobalScope.cpp:
3137         (WebCore::WorkerGlobalScope::disableWebAssembly):
3138         * workers/WorkerGlobalScope.h:
3139
3140 2017-06-29  Zalan Bujtas  <zalan@apple.com>
3141
3142         Make InlineBox::m_topLeft and m_logicalWidth protected.
3143         https://bugs.webkit.org/show_bug.cgi?id=173973
3144
3145         Reviewed by Simon Fraser.
3146
3147         I don't think this reasoning from 10 years ago is valid anymore -> 
3148           "FIXME: Would like to make this protected, but methods are accessing these members over in the part."
3149         (comment was conveniently removed in a later commit).
3150
3151         No change in functionality.
3152
3153         * rendering/InlineBox.h:
3154         (WebCore::InlineBox::InlineBox):
3155
3156 2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3157
3158         [iOS DnD] Adopt +objectWithItemProviderData: for serializing NSItemProviderReading-conformant objects
3159         https://bugs.webkit.org/show_bug.cgi?id=173971
3160         <rdar://problem/33006605>
3161
3162         Reviewed by Tim Horton.
3163
3164         Moves off of a very-recently-deprecated API, in favor of its replacement. Guarded by a runtime check and staging
3165         declarations. No change in behavior.
3166
3167         * platform/ios/WebItemProviderPasteboard.mm:
3168         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
3169
3170 2017-06-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3171
3172         [Curl] Separate global curl settings from ResourceHandleManager as CurlContext class
3173         https://bugs.webkit.org/show_bug.cgi?id=173629
3174
3175         Reviewed by Alex Christensen.
3176
3177         * PlatformWinCairo.cmake:
3178         * platform/network/curl/CookieJarCurl.cpp:
3179         (WebCore::setCookiesFromDOM):
3180         (WebCore::cookiesForSession):
3181         * platform/network/curl/CurlContext.cpp: Added.
3182         (WebCore::certificatePath):
3183         (WebCore::cookieJarPath):
3184         (WebCore::CurlContext::CurlContext):
3185         (WebCore::CurlContext::~CurlContext):
3186         (WebCore::CurlContext::initCookieSession):
3187         (WebCore::CurlContext::ProxyInfo::url):
3188         (WebCore::CurlContext::setProxyInfo):
3189         (WebCore::CurlContext::getEffectiveURL):
3190         (WebCore::CurlContext::createMultiHandle):
3191         (WebCore::CurlContext::mutexFor):
3192         (WebCore::CurlContext::lock):
3193         (WebCore::CurlContext::unlock):
3194         * platform/network/curl/CurlContext.h: Added.
3195         (WebCore::CurlContext::singleton):
3196         (WebCore::CurlContext::curlShareHandle):
3197         (WebCore::CurlContext::getCookieJarFileName):
3198         (WebCore::CurlContext::setCookieJarFileName):
3199         (WebCore::CurlContext::getCertificatePath):
3200         (WebCore::CurlContext::shouldIgnoreSSLErrors):
3201         (WebCore::CurlContext::proxyInfo):
3202         (WebCore::CurlContext::setProxyInfo):
3203         (WebCore::CurlContext::getLogFile):
3204         (WebCore::CurlContext::isVerbose):
3205         * platform/network/curl/CurlDownload.cpp:
3206         (WebCore::CurlDownload::init):
3207         (WebCore::CurlDownload::start):
3208         (WebCore::CurlDownload::cancel):
3209         (WebCore::CurlDownload::didReceiveHeader):
3210         * platform/network/curl/CurlDownload.h:
3211         * platform/network/curl/CurlJobManager.cpp: Renamed from Source/WebCore/platform/network/curl/CurlManager.cpp.
3212         (WebCore::CurlJobManager::CurlJobManager):
3213         (WebCore::CurlJobManager::~CurlJobManager):
3214         (WebCore::CurlJobManager::add):
3215         (WebCore::CurlJobManager::remove):
3216         (WebCore::CurlJobManager::getActiveCount):
3217         (WebCore::CurlJobManager::getPendingCount):
3218         (WebCore::CurlJobManager::startThreadIfNeeded):
3219         (WebCore::CurlJobManager::stopThread):
3220         (WebCore::CurlJobManager::stopThreadIfIdle):
3221         (WebCore::CurlJobManager::updateHandleList):
3222         (WebCore::CurlJobManager::addToCurl):
3223         (WebCore::CurlJobManager::removeFromCurl):
3224         (WebCore::CurlJobManager::workerThread):
3225         * platform/network/curl/CurlJobManager.h: Renamed from Source/WebCore/platform/network/curl/CurlManager.h.
3226         (WebCore::CurlJobManager::singleton):
3227         * platform/network/curl/ResourceHandleManager.cpp:
3228         (WebCore::ResourceHandleManager::ResourceHandleManager):
3229         (WebCore::ResourceHandleManager::~ResourceHandleManager):
3230         (WebCore::handleLocalReceiveResponse):
3231         (WebCore::getProtectionSpace):
3232         (WebCore::headerCallback):
3233         (WebCore::ResourceHandleManager::downloadTimerCallback):
3234         (WebCore::ResourceHandleManager::initializeHandle):
3235         (WebCore::certificatePath): Deleted.
3236         (WebCore::cookieJarPath): Deleted.
3237         (WebCore::ResourceHandleManager::setCookieJarFileName): Deleted.
3238         (WebCore::ResourceHandleManager::getCookieJarFileName): Deleted.
3239         (WebCore::ResourceHandleManager::setProxyInfo): Deleted.
3240         (WebCore::ResourceHandleManager::initCookieSession): Deleted.
3241         * platform/network/curl/ResourceHandleManager.h:
3242         (): Deleted.
3243
3244 2017-06-29  Chris Dumez  <cdumez@apple.com>
3245
3246         Avoid copying ResourceLoadStatistics objects
3247         https://bugs.webkit.org/show_bug.cgi?id=173972
3248
3249         Reviewed by Geoffrey Garen.
3250
3251         Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
3252         to avoid such mistakes in the future.
3253
3254         * loader/ResourceLoadObserver.cpp:
3255         (WebCore::ResourceLoadObserver::logFrameNavigation):
3256         * loader/ResourceLoadStatistics.h:
3257         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
3258
3259 2017-06-29  Antoine Quint  <graouts@apple.com>
3260
3261         Full stop shows to the right of the picture-in-picture localised string in Hebrew
3262         https://bugs.webkit.org/show_bug.cgi?id=173966
3263         <rdar://problem/32847376>
3264
3265         Reviewed by Dean Jackson.
3266
3267         We manually set the CSS "direction" property to "rtl" when we're not using an LTR language for a placard.
3268
3269         Test: media/modern-media-controls/placard/placard-ltr.html
3270
3271         * Modules/modern-media-controls/controls/placard.css:
3272         (.media-controls:not(.uses-ltr-user-interface-layout-direction) .placard):
3273
3274 2017-06-29  Brent Fulgham  <bfulgham@apple.com>
3275
3276         Unreviewed Apple CMake build after r218901
3277
3278         I did not add 'cocoa/FileMonitorCocoa.mm' to the PlatformMac.cmake file as part of r218901.):
3279
3280         * PlatformMac.cmake:
3281
3282 2017-06-29  Frederic Wang  <fwang@igalia.com>
3283
3284         Small improvement of calls to RenderLayerBacking members
3285         https://bugs.webkit.org/show_bug.cgi?id=173969
3286
3287         Reviewed by Simon Fraser.
3288
3289         No new tests, behavior unchanged.
3290
3291         * page/FrameView.cpp:
3292         (WebCore::FrameView::tiledBacking): Access the member with RenderLayerBacking::tiledBacking.
3293         (WebCore::FrameView::updateTilesForExtendedBackgroundMode): Ditto.
3294         * rendering/RenderLayer.cpp:
3295         (WebCore::RenderLayer::usesCompositedScrolling): Use RenderLayerBacking::hasScrollingLayer as
3296         it better matches the intention of the check here.
3297
3298 2017-06-29  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3299
3300         [Readable Streams API] Fix ReadableStream "strategy" argument handling
3301         https://bugs.webkit.org/show_bug.cgi?id=172716
3302
3303         Reviewed by Xabier Rodriguez-Calvar.
3304
3305         Aligned default strategy parameter with spec, as defined in [1].
3306         
3307         [1] https://streams.spec.whatwg.org/#rs-constructor
3308
3309         Added new tests and updated some existing ones based on the newly
3310         expected behavior. Also updated expectations for WPT streams tests.
3311
3312         * Modules/streams/ReadableStream.js:
3313         (initializeReadableStream): Fixed initialization of strategy.
3314
3315 2017-06-29  Antti Koivisto  <antti@apple.com>
3316
3317         REGRESSION(r215347): NAS4Free Pop-down menus fail to appear
3318         https://bugs.webkit.org/show_bug.cgi?id=173967
3319         <rdar://problem/32690114>
3320
3321         Reviewed by Andreas Kling.
3322
3323         Menus on this configuration page operate by mutating visibility. We fail to trigger required
3324         compositing updates when visibility changes on non-composited layer. Visibility of a non-composited
3325         descendant may affect geometry of the composited ancestor layer.
3326
3327         Test: compositing/backing/non-composited-visibility-change.html
3328
3329         * rendering/RenderLayerCompositor.cpp:
3330         (WebCore::RenderLayerCompositor::layerStyleChanged):
3331         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer): Added.
3332
3333             Trigger compositing update for non-composited layers on visibility change.
3334             Factor tests into function.
3335
3336         * rendering/RenderLayerCompositor.h:
3337
3338 2017-06-28  Frederic Wang  <fwang@igalia.com>
3339
3340         Align Document::canNavigate on the HTM5 specification
3341         https://bugs.webkit.org/show_bug.cgi?id=173162
3342
3343         Reviewed by Chris Dumez.
3344
3345         Currently when a frame A with a sandboxed navigation flag tries and navigates another frame B
3346         then Document::canNavigate verifies the cases where we try to navigate A's top frame (in
3347         that case the allow-top-navigation flag is needed) or not (in that case, B must be a
3348         descendant of A). This patch refines that a bit to check the case where B is a popup (in that
3349         case navigation is permitted if A is the opener of B). This change aligns on the HTML5
3350         specification and allows to pass more W3C Web Platform tests.
3351         See https://html.spec.whatwg.org/multipage/browsers.html#allowed-to-navigate
3352
3353         Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html
3354                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html
3355
3356         * dom/Document.cpp:
3357         (WebCore::Document::canNavigate): This refines the case where the document's frame has the
3358         sandbox navigation flag set in order to handle popup navigation. New comments referring to
3359         the HTML5 specification are also added.
3360
3361 2017-06-28  Myles C. Maxfield  <mmaxfield@apple.com>
3362
3363         Only apply font features for the particular type of font they are being applied to
3364         https://bugs.webkit.org/show_bug.cgi?id=172661
3365         <rdar://problem/31534119>
3366         <rdar://problem/32799624>
3367
3368         Reviewed by Simon Fraser.
3369
3370         There are two types of font formats which support features: AAT and OTF. Each of them has
3371         a different idea about what the identity of a feature is. We were specifying both types
3372         of feature identities to Core Text; however, this is causing Core Text to get confused.
3373         Instead, we should only apply AAT features to AAT fonts and OTF features to OTF fonts.
3374
3375         Test: Un-marking these tests as failure on High Sierra:
3376               css3/font-variant-petite-caps-synthesis-coverage.html
3377               css3/font-variant-small-caps-synthesis-coverage.html
3378
3379         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3380         (WebCore::FontType::FontType):
3381         (WebCore::preparePlatformFont):
3382         (WebCore::variationCapabilitiesForFontDescriptor):
3383         (WebCore::isGXVariableFont): Deleted.
3384
3385 2017-06-28  Chris Dumez  <cdumez@apple.com>
3386
3387         [ResourceLoadStatistics] Simplify PrevalentResourceTelemetry struct
3388         https://bugs.webkit.org/show_bug.cgi?id=173953
3389
3390         Reviewed by Sam Weinig.
3391
3392         * loader/ResourceLoadStatisticsStore.cpp:
3393         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
3394         * loader/ResourceLoadStatisticsStore.h:
3395         (WebCore::PrevalentResourceTelemetry::PrevalentResourceTelemetry): Deleted.
3396
3397 2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>
3398
3399         Crash in WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange
3400         https://bugs.webkit.org/show_bug.cgi?id=173958
3401
3402         Reviewed by Simon Fraser.
3403
3404         The crashed is most likely caused by updateLayersAfterAncestorChange calling [CALayer setPosition]
3405         with a CGPoint which contains the x coordinate or the y coordinate of NaN.
3406
3407         Simon and I inpected the code but we couldn't figure out how we get there. Detect this case and bail out.
3408         Also log the relevant values and debug assert when this condition is hit to help identifying the root cause.
3409
3410         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
3411         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
3412
3413 2017-06-28  Chris Dumez  <cdumez@apple.com>
3414
3415         ResourceLoadObserver clean up
3416         https://bugs.webkit.org/show_bug.cgi?id=173955
3417
3418         Reviewed by Sam Weinig and Brent Fulgham.
3419
3420         ResourceLoadObserver clean up: Modernize code a bit and get rid of unused variables.
3421
3422         * loader/ResourceLoadObserver.cpp:
3423         (WebCore::ResourceLoadObserver::clearInMemoryStore):
3424         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
3425         (WebCore::ResourceLoadObserver::shouldLog):
3426         (WebCore::ResourceLoadObserver::logFrameNavigation):
3427         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3428         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3429         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3430         (WebCore::ResourceLoadObserver::logUserInteraction):
3431         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
3432         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
3433         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
3434         (WebCore::ResourceLoadObserver::fireDataModificationHandler):
3435         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
3436         (WebCore::ResourceLoadObserver::primaryDomain):
3437         (WebCore::ResourceLoadObserver::statisticsForOrigin):
3438
3439 2017-06-28  Zalan Bujtas  <zalan@apple.com>
3440
3441         Move RenderEmbeddedObject::isReplacementObscured to HTMLPlugInElement
3442         https://bugs.webkit.org/show_bug.cgi?id=173802
3443         <rdar://problem/32884389>
3444
3445         Reviewed by Simon Fraser.
3446
3447         Hittesting could potentially destroy "this" renderer so calling it inside RenderEmbeddedObject
3448         could leave the caller with a stale pointer.
3449         This patch protects the plugin element from getting destroyed and checks if the renderer got
3450         deleted during the hittest to avoid nullptr dereference.
3451
3452         Speculative fix.
3453
3454         * html/HTMLPlugInElement.cpp:
3455         (WebCore::HTMLPlugInElement::isReplacementObscured):
3456         * html/HTMLPlugInElement.h:
3457         * rendering/RenderEmbeddedObject.cpp:
3458         (WebCore::RenderEmbeddedObject::isReplacementObscured): Deleted.
3459         * rendering/RenderEmbeddedObject.h:
3460         * testing/Internals.cpp:
3461         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured):
3462
3463 2017-06-28  Chris Dumez  <cdumez@apple.com>
3464
3465         Avoid copying statistics in ResourceLoadStatisticsStore::readDataFromDecoder()
3466         https://bugs.webkit.org/show_bug.cgi?id=173951
3467
3468         Reviewed by Ryosuke Niwa.
3469
3470         * loader/ResourceLoadStatisticsStore.cpp:
3471         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
3472
3473 2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>
3474
3475         Safari's Speedometer score massively regresses when accessibility is enabled
3476         https://bugs.webkit.org/show_bug.cgi?id=173912
3477
3478         Reviewed by Chris Fleizach.
3479
3480         The bug was caused by HTMLTextFormControlElement::setInnerTextValue triggering a synchronous layout
3481         via constructing VisiblePosition when the accessibility tree is present.
3482
3483         Added AXObjectCache::postTextReplacementNotificationForTextControl which avoids the construction of
3484         VisiblePosition and other means of triggering a synchronous layout. This patch also fixes a subtle bug
3485         that HTMLTextFormControlElement was creating TextMarkerData with axID set to that of the text control
3486         element instead of the root editable element inside its shadow tree even though the typing command uses
3487         axID of the root editable element. While I couldn't find any user-visible behavioral change from this
3488         code change, new code is more self-consistent.
3489
3490         Also added LayoutDisallowedScope which asserts that no synchronous layout happens in setInnerTextValue
3491         so that we don't introduce a new performance regression like this in the future.
3492
3493         No new tests. Existing tests in accessibility directory covers this.
3494
3495         * CMakeLists.txt: Added LayoutDisallowedScope.cpp.
3496         * WebCore.xcodeproj/project.pbxproj: Ditto.
3497
3498         * accessibility/AXObjectCache.cpp:
3499         (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl): Added.
3500         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): Modernized. Returns optional<TextMarkerData>
3501         instead of taking TextMarkerData as an out-argument, and returning with axID of 0.
3502         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl): Added. This specialized version
3503         constructs TextMarkerData for the first position inside the editable region in a text control without
3504         triggering a synchronous layout.
3505
3506     &nb