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