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