Crash in render tree after dynamically mutating the slot value
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Crash in render tree after dynamically mutating the slot value
4         https://bugs.webkit.org/show_bug.cgi?id=167502
5
6         Reviewed by Antti Koivisto.
7
8         The crash was caused by attributeChanged not destructing the render tree after an assigned element had been
9         removed from its slot. Since the style resolver can no longer find this element in the flat tree, we need to
10         delete its render object as if the element had been removed from the DOM tree.
11
12         Tests: fast/html/details-summary-slot.html
13                fast/shadow-dom/shadow-slot-attribute-change-crash.html
14
15         * dom/Element.cpp:
16         (WebCore::Element::attributeChanged):
17         * html/HTMLSummaryElement.cpp:
18         (WebCore::SummarySlotElement): Added. Always use the default slot regardless of the slot attribute's value.
19         (WebCore::HTMLSummaryElement::create): Use SummarySlotElement
20
21 2017-02-09  Antti Koivisto  <antti@apple.com>
22
23         Details element doesn't work correctly when mutating content between closing and opening
24         https://bugs.webkit.org/show_bug.cgi?id=167310
25
26         Reviewed by Ryosuke Niwa.
27
28         Tests: fast/html/details-close-modify-open.html
29                fast/shadow-dom/slot-remove-mutate-add.html
30
31         * dom/SlotAssignment.cpp:
32         (WebCore::SlotAssignment::didChangeSlot):
33
34             Always reset the slot assignment when content is mutated.
35
36 2017-02-09  Chris Dumez  <cdumez@apple.com>
37
38         Crash under FormSubmission::create()
39         https://bugs.webkit.org/show_bug.cgi?id=167200
40         <rdar://problem/30096323>
41
42         Reviewed by Darin Adler.
43
44         The issue is that FormSubmission::create() was iterating over
45         form.associatedElements() as was calling Element::appendFormData()
46         in the loop. HTMLObjectElement::appendFormData() was calling
47         pluginWidget(PluginLoadingPolicy::Load) which causes a synchronous
48         layout and can fire events (such as focus event) synchronously.
49         Firing those events synchronously allows the JS to modify the
50         form.associatedElements() vector we are currently iterating on.
51
52         To avoid this issue, we now call pluginWidget(PluginLoadingPolicy::DoNotLoad)
53         in HTMLObjectElement::appendFormData() as we are not allowed to fire
54         synchronous events at this point. I also added a security assertion
55         in FormSubmission::create() to catch cases where we fire JS events
56         while iterating over the form associated elements to more easily
57         notice these things in the future.
58
59         Test: fast/forms/formsubmission-appendFormData-crash.html
60
61         * html/HTMLObjectElement.cpp:
62         (WebCore::HTMLObjectElement::appendFormData):
63         * loader/FormSubmission.cpp:
64         (WebCore::FormSubmission::create):
65
66 2017-02-09  Chris Dumez  <cdumez@apple.com>
67
68         Crash under HTMLFormElement::registerFormElement()
69         https://bugs.webkit.org/show_bug.cgi?id=167162
70
71         Reviewed by Ryosuke Niwa.
72
73         didMoveToNewDocument() was re-registering FormAttributeTargetObserver
74         even if the element's inDocument was not set yet. As a result, it was
75         possible for FormAssociatedElement::resetFormOwner() to be called
76         when the element was in the tree but with its inDocument still being
77         false (because insertedInto() has not been called yet). This could
78         end up calling HTMLFormElement::registerFormElement() even though
79         the element is still recognized as detached. This is an issue because
80         HTMLFormElement::m_associatedElements's order and its corresponding
81         indexes (m_associatedElementsBeforeIndex / m_associatedElementsAfterIndex)
82         rely on the position of the element with regards to the form element
83         (before / inside / after).
84
85         To address the issue, we now only register the FormAttributeTargetObserver
86         in didMoveToNewDocument() if the inDocument flag is set to true. This
87         is similar to what is done at other call sites of
88         resetFormAttributeTargetObserver(). We also ignore the form content
89         attribute in HTMLFormElement::formElementIndex() if the element is
90         not connected.
91
92         As per the HTML specification [1], the form content attribute is only
93         taken if the element is connected (i.e. inDocument flag is true).
94
95         Note that FormAssociatedElement::findAssociatedForm() was already
96         ignoring the form content attribute if the element is disconnected.
97
98         [1] https://html.spec.whatwg.org/#reset-the-form-owner (step 3)
99
100         Test: fast/forms/registerFormElement-crash.html
101
102         * html/FormAssociatedElement.cpp:
103         (WebCore::FormAssociatedElement::didMoveToNewDocument):
104         Only call resetFormAttributeTargetObserver() if inDocument flag is set,
105         similarly to what is done at other call sites.
106
107         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
108         Add an assertion to make sure no one call this method on an element that
109         is not connected.
110
111         * html/HTMLFormElement.cpp:
112         (WebCore::HTMLFormElement::formElementIndex):
113         Ignore the form content attribute if the element is not connected, as
114         per the HTML specification [1].
115
116 2017-02-09  Antti Koivisto  <antti@apple.com>
117
118         Tear down existing renderers when adding a shadow root.
119         https://bugs.webkit.org/show_bug.cgi?id=167117
120
121         Reviewed by Andreas Kling.
122
123         Adding a shadow root may cause children no longer be part of the flat tree. If they had renderers
124         tear down code would no longer reach them.
125
126         Test: fast/shadow-dom/attach-shadow-teardown.html
127
128         * dom/Element.cpp:
129         (WebCore::Element::addShadowRoot):
130
131             Tear down existing render tree when adding a shadow root.
132
133 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
134
135         Handle synchronous layout when setting a selection range
136         https://bugs.webkit.org/show_bug.cgi?id=167092
137         <rdar://problem/30041640>
138
139         Reviewed by Antti Koivisto.
140
141         The 'innerTextElement' of a form control can change during layout due
142         to arbitrary JavaScript executing. Handle the case where the inner text
143         element has changed so that current render box height is while setting
144         a selection range.
145
146         Test: fast/forms/input-type-change-during-selection.html
147
148         * html/HTMLTextFormControlElement.cpp:
149         (WebCore::HTMLTextFormControlElement::setSelectionRange):
150
151 2017-02-09  Alex Christensen  <achristensen@webkit.org>
152
153         Fix CMake build.
154
155         * PlatformMac.cmake:
156
157 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
158
159         Disconnect shadow children of root when detaching a frame
160         https://bugs.webkit.org/show_bug.cgi?id=166851
161         <rdar://problem/29930443>
162
163         Reviewed by Andy Estes.
164
165         If the root of the tree we are disconnecting has a shadow element, include it in the set of
166         things to disconnect.
167
168         Tests: fast/shadow-dom/shadow-at-root-during-disconnect.html
169
170         * dom/ContainerNodeAlgorithms.cpp:
171         (WebCore::disconnectSubframes):
172
173 2017-02-09  Alexey Proskuryakov  <ap@apple.com>
174
175         Remove unused WebThreadRunSync
176         https://bugs.webkit.org/show_bug.cgi?id=168024
177
178         Reviewed by Tim Horton.
179
180         * platform/ios/wak/WebCoreThreadRun.cpp:
181         * platform/ios/wak/WebCoreThreadRun.h:
182         * platform/ios/wak/WebCoreThreadSystemInterface.cpp:
183         (InitWebCoreThreadSystemInterface):
184
185 2017-02-09  Ryan Haddad  <ryanhaddad@apple.com>
186
187         Unreviewed, rolling out r211802.
188
189         This change caused fast/regions/inline-block-inside-anonymous-
190         overflow-with-covered-controls.html to be a flaky failure.
191
192         Reverted changeset:
193
194         "[Modern Media Controls] Improve handling of <video> with only
195         audio tracks"
196         https://bugs.webkit.org/show_bug.cgi?id=167836
197         http://trac.webkit.org/changeset/211802
198
199 2017-02-09  Alex Christensen  <achristensen@webkit.org>
200
201         Fix i386 libwebrtc build
202         https://bugs.webkit.org/show_bug.cgi?id=168038
203
204         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
205         DataChannelInterface::buffered_amount returns a uint64_t, and we want a size_t.
206         If this overflows, then we've run out of memory and crashed a long time ago.
207
208 2017-02-09  Andreas Kling  <akling@apple.com>
209
210         Document::settings() should return a const Settings&.
211         <https://webkit.org/b/168061>
212
213         Reviewed by Geoffrey Garen.
214
215         - Make Document::settings() return a const reference.
216         - Added Document::mutableSettings() for all your non-const needs.
217         - Fixed up settings generator to produce const getters.
218         - Simplify a few settings() call sites that exposed themselves.
219
220         * Modules/applepay/ApplePaySession.cpp:
221         (WebCore::shouldDiscloseApplePayCapability):
222         * Modules/mediastream/UserMediaRequest.cpp:
223         (WebCore::canCallGetUserMedia):
224         * css/CSSFontFace.cpp:
225         (WebCore::CSSFontFace::appendSources):
226         * css/CSSFontSelector.cpp:
227         (WebCore::resolveGenericFamily):
228         * css/StyleResolver.h:
229         (WebCore::StyleResolver::settings):
230         * dom/Document.h:
231         (WebCore::Document::settings):
232         (WebCore::Document::mutableSettings):
233         * html/FTPDirectoryDocument.cpp:
234         (WebCore::createTemplateDocumentData):
235         * html/HTMLCanvasElement.cpp:
236         (WebCore::shouldEnableWebGL):
237         * html/HTMLEmbedElement.cpp:
238         (WebCore::HTMLEmbedElement::rendererIsNeeded):
239         * html/HTMLSelectElement.cpp:
240         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
241         * html/ImageDocument.cpp:
242         (WebCore::ImageDocument::updateDuringParsing):
243         * page/csp/ContentSecurityPolicy.cpp:
244         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
245         * page/make_settings.pl:
246         (printGetterAndSetter):
247         * rendering/SimpleLineLayout.cpp:
248         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
249
250 2017-02-09  Jer Noble  <jer.noble@apple.com>
251
252         Make passing PlatformAudioData in audioSamplesAvaliable const-correct.
253         https://bugs.webkit.org/show_bug.cgi?id=168051
254
255         Reviewed by Eric Carlson.
256
257         Modify all the functions which take a (conceptually) read-only audio buffer const-correct.
258
259         Drive-by fix: AudioSampleBufferList::copyFrom() set a ivar pointer to the passed in
260         AudioBufferList. Ensure that the ivar is reset when copyFrom() returns by using a
261         SetForScope.
262
263         * platform/audio/mac/AudioSampleBufferList.cpp:
264         (WebCore::AudioSampleBufferList::copyFrom):
265         * platform/audio/mac/AudioSampleBufferList.h:
266         * platform/audio/mac/AudioSampleDataSource.cpp:
267         (WebCore::AudioSampleDataSource::pushSamplesInternal):
268         (WebCore::AudioSampleDataSource::pushSamples):
269         * platform/audio/mac/AudioSampleDataSource.h:
270         * platform/mediastream/RealtimeMediaSource.cpp:
271         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
272         * platform/mediastream/RealtimeMediaSource.h:
273         (WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
274         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
275         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
276         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
277         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
278         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
279         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
280
281 2017-02-09  Jer Noble  <jer.noble@apple.com>
282
283         Fix some logging statements in MediaPlayerPrivateMediaStreamAVFObjC
284         https://bugs.webkit.org/show_bug.cgi?id=168063
285
286         Reviewed by Eric Carlson.
287
288         Make the format string match the types passed in (i.e., floats, not strings).
289
290         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
291         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes):
292
293 2017-02-09  Eric Carlson  <eric.carlson@apple.com>
294
295         [MediaStream Mac] Handle NULL m_sampleBufferDisplayLayer
296         https://bugs.webkit.org/show_bug.cgi?id=168060
297
298         Reviewed by Jer Noble.
299
300         No new tests, this avoids an occasional crash on the bots.
301
302         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
303         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Don't assume
304         m_sampleBufferDisplayLayer is valid.
305
306 2017-02-09  Chris Dumez  <cdumez@apple.com>
307
308         Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
309         https://bugs.webkit.org/show_bug.cgi?id=167964
310
311         Reviewed by Youenn Fablet.
312
313         Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
314         after the following WebIDL spec change:
315         - https://github.com/heycam/webidl/issues/96
316
317         This aligns our behavior with other browsers as the spec has been updated to match
318         the majority.
319
320         No new tests, rebaselined existing test.
321
322         * bindings/scripts/CodeGeneratorJS.pm:
323         (GenerateConstructorHelperMethods):
324         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
325         (WebCore::JSTestCallbackInterfaceConstructor::prototypeForStructure):
326
327 2017-02-09  Miguel Gomez  <magomez@igalia.com>
328
329         [GTK] scroll with transparent background not repainted after scrollY >= 32768
330         https://bugs.webkit.org/show_bug.cgi?id=154283
331
332         Reviewed by Carlos Garcia Campos.
333
334         Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
335         not able to draw anything when using transformation matrices with values bigger than 32768. When
336         drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
337         draw anything in, which causes the reported transparent backgrounds.
338
339         The patch modifies the transformation matrices both from the current context and the pattern we
340         are painting, to avoid them to hold values that cannot stored in 16 bits.
341
342         There's still the possibility that this happens, but it would require using a pattern with a size
343         bigger than 32768.
344
345         Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.
346
347         No new tests.
348
349         * platform/graphics/cairo/CairoUtilities.cpp:
350         (WebCore::drawPatternToCairoContext):
351
352 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
353
354         Unreviewed build fix after r211965.
355
356         * dom/Document.cpp:
357         (WebCore::Document::adoptNode): inDocument -> isConnected
358
359 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
360
361         Adopting a child node of a script element can run script
362         https://bugs.webkit.org/show_bug.cgi?id=167318
363
364         Reviewed by Darin Adler.
365
366         The bug was caused by ScriptElement::childrenChanged indiscriminately running the script.
367         Do this only if some node has been inserted as spec'ed:
368
369         https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model
370         "The script element is connected and a node or document fragment is inserted into
371         the script element, after any script elements inserted at that time."
372
373         Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate
374         non-contents child such as text and element being removed or inserted. New behavior matches that of
375         Gecko and Chrome as well as the latest HTML5 specification.
376
377         Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees
378         internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII
379         object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's
380         ensureCustomFontData used to completely disable this assertion but we no longer have to do this either.
381
382         To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with
383         the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks
384         isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent
385         held by EventAllowedScope.
386
387         Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed
388
389         Tests: fast/html/script-must-not-run-when-child-is-adopted.html
390                fast/html/script-must-not-run-when-child-is-removed.html
391
392         * dom/CharacterData.cpp:
393         (WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion.
394         * dom/ContainerNode.cpp:
395         (WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded
396         and insertBeforeCommon as done elsewhere.
397         (WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion.
398         (WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here.
399         (WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion.
400         (WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion.
401         (WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion.
402         (WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion.
403         (WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion.
404         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into
405         NoEventDispatchAssertion.
406         (WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely.
407         (WebCore::dispatchChildRemovalEvents): Ditto.
408         * dom/ContainerNode.h:
409         (WebCore::ContainerNode::ChildChange::isInsertion): Added.
410         * dom/ContainerNodeAlgorithms.cpp:
411         (WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against
412         insertionPoint since EventAllowedScope checks against the root node.
413         * dom/Document.cpp:
414         (WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else
415         remove() had resulted in an exception before calling TreeScope::adoptIfNeeded.
416         * dom/Element.cpp:
417         (WebCore::Element::childrenChanged):
418         * dom/NoEventDispatchAssertion.h:
419         (WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node.
420         If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider
421         the event dispatch to be forbidden.
422         (WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted.
423         (WebCore::NoEventDispatchAssertion::restoreDropped): Deleted.
424         (WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of
425         a given node as "safe" for the purpose of checking isEventDispatchForbidden.
426         (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain
427         of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated
428         RAII object, and each instance remembers prior instance. 
429         (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added.
430         (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given
431         node is a descendent of any node held by instances of EventAllowedScope.
432         (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function
433         for isAllowedNode.
434         * dom/Node.cpp:
435         (WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely.
436         * dom/ScriptElement.cpp:
437         (WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes.
438         (WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running
439         arbitrary author scripts can, indeed, result dispatch any events.
440         * dom/ScriptElement.h:
441         * html/HTMLElement.cpp:
442         (WebCore::textToFragment): Made this a static local function and not return an exception since there
443         is no way appendChild called in this function can throw an exception.
444         (WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by
445         HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on
446         a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts.
447         Because of the precise-ness of this check, this does not disable the assertion for "this" element.
448         HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark
449         the shadow tree into which the fragment is inserted safe.
450         (WebCore::HTMLElement::setOuterText):
451         * html/HTMLElement.h:
452         * html/HTMLScriptElement.cpp:
453         (WebCore::HTMLScriptElement::childrenChanged):
454         * html/HTMLTextFormControlElement.cpp:
455         (WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText).
456         * html/track/VTTCue.cpp:
457         (WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since
458         the VTT tree is never exposed to author scripts.
459         (WebCore::VTTCue::updateDisplayTree): Ditto.
460         * loader/cache/CachedSVGFont.cpp:
461         (WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on
462         the new SVG document we just created instead of disabling for all DOM trees.
463         * svg/SVGScriptElement.cpp:
464         (WebCore::SVGScriptElement::childrenChanged):
465
466 2017-02-09  Andreas Kling  <akling@apple.com>
467
468         Document should always have a Settings.
469         <https://webkit.org/b/120172>
470
471         Reviewed by Antti Koivisto.
472
473         Since a Document can't move between Frames, and it's either frameless
474         or partnered with a Frame provided at construction time, we know that
475         it will never need to switch between different Settings objects either.
476
477         Give Document a Ref<Settings> that contains either the Frame's Settings
478         or a default-constructed Settings object if frameless.
479         Document::settings() is promoted to a reference getter.
480
481         The bulk of this patch is removing now-unnecessary null checks.
482
483         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
484         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
485         * Modules/plugins/PluginReplacement.h:
486         (WebCore::ReplacementPlugin::isEnabledBySettings):
487         * Modules/plugins/QuickTimePluginReplacement.h:
488         * Modules/plugins/QuickTimePluginReplacement.mm:
489         (WebCore::QuickTimePluginReplacement::isEnabledBySettings):
490         * Modules/plugins/YouTubePluginReplacement.cpp:
491         (WebCore::YouTubePluginReplacement::isEnabledBySettings):
492         * Modules/plugins/YouTubePluginReplacement.h:
493         * Modules/webaudio/AudioContext.cpp:
494         (WebCore::AudioContext::constructCommon):
495         * bindings/js/CachedScriptFetcher.cpp:
496         (WebCore::CachedScriptFetcher::requestScriptWithCache):
497         * css/CSSFontFace.cpp:
498         (WebCore::CSSFontFace::appendSources):
499         (WebCore::CSSFontFace::webFontsShouldAlwaysFallBack):
500         * css/CSSFontSelector.cpp:
501         (WebCore::CSSFontSelector::fallbackFontCount):
502         (WebCore::CSSFontSelector::fallbackFontAt):
503         * css/StyleBuilderConverter.h:
504         (WebCore::StyleBuilderConverter::convertResize):
505         * css/StyleBuilderCustom.h:
506         (WebCore::StyleBuilderCustom::applyValueFontFamily):
507         * css/StyleResolver.cpp:
508         (WebCore::StyleResolver::StyleResolver):
509         (WebCore::StyleResolver::defaultStyleForElement):
510         (WebCore::StyleResolver::adjustRenderStyle):
511         (WebCore::StyleResolver::checkForGenericFamilyChange):
512         (WebCore::StyleResolver::initializeFontStyle):
513         * css/StyleResolver.h:
514         (WebCore::StyleResolver::settings):
515         (WebCore::StyleResolver::documentSettings): Deleted.
516         * css/parser/CSSParser.cpp:
517         (WebCore::CSSParserContext::CSSParserContext):
518         * dom/Document.cpp:
519         (WebCore::Document::Document):
520         (WebCore::Document::setReadyState):
521         (WebCore::Document::setVisualUpdatesAllowed):
522         (WebCore::Document::defaultCharsetForLegacyBindings):
523         (WebCore::Document::recalcStyle):
524         (WebCore::Document::implicitClose):
525         (WebCore::Document::minimumLayoutDelay):
526         (WebCore::Document::setDomain):
527         (WebCore::Document::audioPlaybackRequiresUserGesture):
528         (WebCore::Document::videoPlaybackRequiresUserGesture):
529         (WebCore::Document::storageBlockingStateDidChange):
530         (WebCore::Document::isTelephoneNumberParsingEnabled):
531         (WebCore::Document::initSecurityContext):
532         (WebCore::Document::initDNSPrefetch):
533         (WebCore::Document::getCachedLocale):
534         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox):
535         (WebCore::Document::settings): Deleted.
536         * dom/Document.h:
537         (WebCore::Document::settings):
538         * dom/Element.cpp:
539         (WebCore::subpixelMetricsEnabled):
540         * dom/ExtensionStyleSheets.cpp:
541         (WebCore::ExtensionStyleSheets::pageUserSheet):
542         * dom/ScriptExecutionContext.cpp:
543         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
544         * dom/ScriptableDocumentParser.cpp:
545         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
546         * dom/ScriptedAnimationController.cpp:
547         (WebCore::ScriptedAnimationController::requestAnimationFrameEnabled):
548         * dom/make_names.pl:
549         (printConstructorInterior):
550         * editing/Editor.cpp:
551         * editing/markup.cpp:
552         (WebCore::createMarkupInternal):
553         * html/FTPDirectoryDocument.cpp:
554         (WebCore::createTemplateDocumentData):
555         * html/HTMLAnchorElement.cpp:
556         (WebCore::HTMLAnchorElement::setActive):
557         (WebCore::HTMLAnchorElement::sendPings):
558         (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
559         * html/HTMLAppletElement.cpp:
560         (WebCore::HTMLAppletElement::canEmbedJava):
561         * html/HTMLCanvasElement.cpp:
562         (WebCore::HTMLCanvasElement::getContext2d):
563         (WebCore::shouldEnableWebGL):
564         (WebCore::HTMLCanvasElement::shouldAccelerate):
565         * html/HTMLFormElement.cpp:
566         (WebCore::HTMLFormElement::submitImplicitly):
567         * html/HTMLFrameElementBase.cpp:
568         (WebCore::HTMLFrameElementBase::setLocation):
569         * html/HTMLImageElement.cpp:
570         (WebCore::HTMLImageElement::updateImageControls):
571         * html/HTMLImageLoader.cpp:
572         (WebCore::HTMLImageLoader::sourceURI):
573         * html/HTMLInputElement.cpp:
574         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
575         * html/HTMLLinkElement.cpp:
576         (WebCore::HTMLLinkElement::process):
577         * html/HTMLMediaElement.cpp:
578         (WebCore::HTMLMediaElement::HTMLMediaElement):
579         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
580         (WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
581         (WebCore::HTMLMediaElement::enterFullscreen):
582         (WebCore::HTMLMediaElement::exitFullscreen):
583         (WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks):
584         (WebCore::HTMLMediaElement::mediaPlayerNetworkInterfaceName):
585         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
586         (WebCore::HTMLMediaElement::doesHaveAttribute):
587         * html/HTMLVideoElement.cpp:
588         (WebCore::HTMLVideoElement::HTMLVideoElement):
589         * html/MediaElementSession.cpp:
590         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
591         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
592         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading):
593         (WebCore::MediaElementSession::allowsPictureInPicture):
594         (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
595         * html/parser/HTMLParserOptions.cpp:
596         (WebCore::HTMLParserOptions::HTMLParserOptions):
597         * html/shadow/MediaControlElements.cpp:
598         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
599         * loader/LinkLoader.cpp:
600         (WebCore::LinkLoader::loadLink):
601         * page/csp/ContentSecurityPolicy.cpp:
602         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
603         * rendering/SimpleLineLayout.cpp:
604         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
605         * style/StyleFontSizeFunctions.cpp:
606         (WebCore::Style::computedFontSizeFromSpecifiedSize):
607         (WebCore::Style::fontSizeForKeyword):
608         (WebCore::Style::legacyFontSizeForPixelSize):
609         * style/StyleScope.cpp:
610         (WebCore::Style::Scope::collectActiveStyleSheets):
611         * xml/XMLHttpRequest.cpp:
612         (WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode):
613
614 2017-02-09  Antti Koivisto  <antti@apple.com>
615
616         Use all cacheable speculatively loaded responses
617         https://bugs.webkit.org/show_bug.cgi?id=168052
618
619         Reviewed by Andreas Kling.
620
621         * platform/network/CacheValidation.cpp:
622         (WebCore::isStatusCodeCacheableByDefault):
623         (WebCore::isStatusCodePotentiallyCacheable):
624
625         Moved here from WebKit2.
626
627         * platform/network/CacheValidation.h:
628
629 2017-02-09  Eric Carlson  <eric.carlson@apple.com>
630
631         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
632         https://bugs.webkit.org/show_bug.cgi?id=168016
633
634         Reviewed by Youenn Fablet.
635
636         No new tests, existing tests updated.
637
638         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
639         * DerivedSources.make: Ditto.
640         * CMakeLists.txt: Ditto.
641         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
642         * Modules/mediastream/NavigatorUserMedia.js: Removed.
643         * WebCore.xcodeproj/project.pbxproj:
644         * page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.
645
646 2017-02-09  Antoine Quint  <graouts@apple.com>
647
648         [Modern Media Controls] Tapping the skip back button on iOS inline media controls make the controls disappear
649         https://bugs.webkit.org/show_bug.cgi?id=168049
650         <rdar://problem/30442660>
651
652         Reviewed by Eric Carlson.
653
654         Calling elementAtPoint() on the Document will not return an element in the ShadowRoot,
655         we need to call it on the ShadowRoot. So we now iterate over ancestors of the controls
656         bar to find the ShadowRoot, if any, and check whether the tapped element is contained
657         within the controls bar. We only fade the controls bar out if the tapped element is
658         outside of the controls bar hierarchy.
659
660         Test: media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html
661
662         * Modules/modern-media-controls/controls/controls-bar.js:
663         (ControlsBar.prototype.gestureRecognizerStateDidChange):
664
665 2017-02-09  Jer Noble  <jer.noble@apple.com>
666
667         Configure MockRealtimeAudioSourceMac to generate stereo audio
668         https://bugs.webkit.org/show_bug.cgi?id=168027
669
670         Reviewed by Eric Carlson.
671
672         Update MockRealtimeAudioSourceMac to generate stereo audio.
673
674         First, because the pattern of creating a AudioBufferList structure (with all it's quirks and
675         weird requirements) was repeated multiple places, add a new wrapper around ABL called
676         WebAudioBufferList which takes care of correctly initializing the ABL structure and manages
677         the lifetime of its data members.
678
679         * WebCore.xcodeproj/project.pbxproj:
680         * platform/audio/PlatformAudioData.h: Added.
681         (WebCore::PlatformAudioData::kind):
682         * platform/audio/WebAudioBufferList.cpp: Added.
683         (WebCore::WebAudioBufferList::WebAudioBufferList):
684         (WebCore::WebAudioBufferList::buffers):
685         (WebCore::WebAudioBufferList::bufferCount):
686         (WebCore::WebAudioBufferList::buffer):
687         * platform/audio/WebAudioBufferList.h: Added.
688         (WebCore::WebAudioBufferList::list):
689         (WebCore::WebAudioBufferList::operator AudioBufferList&):
690         (WebCore::WebAudioBufferList::kind):
691         (isType):
692
693         Then update existing code to work in terms of WebAudioBufferList:
694
695         * platform/audio/mac/AudioSampleBufferList.cpp:
696         (WebCore::AudioSampleBufferList::AudioSampleBufferList):
697         (WebCore::AudioSampleBufferList::mixFrom):
698         (WebCore::AudioSampleBufferList::copyFrom):
699         (WebCore::AudioSampleBufferList::copyTo):
700         (WebCore::AudioSampleBufferList::reset):
701         (WebCore::AudioSampleBufferList::configureBufferListForStream): Deleted.
702         * platform/audio/mac/AudioSampleBufferList.h:
703         (WebCore::AudioSampleBufferList::bufferList):
704         * platform/audio/mac/AudioSampleDataSource.cpp:
705         (WebCore::AudioSampleDataSource::pushSamples):
706         * platform/audio/mac/AudioSampleDataSource.h:
707         * platform/mediastream/RealtimeMediaSource.cpp:
708         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
709         * platform/mediastream/RealtimeMediaSource.h:
710         (WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
711         * platform/mediastream/mac/AVAudioCaptureSource.h:
712         * platform/mediastream/mac/AVAudioCaptureSource.mm:
713         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
714         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
715         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
716         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
717         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
718         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
719         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
720
721         Finally, actually update MockRealtimeAudioSource to emit stereo samples. Importantly, set
722         the correct values for the m_streamFormat; mBytesPerFrame and mBytesPerPacket are not
723         multiplied by the channelCount. When generating audio, write to both channels of data.
724
725         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
726         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
727         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
728         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
729         (WebCore::MockRealtimeAudioSourceMac::render):
730
731 2017-02-09  Antti Koivisto  <antti@apple.com>
732
733         Nullptr crash under styleForFirstLetter
734         https://bugs.webkit.org/show_bug.cgi?id=167756
735         rdar://problem/30029354
736
737         Reviewed by Zalan Bujtas.
738
739         Don't know how we get here. Paper over the crash.
740
741         * rendering/RenderBlock.cpp:
742         (WebCore::styleForFirstLetter):
743
744             Use parent first line style if we compute null style for the first letter renderer.
745
746 2017-02-09  Antoine Quint  <graouts@apple.com>
747
748         [Modern Media Controls] Playing an <audio> element on iOS makes the controls disappear
749         https://bugs.webkit.org/show_bug.cgi?id=168047
750         <rdar://problem/30441939>
751
752         Reviewed by Eric Carlson.
753
754         The controls bar auto-hide behavior is disabled for <audio> elements, but on iOS we have
755         a TapGestureRecognizer to identify when controls are tapped to toggle controls visibility.
756         This gesture recognizer would be on at all times, but it should only be enabled when
757         fadesToIdle is set to true.
758
759         Test: media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html
760
761         * Modules/modern-media-controls/controls/controls-bar.js:
762         (ControlsBar.prototype.set fadesWhileIdle):
763
764 2017-02-09  Antoine Quint  <graouts@apple.com>
765
766         [Modern Media Controls] <audio> element does not show any background on iOS
767         https://bugs.webkit.org/show_bug.cgi?id=168046
768         <rdar://problem/30441872>
769
770         Reviewed by Eric Carlson.
771
772         Use a solid gray background for <audio> elements on iOS.
773
774         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html
775
776         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
777         (:host(audio) .media-controls.ios.inline > .controls-bar:before):
778
779 2017-02-09  Antoine Quint  <graouts@apple.com>
780
781         [Modern Media Controls] Controls fail to instantiate in an XHTML document
782         https://bugs.webkit.org/show_bug.cgi?id=168045
783         <rdar://problem/30290095>
784
785         Reviewed by Eric Carlson.
786
787         Always use valid HTML and XHTML strings when creating HTML elements.
788
789         Test: media/modern-media-controls/media-controller/media-controller-in-xhtml.xhtml
790
791         * Modules/modern-media-controls/controls/button.js:
792         (Button):
793         * Modules/modern-media-controls/controls/buttons-container.js:
794         * Modules/modern-media-controls/controls/controls-bar.js:
795         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
796         * Modules/modern-media-controls/controls/media-controls.js:
797         * Modules/modern-media-controls/controls/slider.js:
798         * Modules/modern-media-controls/controls/status-label.js:
799         * Modules/modern-media-controls/controls/time-control.js:
800         * Modules/modern-media-controls/controls/time-label.js:
801         * Modules/modern-media-controls/controls/tracks-panel.js:
802
803 2017-02-09  Michael Catanzaro  <mcatanzaro@igalia.com>
804
805         Unreviewed, fix typo in comment
806
807         * loader/DocumentWriter.cpp:
808         (WebCore::DocumentWriter::replaceDocument):
809
810 2017-02-09  Andreas Kling  <akling@apple.com>
811
812         Disallow accelerated rendering for ginormous 2D canvases.
813         <https://webkit.org/b/167968>
814         <rdar://problem/30119483>
815
816         Reviewed by Antti Koivisto.
817
818         Add a "maximumAccelerated2dCanvasSize" setting that defaults to 5120x2880
819         which is the 5K resolution for 16:9.
820
821         Also added a way to include the "accelerates drawing" flag in layer tree dumps.
822
823         Test: compositing/canvas/accelerated-canvas-compositing-size-limit.html
824
825         * html/HTMLCanvasElement.cpp:
826         (WebCore::HTMLCanvasElement::shouldAccelerate):
827         * page/Frame.h:
828         * page/Settings.in:
829         * platform/graphics/GraphicsLayer.cpp:
830         (WebCore::GraphicsLayer::dumpProperties):
831         * platform/graphics/GraphicsLayerClient.h:
832         * rendering/RenderLayerCompositor.cpp:
833         (WebCore::RenderLayerCompositor::layerTreeAsText):
834         * testing/Internals.cpp:
835         (WebCore::toLayerTreeFlags):
836         * testing/Internals.h:
837         * testing/Internals.idl:
838
839 2017-02-09  Antti Koivisto  <antti@apple.com>
840
841         Remove most cases of #if ENABLE(CACHE_PARTITIONING)
842         https://bugs.webkit.org/show_bug.cgi?id=167990
843
844         Reviewed by Sam Weinig.
845
846         We'll just return empty string for the partition if partitioning is not enabled.
847
848         * html/DOMURL.cpp:
849         (WebCore::DOMURL::revokeObjectURL):
850         * inspector/InspectorPageAgent.cpp:
851         (WebCore::InspectorPageAgent::cachedResource):
852         * loader/FrameLoader.cpp:
853         (WebCore::FrameLoader::loadURL):
854         * loader/archive/cf/LegacyWebArchive.cpp:
855         (WebCore::LegacyWebArchive::create):
856         * loader/cache/CachedResource.h:
857         (WebCore::CachedResource::url):
858         (WebCore::CachedResource::cachePartition):
859         * loader/cache/CachedResourceLoader.cpp:
860         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
861         (WebCore::CachedResourceLoader::requestResource):
862         * loader/cache/CachedResourceRequest.cpp:
863         (WebCore::CachedResourceRequest::setDomainForCachePartition):
864         * loader/cache/CachedResourceRequest.h:
865         * loader/cache/MemoryCache.cpp:
866         (WebCore::MemoryCache::add):
867         (WebCore::MemoryCache::revalidationSucceeded):
868         (WebCore::MemoryCache::resourceForRequestImpl):
869         (WebCore::MemoryCache::addImageToCache):
870         (WebCore::MemoryCache::removeImageFromCache):
871         (WebCore::MemoryCache::remove):
872         (WebCore::MemoryCache::removeResourcesWithOrigin):
873         (WebCore::MemoryCache::removeResourcesWithOrigins):
874         (WebCore::MemoryCache::getOriginsWithCache):
875         (WebCore::MemoryCache::originsWithCache):
876         * loader/cache/MemoryCache.h:
877         * page/SecurityOrigin.cpp:
878         (WebCore::SecurityOrigin::domainForCachePartition):
879         * page/SecurityOrigin.h:
880         * platform/SchemeRegistry.cpp:
881         (WebCore::cachePartitioningSchemes):
882         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
883         * platform/SchemeRegistry.h:
884         * platform/ios/WebCoreSystemInterfaceIOS.mm:
885         * platform/mac/WebCoreSystemInterface.h:
886         * platform/mac/WebCoreSystemInterface.mm:
887         * platform/network/ResourceRequestBase.cpp:
888         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
889         (WebCore::ResourceRequestBase::setCachePartition):
890         (WebCore::ResourceRequestBase::partitionName):
891         * platform/network/ResourceRequestBase.h:
892         (WebCore::ResourceRequestBase::cachePartition):
893         (WebCore::ResourceRequestBase::setDomainForCachePartition):
894         * platform/network/cf/ResourceRequest.h:
895         (WebCore::ResourceRequest::cachePartition): Deleted.
896         (WebCore::ResourceRequest::setCachePartition): Deleted.
897         (WebCore::ResourceRequest::setDomainForCachePartition): Deleted.
898         * platform/network/cf/ResourceRequestCFNet.cpp:
899         (WebCore::ResourceRequest::doUpdatePlatformRequest):
900         (WebCore::ResourceRequest::doUpdateResourceRequest):
901         (WebCore::ResourceRequest::partitionName): Deleted.
902         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy): Deleted.
903         * platform/network/cf/ResourceResponse.h:
904         * platform/network/cocoa/ResourceRequestCocoa.mm:
905         (WebCore::ResourceRequest::doUpdateResourceRequest):
906         (WebCore::ResourceRequest::doUpdatePlatformRequest):
907         * testing/Internals.cpp:
908         (WebCore::Internals::isLoadingFromMemoryCache):
909
910 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
911
912         Add Web Bluetooth as Not Considering
913         https://bugs.webkit.org/show_bug.cgi?id=168042
914
915         Reviewed by Yusuke Suzuki.
916
917         Add Web Bluetooth as a feature not being considered to be implemented in WebKit.
918
919         * features.json:
920
921 2017-02-08  Simon Fraser  <simon.fraser@apple.com>
922
923         Put names on more UIViews for ease of debugging
924         https://bugs.webkit.org/show_bug.cgi?id=168035
925
926         Reviewed by Tim Horton.
927
928         Name the page overlay layers.
929
930         * page/PageOverlayController.cpp:
931         (WebCore::PageOverlayController::createRootLayersIfNeeded):
932         (WebCore::PageOverlayController::installPageOverlay):
933
934 2017-02-08  Commit Queue  <commit-queue@webkit.org>
935
936         Unreviewed, rolling out r211912.
937         https://bugs.webkit.org/show_bug.cgi?id=168034
938
939         http/tests/media/media-stream/disconnected-frame-permission-
940         denied.html should be updated (Requested by youenn on
941         #webkit).
942
943         Reverted changeset:
944
945         "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
946         https://bugs.webkit.org/show_bug.cgi?id=168016
947         http://trac.webkit.org/changeset/211912
948
949 2017-02-08  Youenn Fablet  <youennf@gmail.com>
950
951         HTML Link elements should load data URLs as same origin
952         https://bugs.webkit.org/show_bug.cgi?id=168032
953         <rdar://problem/30275036>
954
955         Reviewed by Alex Christensen.
956
957         Test: fast/dom/data-url-css-link-element-cors-active.html
958
959         Making CSS data URLs resources considered as same origin when loaded through link elements.
960         In the future, we should consider remove the data URL same origin flag and fully align with the fetch and HTML spec.
961
962         * html/HTMLLinkElement.cpp:
963         (WebCore::HTMLLinkElement::process):
964
965 2017-02-08  Sam Weinig  <sam@webkit.org>
966
967         REGRESSION (r193286): Promise chain no longer prevent UI refresh
968         <rdar://problem/28062149>
969         https://bugs.webkit.org/show_bug.cgi?id=161291
970
971         Reviewed by Geoffrey Garen.
972
973         Add new subtest to js/dom/Promise.html
974
975         * dom/Microtasks.cpp:
976         (WebCore::MicrotaskQueue::append):
977         (WebCore::MicrotaskQueue::remove):
978         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
979         * dom/Microtasks.h:
980         The microtask queue needs to be completely drained, even of new microtasks added while
981         the previous task was run. Remove the m_tasksAppendedDuringMicrotaskCheckpoint as it is
982         no longer needed.
983
984 2017-02-08  Eric Carlson  <eric.carlson@apple.com>
985
986         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
987         https://bugs.webkit.org/show_bug.cgi?id=168016
988
989         Reviewed by Youenn Fablet.
990
991         No new tests, existing tests updated.
992
993         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
994         * DerivedSources.make: Ditto.
995         * CMakeLists.txt: Ditto.
996         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
997         * Modules/mediastream/NavigatorUserMedia.js: Removed.
998         * WebCore.xcodeproj/project.pbxproj:
999         * page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.
1000
1001 2017-02-08  Chris Dumez  <cdumez@apple.com>
1002
1003         Use smaller tiles in windows that are not active to facilitate App Napping
1004         https://bugs.webkit.org/show_bug.cgi?id=167997
1005         <rdar://problem/30358835>
1006
1007         Reviewed by Simon Fraser.
1008
1009         Use smaller / non-adaptative tiles in windows that are not active to facilitate
1010         App Napping after <https://trac.webkit.org/r197594>.
1011
1012         Test: compositing/tiling/non-active-window-tiles-size.html
1013
1014         * page/FrameView.cpp:
1015         (WebCore::FrameView::contentsResized):
1016         (WebCore::FrameView::addedOrRemovedScrollbar):
1017         (WebCore::FrameView::computeScrollability):
1018         (WebCore::FrameView::updateTiledBackingAdaptiveSizing):
1019         (WebCore::FrameView::unobscuredContentSizeChanged):
1020         (WebCore::FrameView::setViewExposedRect):
1021         * page/FrameView.h:
1022         * page/Page.cpp:
1023         (WebCore::Page::setActivityState):
1024         (WebCore::Page::isWindowActive):
1025         * page/Page.h:
1026         * platform/graphics/TiledBacking.h:
1027         * platform/graphics/ca/TileController.cpp:
1028         (WebCore::TileController::setTileSizeUpdateDelayDisabledForTesting):
1029         (WebCore::TileController::notePendingTileSizeChange):
1030         * platform/graphics/ca/TileController.h:
1031         * testing/Internals.cpp:
1032         (WebCore::Internals::resetToConsistentState):
1033         (WebCore::Internals::disableTileSizeUpdateDelay):
1034         * testing/Internals.h:
1035         * testing/Internals.idl:
1036
1037 2017-02-08  Chris Dumez  <cdumez@apple.com>
1038
1039         Unreviewed, rolling out r211907.
1040
1041         Broke the build
1042
1043         Reverted changeset:
1044
1045         "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
1046         https://bugs.webkit.org/show_bug.cgi?id=168016
1047         http://trac.webkit.org/changeset/211907
1048
1049 2017-02-08  Eric Carlson  <eric.carlson@apple.com>
1050
1051         [MediaStream] Remove legacy Navigator.webkitGetUserMedia
1052         https://bugs.webkit.org/show_bug.cgi?id=168016
1053
1054         Reviewed by Youenn Fablet.
1055
1056         No new tests, existing tests updated.
1057
1058         * WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
1059         * DerivedSources.make: Ditto.
1060         * CMakeLists.txt: Ditto.
1061         * Modules/mediastream/NavigatorUserMedia.idl: Removed.
1062         * Modules/mediastream/NavigatorUserMedia.js: Removed.
1063         * WebCore.xcodeproj/project.pbxproj:
1064
1065 2017-02-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1066
1067         Add kUTTypeUTF8PlainText and kUTTypeJPEG to the list of compatible content types in DragData
1068         https://bugs.webkit.org/show_bug.cgi?id=167942
1069         <rdar://problem/30315079>
1070
1071         Reviewed by Tim Horton.
1072
1073         Adds UTI types for dragging UTF8 plain text and JPEG images to the list of supported types in DragDataMac.mm.
1074         Also handles reading these types in PasteboardMac.mm. I verified manually with a test app that if a platform
1075         NSView vends only UTF8 plaintext or JPEG images when dragging, WebKit is able to read the contents of the
1076         pasteboard as text and an image, respectively.
1077
1078         New TestWebKitAPI tests in DragAndDropPasteboardTests.mm.
1079
1080         * platform/mac/DragDataMac.mm:
1081         (WebCore::DragData::containsCompatibleContent):
1082         * platform/mac/PasteboardMac.mm:
1083         (WebCore::Pasteboard::read):
1084
1085 2017-02-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1086
1087         getIntersectionList always returns empty NodeList until layout is complete
1088         https://bugs.webkit.org/show_bug.cgi?id=81423
1089
1090         Reviewed by Simon Fraser.
1091
1092         Layout needs to be forced before trying to figure out which SVGElements
1093         intersect with a given SVGRect. We do the same thing in the DOM API
1094         Element::getBoundingClientRect().
1095
1096         Test: svg/custom/intersection-list-before-layout.html
1097
1098         * svg/SVGSVGElement.cpp:
1099         (WebCore::SVGSVGElement::getIntersectionList):
1100
1101 2017-02-08  Antoine Quint  <graouts@apple.com>
1102
1103         [Modern Media Controls] Implement reduced and tight padding modes
1104         https://bugs.webkit.org/show_bug.cgi?id=167933
1105         <rdar://problem/30396994>
1106
1107         Reviewed by Dean Jackson.
1108
1109         The design specs for modern media controls mandate the following for inline media controls:
1110
1111             - controls at or below 300pt width use a 12pt left margin for the left buttons container,
1112             and a 12pt right margin for the right buttons container, and 16pth button margin inside
1113             both containers ("reduced padding mode").
1114
1115             - when dropping at or below 120pt width, controls use an 8pt left margin for
1116             the left buttons container, and an 8pt right margin for the right buttons container, and
1117             12pt button margin inside both containers and a shorter bar (25pt) ("compact mode").
1118
1119             - in the case of audio controls, at 400pt or less, controls switch to 12pt margins and
1120             button margins for both buttons containers ("tight padding mode").
1121
1122         The "compact" mode was already implemented as a dedicated MacOSInlineMediaControls subclass.
1123         Since we now have a more generic need to vary the metrics used for inline media controls on
1124         macOS, we add new features to MacOSInlineMediaControls to support varying metrics based on
1125         the controls' "layoutTraits" property.
1126
1127         So MediaController is changed such that it knows to use the new TightPadding and ReducedPadding
1128         layout traits based on the conditions defined above, and _updateControlsIfNeeded() is changed
1129         to set the "layoutTraits" property on the controls whenever called, which in our case is most
1130         relevantly a "resize" event on the shadow root or a TrackEvent on the video tracks (to determine
1131         when we're possibly changing between a video and audio file).
1132
1133         As a result, the "layoutTraits" setter is called on MacOSInlineMediaControls, which updates
1134         the metrics for the various buttons containers, but also notifies the buttons contained
1135         within that layout traits may have changed, since some buttons support a "compact" appearance
1136         that is shorter and require a different image file. To that end, IconButton has been updated
1137         so that it may be notified of a layout traits change through a new layoutTraitsDidChange()
1138         method, that checks whether the current layout traits differ from those last used when loading
1139         the icon.
1140
1141         Tests: media/modern-media-controls/icon-button/icon-button-change-layout-traits.html
1142                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles.html
1143                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles.html
1144                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html
1145                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding.html
1146                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding.html
1147                media/modern-media-controls/media-controller/media-controller-compact.html
1148                media/modern-media-controls/media-controller/media-controller-reduced-padding.html
1149                media/modern-media-controls/media-controller/media-controller-tight-padding.html
1150
1151         * Modules/modern-media-controls/controls/icon-button.js:
1152         (IconButton.prototype.set iconName):
1153         (IconButton.prototype.layoutTraitsDidChange):
1154         (IconButton.prototype._loadImage):
1155         * Modules/modern-media-controls/controls/layout-item.js:
1156         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.js: Removed.
1157         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1158         (MacOSInlineMediaControls.prototype.get layoutTraits):
1159         (MacOSInlineMediaControls.prototype.set layoutTraits):
1160         (MacOSInlineMediaControls.prototype._matchLayoutTraits):
1161         * Modules/modern-media-controls/js-files:
1162         * Modules/modern-media-controls/media/media-controller.js:
1163         (MediaController):
1164         (MediaController.prototype.get layoutTraits):
1165         (MediaController.prototype.handleEvent):
1166         (MediaController.prototype._updateControlsIfNeeded):
1167         (MediaController.prototype._controlsClassForLayoutTraits):
1168         (MediaController.prototype._shouldFadeBetweenControls): Deleted.
1169         (MediaController.prototype._controlsClass): Deleted.
1170         * WebCore.xcodeproj/project.pbxproj:
1171
1172 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
1173
1174         Move private methods from WKGraphics.h to a separate header file
1175         https://bugs.webkit.org/show_bug.cgi?id=167996
1176
1177         Reviewed by Alexey  Proskuryakov.
1178
1179         * platform/ios/wak/WKGraphicsInternal.h: Added.
1180         * WebCore.xcodeproj/project.pbxproj: Added WKGraphicsInternal.h
1181         * platform/ios/wak/WKGraphics.h: Moved methods to WKGraphicsInternal.h
1182         * platform/graphics/mac/GraphicsContextMac.mm: Included new header file.
1183         * platform/ios/wak/WKGraphics.mm: Same.
1184
1185 2017-02-08  Brady Eidson  <beidson@apple.com>
1186
1187         Opt-out iBooks from synchronous willSendRequest on iOS.
1188         <rdar://problem/30129966> and https://bugs.webkit.org/show_bug.cgi?id=168006
1189
1190         Reviewed by Brent Fulgham.
1191
1192         No new tests (Not a testable behavior change at this time).
1193
1194         * platform/network/mac/ResourceHandleMac.mm:
1195         (WebCore::synchronousWillSendRequestEnabled): iBooks never gets synchronous willSendRequest:
1196
1197 2017-02-08  Sam Weinig  <sam@webkit.org>
1198
1199         Split JSDOMConstructor.h/cpp up by class
1200         https://bugs.webkit.org/show_bug.cgi?id=167958
1201
1202         Reviewed by Tim Horton.
1203
1204         Splits JSDOMConstructor up by class.
1205         - Renames DOMConstructorObject to JSDOMConstructorBase.
1206         - Renames DOMConstructorWithDocument to JSDOMConstructorWithDocument.
1207         - Renames DOMConstructorJSBuiltinObject to JSDOMBuiltinConstructorBase.
1208         - Renames JSBuiltinConstructor to JSDOMBuiltinConstructor.
1209
1210         * CMakeLists.txt:
1211         * WebCore.xcodeproj/project.pbxproj:
1212         * bindings/js/JSBindingsAllInOne.cpp:
1213         Add new files.
1214
1215         * bindings/js/JSDOMBinding.h:
1216         (WebCore::propertyNameToString): Deleted.
1217         (WebCore::propertyNameToAtomicString): Deleted.
1218         * bindings/js/JSDOMBuiltinConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
1219         * bindings/js/JSDOMBuiltinConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
1220         * bindings/js/JSDOMBuiltinConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
1221         * bindings/js/JSDOMConstructor.cpp: Removed.
1222         * bindings/js/JSDOMConstructor.h: Remove all classes other than JSDOMConstructor.
1223         * bindings/js/JSDOMConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
1224         * bindings/js/JSDOMConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
1225         * bindings/js/JSDOMConstructorNotConstructable.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
1226         * bindings/js/JSDOMConstructorWithDocument.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
1227         * bindings/js/JSDOMConstructorWithDocument.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
1228         * bindings/js/JSDOMNamedConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
1229
1230         * bindings/js/JSDOMConvertStrings.h:
1231         (WebCore::propertyNameToString):
1232         (WebCore::propertyNameToAtomicString):
1233         Move these here from JSDOMBinding.
1234
1235         * bindings/js/JSHTMLElementCustom.cpp:
1236         (WebCore::constructJSHTMLElement):
1237         * bindings/js/JSMutationObserverCustom.cpp:
1238         (WebCore::constructJSMutationObserver):
1239         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1240         * bindings/js/JSStorageCustom.cpp:
1241         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp:
1242         (WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
1243         * bindings/js/JSWorkerCustom.cpp:
1244         (WebCore::constructJSWorker):
1245         * bindings/scripts/CodeGeneratorJS.pm:
1246         (GetConstructorTemplateClassName):
1247         (GenerateConstructorDeclaration):
1248         Update includes/names.
1249
1250         * dom/StaticRange.cpp:
1251         (WebCore::StaticRange::~StaticRange):
1252         * dom/StaticRange.h:
1253         Add out-of-line destructor, so Node.h does not have to be included.
1254
1255 2017-02-08  Joseph Pecoraro  <pecoraro@apple.com>
1256
1257         Initialize the main RunLoop in iOS WebKitLegacy
1258         https://bugs.webkit.org/show_bug.cgi?id=167953
1259
1260         Reviewed by Alexey Proskuryakov.
1261
1262         * platform/ios/wak/WebCoreThread.mm:
1263         (StartWebThread):
1264         Initialize the main runloop on the main thread during iOS WebKit initialization.
1265
1266 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
1267
1268         Move private methods from WKContentObservation.h to a separate header file
1269         https://bugs.webkit.org/show_bug.cgi?id=167998
1270
1271         Reviewed by Alexey Proskuryakov.
1272
1273         * WebCore.xcodeproj/project.pbxproj: Added WKContentObservationInternal.h
1274         * platform/ios/wak/WKContentObservationInternal.h: Added.
1275         * platform/ios/wak/WKContentObservation.h: Moved methods to WKContentObservationInternal.h
1276         * platform/ios/wak/WKContentObservation.cpp: Included new header file.
1277         * page/DOMTimer.cpp: Same.
1278         * page/DOMWindow.cpp: Same.
1279         * style/RenderTreeUpdater.cpp: Same.
1280
1281 2017-02-08  Youenn Fablet  <youenn@apple.com>
1282
1283         RTCPeerConnection constructor can take null as input
1284         https://bugs.webkit.org/show_bug.cgi?id=167992
1285
1286         Reviewed by Chris Dumez.
1287
1288         Covered by updated test.
1289
1290         RTCPeerConnection takes an optional Dictionary as input.
1291         As per https://heycam.github.io/webidl/#es-dictionary, null is converted to an empty dictionary.
1292
1293         * Modules/mediastream/RTCPeerConnection.js:
1294         (initializeRTCPeerConnection):
1295
1296 2017-02-08  Andreas Kling  <akling@apple.com>
1297
1298         No need for CachedFrame to detach custom scrollbars.
1299         <https://webkit.org/b/167995>
1300
1301         Reviewed by Sam Weinig.
1302
1303         Custom scrollbars have already been torn down with the rest of the render tree
1304         by the time we're creating a CachedFrame.
1305
1306         * history/CachedFrame.cpp:
1307         (WebCore::CachedFrame::CachedFrame):
1308
1309 2017-02-08  Zalan Bujtas  <zalan@apple.com>
1310
1311         Simple line layout: Fix printReason for unsupported overflow values.
1312         https://bugs.webkit.org/show_bug.cgi?id=168000
1313
1314         Reviewed by Simon Fraser.
1315
1316         Not testable.
1317
1318         * rendering/SimpleLineLayout.cpp:
1319         (WebCore::SimpleLineLayout::canUseForStyle):
1320         (WebCore::SimpleLineLayout::printReason):
1321
1322 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
1323
1324         Remove WebCoreObjCDeallocWithWebThreadLock from header file
1325         https://bugs.webkit.org/show_bug.cgi?id=167987
1326
1327         Reviewed by Alexey Proskuryakov.
1328
1329         * platform/ios/wak/WebCoreThread.mm: Added WebCoreObjCDeallocWithWebThreadLock.
1330         * platform/ios/wak/WebCoreThreadMessage.h: Removed WebCoreObjCDeallocWithWebThreadLock.
1331
1332 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
1333
1334         Move WKMouseInRect to WAKView.mm
1335         https://bugs.webkit.org/show_bug.cgi?id=167989
1336
1337         Reviewed by Alexey Proskuryakov.
1338
1339         * platform/ios/wak/WAKAppKitStubs.h: Removed WKMouseInRect.
1340         * platform/ios/wak/WAKAppKitStubs.m:
1341         (WKMouseInRect): Deleted.
1342         * platform/ios/wak/WAKView.mm: 
1343         (-[WAKView mouse:inRect:]): Added the logic of WKMouseInRect here instead of separate function call.
1344
1345 2017-02-08  Aakash Jain  <aakash_jain@apple.com>
1346
1347         Remove unused method WebCore::PluginData::pluginNameForMimeType
1348         https://bugs.webkit.org/show_bug.cgi?id=167986
1349
1350         Reviewed by Anders Carlsson.
1351
1352         * plugins/PluginData.cpp:
1353         (WebCore::PluginData::pluginNameForWebVisibleMimeType): Deleted.
1354         * plugins/PluginData.h: Removed pluginNameForWebVisibleMimeType.
1355
1356 2017-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1357
1358         [GTK] Fix translatable form validation messages
1359         https://bugs.webkit.org/show_bug.cgi?id=167984
1360
1361         Reviewed by Michael Catanzaro.
1362
1363         Most of them are just wrong. Use the same mesages than mac, which also makes some tests pass.
1364
1365         Fixes: fast/forms/validation-message-maxLength.html
1366                fast/forms/validationMessage.html
1367
1368         * platform/gtk/LocalizedStringsGtk.cpp:
1369         (WebCore::validationMessageValueMissingText):
1370         (WebCore::validationMessageValueMissingForCheckboxText):
1371         (WebCore::validationMessageValueMissingForFileText):
1372         (WebCore::validationMessageValueMissingForMultipleFileText):
1373         (WebCore::validationMessageValueMissingForRadioText):
1374         (WebCore::validationMessageValueMissingForSelectText):
1375         (WebCore::validationMessageTypeMismatchText):
1376         (WebCore::validationMessageTypeMismatchForEmailText):
1377         (WebCore::validationMessageTypeMismatchForMultipleEmailText):
1378         (WebCore::validationMessageTypeMismatchForURLText):
1379         (WebCore::validationMessagePatternMismatchText):
1380         (WebCore::validationMessageTooShortText):
1381         (WebCore::validationMessageTooLongText):
1382         (WebCore::validationMessageRangeUnderflowText):
1383         (WebCore::validationMessageRangeOverflowText):
1384         (WebCore::validationMessageStepMismatchText):
1385         (WebCore::validationMessageBadInputForNumberText):
1386
1387 2017-02-08  Chris Dumez  <cdumez@apple.com>
1388
1389         Add support for enhanced privacy diagnostic logging
1390         https://bugs.webkit.org/show_bug.cgi?id=167948
1391         <rdar://problem/30385112>
1392
1393         Reviewed by Antti Koivisto.
1394
1395         Add new logDiagnosticMessageWithEnhancedPrivacy() method to DiagnosticLoggingClient
1396         that is used for enhanced privacy logging. Start using this new API to log domains
1397         that are visited.
1398
1399         * loader/EmptyClients.cpp:
1400         * loader/FrameLoader.cpp:
1401         (WebCore::logNavigation):
1402         (WebCore::FrameLoader::loadWithDocumentLoader):
1403         * page/DiagnosticLoggingClient.h:
1404         * page/DiagnosticLoggingKeys.cpp:
1405         (WebCore::DiagnosticLoggingKeys::domainVisitedKey):
1406         * page/DiagnosticLoggingKeys.h:
1407
1408 2017-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1409
1410         [GStreamer] Critical warnings when media player is destroyed
1411         https://bugs.webkit.org/show_bug.cgi?id=167981
1412
1413         Reviewed by Xabier Rodriguez-Calvar.
1414
1415         It can happen that the source doesn't have a parent when we try to disconnect the element-added signal.
1416
1417         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1418         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
1419         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
1420
1421 2017-02-08  Miguel Gomez  <magomez@igalia.com>
1422
1423         [GTK] Reduce TiledBackingStore tile coverage when on memory pressure state
1424         https://bugs.webkit.org/show_bug.cgi?id=167980
1425
1426         Reviewed by Carlos Garcia Campos.
1427
1428         Use a smaller coverAreaMultiplier in the TiledBackingStore when in memory pressure situation, to reduce
1429         the amount of tiles created.
1430
1431         No new tests.
1432
1433         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1434         (WebCore::TiledBackingStore::createTilesIfNeeded):
1435         (WebCore::TiledBackingStore::createTiles):
1436         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1437
1438 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
1439
1440         [EME] Implement MediaKeySession::remove()
1441         https://bugs.webkit.org/show_bug.cgi?id=167870
1442
1443         Reviewed by Xabier Rodriguez-Calvar.
1444
1445         Implement MediaKeySession::remove() as outlined in the specification.
1446
1447         The CDMInstance::removeSessionData() virtual method is added. CDMInstance
1448         implementors should remove any session data stored for the session that's
1449         represented by the passed-in session ID and session type.
1450
1451         Once the session data is removed, the passed-in callback should be invoked
1452         by the CDMInstance object so that MediaKeySession can immediately queue a
1453         task in which it updates key statuses and expiration, reject the promise if
1454         the data removal failed, or enqueue any license-release message and finally
1455         successfully resolve the promise.
1456
1457         MockCDMFactory gains the removeKeysFromSessionWithID() method that purges
1458         the keys for a given session ID. The method is called from
1459         MockCDMInstance::removeSessionData() implementation, which passes the
1460         removed keys to the RemoveSessionDataCallback, along with a license-release
1461         message that is checked in the tests. The key removal itself isn't tested
1462         yet because the MediaKeySession's `update key statuses` algorithm isn't
1463         implemented yet.
1464
1465         Test: media/encrypted-media/mock-MediaKeySession-remove.html
1466
1467         * Modules/encryptedmedia/CDMInstance.h:
1468         * Modules/encryptedmedia/MediaKeySession.cpp:
1469         (WebCore::MediaKeySession::remove):
1470         * testing/MockCDMFactory.cpp:
1471         (WebCore::MockCDMFactory::removeKeysFromSessionWithID):
1472         (WebCore::MockCDMInstance::removeSessionData):
1473         * testing/MockCDMFactory.h:
1474
1475 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
1476
1477         [EME] Implement MediaKeySession::close()
1478         https://bugs.webkit.org/show_bug.cgi?id=167869
1479
1480         Reviewed by Xabier Rodriguez-Calvar.
1481
1482         Implement MediaKeySession::close() as outlined in the specification.
1483
1484         The CDMInstance::closeSession() virtual method, when called, should
1485         close the session that's represented by the passed-in session ID on
1486         the CDMInstance implementor object. That's the same session ID that
1487         the CDMInstance object passes to the MediaKeySession class through
1488         the callback that's provided to the updateLicense call.
1489
1490         The CloseSessionCallback, passed to CDMInstance::closeSession(),
1491         should be invoked by the CDMInstance implementor once the session
1492         is closed. When that is invoked, another task is queued for the
1493         MediaKeySession object that runs the `session closed` algorithm
1494         and resolves the promise.
1495
1496         MockCDMInstance::closeSession() is defined to remove the session
1497         from the MockCDMFactory object and invoke the CloseSessionCallback.
1498
1499         Test: media/encrypted-media/mock-MediaKeySession-close.html
1500
1501         * Modules/encryptedmedia/CDMInstance.h:
1502         * Modules/encryptedmedia/MediaKeySession.cpp:
1503         (WebCore::MediaKeySession::close):
1504         * testing/MockCDMFactory.cpp:
1505         (WebCore::MockCDMInstance::closeSession):
1506         * testing/MockCDMFactory.h:
1507
1508 2017-02-08  Zan Dobersek  <zdobersek@igalia.com>
1509
1510         [EME] Alias CDMInstance enums to the specification-defined enums
1511         https://bugs.webkit.org/show_bug.cgi?id=167896
1512
1513         Reviewed by Sam Weinig.
1514
1515         Simplify the enums in the CDMInstance class by simply aliasing them
1516         to the EME specification-defined enums. CDMInstance::KeyStatus and
1517         CDMInstance::MessageType were already direct copies of the
1518         MediaKeyStatus and MediaKeyMessageType enums, while the
1519         CDMInstance::LicenseType had the members as MediaKeySessionType,
1520         but with slightly different names.
1521
1522         No changes in behavior.
1523
1524         * Modules/encryptedmedia/CDMInstance.h:
1525         * Modules/encryptedmedia/MediaKeySession.cpp:
1526         (WebCore::MediaKeySession::generateRequest):
1527         (WebCore::MediaKeySession::update):
1528         * testing/MockCDMFactory.cpp:
1529         (WebCore::MockCDMInstance::requestLicense):
1530
1531 2017-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1532
1533         REGRESSION(r210740): [GTK] 2.15 broke embedded videos in GNOME's yelp app
1534         https://bugs.webkit.org/show_bug.cgi?id=167887
1535
1536         Reviewed by Michael Catanzaro.
1537
1538         Update the m_renderingCanBeAccelerated when accelerated rendering state changes.
1539
1540         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1541         (WebCore::MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged):
1542         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
1543         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1544
1545 2017-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1546
1547         [GTK] Handle extended colors in cairo and texture mapper backends
1548         https://bugs.webkit.org/show_bug.cgi?id=167943
1549
1550         Reviewed by Michael Catanzaro.
1551
1552         Fixes: css3/color/backgrounds-and-borders.html
1553                css3/color/box-shadows.html
1554                css3/color/canvas.html
1555                css3/color/composited-solid-backgrounds.html
1556                css3/color/text.html
1557
1558         * platform/graphics/Color.cpp:
1559         (WebCore::premultipliedARGBFromColor): Handle the case of color being extended.
1560         * platform/graphics/cairo/CairoUtilities.cpp:
1561         (WebCore::setSourceRGBAFromColor): Ditto.
1562         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1563         (WebCore::fillRectWithColor): Use isVisible() instead of alpha().
1564         (WebCore::GraphicsContext::drawEllipse): Ditto.
1565         * platform/graphics/gtk/ColorGtk.cpp:
1566         (WebCore::Color::operator GdkRGBA): Handle the case of color being extended.
1567         * platform/graphics/texmap/TextureMapperGL.cpp:
1568         (WebCore::TextureMapperGL::drawNumber): Ditto.
1569         * platform/graphics/texmap/TextureMapperLayer.cpp:
1570         (WebCore::blendWithOpacity): Ditto.
1571         (WebCore::TextureMapperLayer::paintSelf): Use isVisible() instead of alpha().
1572         (WebCore::TextureMapperLayer::computeOverlapRegions): Ditto.
1573
1574 2017-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1575
1576         WebItemProviderPasteboard should use -registerLoadHandlersToItemProvider: when creating a new UIItemProvider
1577         https://bugs.webkit.org/show_bug.cgi?id=167918
1578         <rdar://problem/30382347>
1579
1580         Reviewed by Tim Horton.
1581
1582         Adopts SPI in WebItemProviderPasteboard for object types that the platform knows how to serialize. Since we use
1583         -createObjectOfClass: to initialize data when reading off of the pasteboard, we need to match the format that
1584         objects conforming to UIItemProviderReading will expect. Thus, for all given objects that conform to
1585         UIItemProviderWriting, we have them register themselves to the item provider.
1586
1587         We register other UTI types due to the fact that PlatformPasteboardIOS does not care about the specific
1588         pasteboard used. This should not be necessary, however, since data written to the WebItemProviderPasteboard
1589         should never need to be read by an actual UIPasteboard. This will be refactored in a future patch to add a
1590         special type of WebItemProviderPasteboard-aware PlatformPasteboard.
1591
1592         Also fixes some reference counting issues in WebItemProviderPasteboard by changing the array of _itemProviders
1593         to be a RetainPtr.
1594
1595         * platform/ios/WebItemProviderPasteboard.mm:
1596         (-[WebItemProviderPasteboard init]):
1597         (-[WebItemProviderPasteboard pasteboardTypes]):
1598         (-[WebItemProviderPasteboard itemProviders]):
1599         (-[WebItemProviderPasteboard setItemProviders:]):
1600         (-[WebItemProviderPasteboard numberOfItems]):
1601         (-[WebItemProviderPasteboard setItems:]):
1602         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1603         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
1604         (-[WebItemProviderPasteboard dealloc]): Deleted.
1605
1606 2017-02-06  Ryosuke Niwa  <rniwa@webkit.org>
1607
1608         WebContent process repeatedly jetsams on BuzzFeed's Another Round page
1609         https://bugs.webkit.org/show_bug.cgi?id=167830
1610         <rdar://problem/30187368>
1611
1612         Reviewed by Simon Fraser.
1613
1614         The jetsams on https://www.buzzfeed.com/anotherround were caused by WebKit creating the backing store
1615         for every iframe's layer on the page regardless of whether they're in the viewport or not.
1616
1617         This was caused by GraphicsLayerCA's setVisibleAndCoverageRects not setting CoverageRectChanged on
1618         m_uncommittedChanges on the very first call. Fixed the bug by initializing m_uncommittedChanges
1619         to always have CoverageRectChanged so that the coverage rect would get updated properly.
1620
1621         Unfortunately, no new tests since somehow the backing store doesn't get created inside the test runner.
1622
1623         * platform/graphics/ca/GraphicsLayerCA.h:
1624         (WebCore::GraphicsLayerCA):
1625
1626 2017-02-07  Youenn Fablet  <youennf@gmail.com>
1627
1628         [WebRTC] LibWebRTCEndpoint should not own objects that should be destroyed on the main thread
1629         https://bugs.webkit.org/show_bug.cgi?id=167816
1630
1631         Reviewed by Alex Christensen.
1632
1633         Tests: webrtc/libwebrtc/release-while-creating-offer.html
1634                webrtc/libwebrtc/release-while-getting-stats.html
1635                webrtc/libwebrtc/release-while-setting-local-description.html
1636
1637         Moving AV sources, stats promises, ICE candidates from LibWebRTCEndpoint to LibWebRTCPeerConnectionBackend.
1638         This allows ensuring these are destroyed in the main thread.
1639
1640         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1641         (WebCore::MediaEndpointPeerConnection::getStats):
1642         * Modules/mediastream/MediaEndpointPeerConnection.h:
1643         * Modules/mediastream/PeerConnectionBackend.h:
1644         * Modules/mediastream/RTCPeerConnection.cpp:
1645         (WebCore::RTCPeerConnection::getStats):
1646         * Modules/mediastream/RTCPeerConnection.h:
1647         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1648         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
1649         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
1650         (WebCore::LibWebRTCMediaEndpoint::getStats):
1651         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector):
1652         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
1653         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1654         (WebCore::LibWebRTCMediaEndpoint::addIceCandidate):
1655         (WebCore::LibWebRTCMediaEndpoint::isStopped):
1656         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1657         (WebCore::LibWebRTCPeerConnectionBackend::~LibWebRTCPeerConnectionBackend):
1658         (WebCore::LibWebRTCPeerConnectionBackend::getStats):
1659         (WebCore::LibWebRTCPeerConnectionBackend::iceCandidateSucceeded):
1660         (WebCore::LibWebRTCPeerConnectionBackend::iceCandidateFailed):
1661         (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
1662         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
1663         (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
1664         (WebCore::LibWebRTCPeerConnectionBackend::addAudioSource):
1665         (WebCore::LibWebRTCPeerConnectionBackend::addVideoSource):
1666         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1667         * testing/MockLibWebRTCPeerConnection.cpp:
1668         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer):
1669         (WebCore::releaseInNetworkThread):
1670         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer::CreateOffer):
1671         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats):
1672         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats::GetStats):
1673         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription):
1674         (WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription::SetLocalDescription):
1675         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
1676         * testing/MockLibWebRTCPeerConnection.h:
1677
1678 2017-02-07  Myles C. Maxfield  <mmaxfield@apple.com>
1679
1680         [Win] [GTK] [EFL] Compile (but don't use, yet) the platform-independent piece of ComplexTextController
1681         https://bugs.webkit.org/show_bug.cgi?id=167927
1682
1683         Reviewed by Brent Fulgham.
1684
1685         This patch simply moves some functions around to enable the Win, GTK, and EFL ports to compile the
1686         platform-independent pieces of ComplexTextController. Those parts of ComplexTextController have
1687         some dependencies which were previously only available on the Cocoa ports; however, those
1688         dependencies are easily created or moved from elsewhere. The next step is to populate the
1689         ComplexTextController::collectComplexTextRunsForCharacters() function for DirectWrite and HarfBuzz.
1690         Once that is done, UniscribeController and HarfBuzzShaper can be deleted.
1691
1692         Adds ComplexTextController TestWebKitAPI tests to the Win and GTK ports.
1693
1694         * CMakeLists.txt: Everyone can compile the platform-independent piece of ComplexTextController.
1695         * PlatformEfl.cmake: Add the HarfBuzz-specific piece.
1696         * PlatformGTK.cmake: Ditto.
1697         * PlatformWin.cmake: Add the DirectWrite-specific piece.
1698         * platform/graphics/ComplexTextController.cpp:
1699         (WebCore::TextLayoutDeleter::operator()): ComplexTextController shouldn't be enabled yet for Win,
1700         GTK, or EFL.
1701         (WebCore::FontCascade::createLayout): Ditto.
1702         (WebCore::FontCascade::width): Ditto.
1703         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moved shared code to the shared
1704         file.
1705         * platform/graphics/Font.cpp:
1706         (WebCore::Font::noSynthesizableFeaturesFont): Default implementation for other ports.
1707         (WebCore::Font::variantCapsSupportsCharacterForSynthesis): Ditto.
1708         * platform/graphics/FontCascade.cpp:
1709         (WebCore::FontCascade::fontForCombiningCharacterSequence): Ditto.
1710         (WebCore::FontCascade::drawEmphasisMarksForComplexText): Ditto.
1711         (WebCore::FontCascade::createLayout): Deleted. Moved to ComplexTextController.
1712         (WebCore::TextLayoutDeleter::operator()): Deleted. Ditto.
1713         * platform/graphics/FontCascade.h: fontForCombiningCharacterSequence() should exist on all ports.
1714         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1715         (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
1716         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1717         (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Ditto.
1718         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Added.
1719         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
1720         HarfBuzz-specific piece of ComplexTextController.
1721         * platform/graphics/mac/ComplexTextControllerCoreText.mm: Moved constructors to shared file.
1722         * platform/graphics/win/ComplexTextControllerDirectWrite.cpp: Added.
1723         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
1724         Direct Write-specific piece of ComplexTextController.
1725         * platform/graphics/win/FontWin.cpp:
1726         (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
1727
1728 2017-02-07  Alex Christensen  <achristensen@webkit.org>
1729
1730         Revert r166597
1731         https://bugs.webkit.org/show_bug.cgi?id=167951
1732
1733         Reviewed by Andreas Kling.
1734
1735         * platform/spi/cf/CFNetworkSPI.h:
1736         Remove now-unused SPI declaration.
1737
1738 2017-02-07  Sam Weinig  <sam@webkit.org>
1739
1740         Try to fix the windows build.
1741
1742         * bindings/js/ReadableStreamDefaultController.cpp:
1743
1744 2017-02-07  Youenn Fablet  <youennf@gmail.com>
1745
1746         [WebRTC] LibWebRTC WK2 network stack is not providing correct ports for ICE candidates
1747         https://bugs.webkit.org/show_bug.cgi?id=167939
1748
1749         Reviewed by Sam Weinig.
1750
1751         Test: webrtc/no-port-zero-in-upd-candidates.html
1752
1753         * testing/MockLibWebRTCPeerConnection.cpp:
1754         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory): Adding a way to create one real PC in WTR environment.
1755
1756 2017-02-07  Sam Weinig  <sam@webkit.org>
1757
1758         Update bindings tests results for additional include.
1759
1760         * bindings/scripts/test/JS/JSTestObj.cpp:
1761         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1762
1763 2017-02-07  Sam Weinig  <sam@webkit.org>
1764
1765         Try to fix the windows build.
1766
1767         * bindings/js/JSDOMConvertNumbers.h:
1768
1769 2017-02-07  Alex Christensen  <achristensen@webkit.org>
1770
1771         Fix libwebrtc build after r211728
1772         https://bugs.webkit.org/show_bug.cgi?id=167821
1773
1774         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1775         (WebCore::RealtimeIncomingVideoSource::processNewSample):
1776         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1777         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1778         (WebCore::RealtimeOutgoingAudioSource::sourceHasMoreMediaData): Deleted.
1779         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1780         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1781         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
1782         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
1783         (WebCore::RealtimeOutgoingVideoSource::sourceHasMoreMediaData): Deleted.
1784         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
1785
1786 2017-02-07  Tim Horton  <timothy_horton@apple.com>
1787
1788         Remove accidentally-added (in r211409) patch reject file
1789
1790         * bindings/scripts/test/JS/JSTestSerialization.cpp.rej: Removed.
1791
1792 2017-02-07  Sam Weinig  <sam@webkit.org>
1793
1794         JSDOMConvert is too big. Split it up!
1795         https://bugs.webkit.org/show_bug.cgi?id=167806
1796
1797         Rubber-stamped by Geoff Garen.
1798
1799         Split JSDOMConvert up roughly by IDL type. Some are grouped for convenience, e.g. all the
1800         string types are together, all the numeric types are together. Also moved helpers from 
1801         JSDOMBinding to their respective JSDOMConvertFoo header. For now, JSDOMConvert.h as an
1802         umbrella of all the sub headers, but it will be removed, and the code generator taught
1803         to include the right header in a subsequent patch.
1804
1805         * CMakeLists.txt:
1806         * WebCore.xcodeproj/project.pbxproj:
1807         Add new files.
1808
1809         * bindings/js/IDBBindingUtilities.cpp:
1810         * bindings/js/IDBBindingUtilities.h:
1811         Remove toJS that takes a std::optional<IDBKeyPath>, it was unused, and update date code
1812         to only call valueToDate once, and pass things by reference.
1813
1814         * bindings/js/JSDOMBinding.cpp:
1815         * bindings/js/JSDOMBinding.h:
1816         Move most of the conversion helpers into their respective JSDOMConvertFoo header.
1817
1818         * bindings/js/JSDOMConvert.h:
1819         Leave for now, just has includes of all the broken out headers.
1820
1821         * bindings/js/JSDOMConvertAny.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1822         * bindings/js/JSDOMConvertBase.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1823         * bindings/js/JSDOMConvertBoolean.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1824         * bindings/js/JSDOMConvertBufferSource.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1825         * bindings/js/JSDOMConvertCallbacks.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1826         * bindings/js/JSDOMConvertDate.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
1827         * bindings/js/JSDOMConvertDate.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1828         * bindings/js/JSDOMConvertDictionary.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1829         * bindings/js/JSDOMConvertEnumeration.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1830         * bindings/js/JSDOMConvertEventListener.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1831         * bindings/js/JSDOMConvertIndexedDB.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1832         * bindings/js/JSDOMConvertInterface.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1833         * bindings/js/JSDOMConvertJSON.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1834         * bindings/js/JSDOMConvertNull.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1835         * bindings/js/JSDOMConvertNullable.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1836         * bindings/js/JSDOMConvertNumbers.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
1837         * bindings/js/JSDOMConvertNumbers.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1838         * bindings/js/JSDOMConvertObject.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1839         * bindings/js/JSDOMConvertRecord.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1840         * bindings/js/JSDOMConvertSequences.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1841         * bindings/js/JSDOMConvertSerializedScriptValue.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1842         * bindings/js/JSDOMConvertStrings.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
1843         * bindings/js/JSDOMConvertStrings.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1844         * bindings/js/JSDOMConvertUnion.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1845         * bindings/js/JSDOMConvertVariadic.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1846         * bindings/js/JSDOMConvertWebGL.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1847         * bindings/js/JSDOMConvertXPathNSResolver.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
1848
1849         * bindings/scripts/CodeGeneratorJS.pm:
1850         (GenerateParametersCheck):
1851         Add include of JSDOMConvertVariadic.h rather than JSDOMConvert.
1852
1853         * bindings/js/JSCryptoCustom.cpp:
1854         * bindings/js/JSCryptoOperationData.cpp:
1855         * bindings/js/JSImageDataCustom.cpp:
1856         * bindings/js/ReadableStreamDefaultController.h:
1857         * bindings/js/WebCoreTypedArrayController.cpp:
1858         * html/canvas/WebGLAny.cpp:
1859         * platform/mac/SerializedPlatformRepresentationMac.mm:
1860         Add includes for specific JSDOMConvert header now that helpers have 
1861         been moved their from JSDOMBinding.h
1862
1863 2017-02-07  Sam Weinig  <sam@webkit.org>
1864
1865         Remove unnecessary exports on inline functions. They were causing build failures
1866         with some compilers.
1867
1868         * Modules/mediasource/SampleMap.h:
1869         (WebCore::PresentationOrderSampleMap::begin):
1870         (WebCore::PresentationOrderSampleMap::end):
1871         (WebCore::PresentationOrderSampleMap::rbegin):
1872         (WebCore::PresentationOrderSampleMap::rend):
1873         (WebCore::DecodeOrderSampleMap::begin):
1874         (WebCore::DecodeOrderSampleMap::end):
1875         (WebCore::DecodeOrderSampleMap::rbegin):
1876         (WebCore::DecodeOrderSampleMap::rend):
1877         (WebCore::SampleMap::sizeInBytes):
1878         (WebCore::SampleMap::decodeOrder):
1879         (WebCore::SampleMap::presentationOrder):
1880         (WebCore::SampleMap::addRange):
1881         (WebCore::SampleMap::SampleMap): Deleted.
1882
1883 2017-02-07  Yusuke Suzuki  <utatane.tea@gmail.com>
1884
1885         Unreviewed, manual roll out of r211777
1886         https://bugs.webkit.org/show_bug.cgi?id=167457
1887
1888         * bindings/js/ScriptModuleLoader.cpp:
1889         (WebCore::ScriptModuleLoader::importModule):
1890
1891 2017-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1892
1893         [GStreamer] Deadlock when media player is destroyed
1894         https://bugs.webkit.org/show_bug.cgi?id=167861
1895
1896         Reviewed by Michael Catanzaro.
1897
1898         The problem is that we are calling notifyOne() for the draw mutex without taking the lock.
1899
1900         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1901         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
1902
1903 2017-02-07  Zan Dobersek  <zdobersek@igalia.com>
1904
1905         MediaSourceClientGStreamerMSE: wrap FastMalloc-ed memory into pipeline-bound GstBuffers
1906         https://bugs.webkit.org/show_bug.cgi?id=167928
1907
1908         Reviewed by Xabier Rodriguez-Calvar.
1909
1910         The buffers created in MediaSourceClientGStreamerMSE can be large enough in size
1911         that repetitive allocations can cause larger heap fragmentation in different libc
1912         allocators. To avoid that occurrence, we should simply use FastMalloc to allocate
1913         memory for these buffers.
1914
1915         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1916         (WebCore::MediaSourceClientGStreamerMSE::append):
1917
1918 2017-02-07  Antoine Quint  <graouts@apple.com>
1919
1920         [Modern Media Controls] Handle media durations of an hour or more gracefully
1921         https://bugs.webkit.org/show_bug.cgi?id=167882
1922         <rdar://problem/29601260>
1923
1924         Reviewed by Eric Carlson.
1925
1926         We add a new "labelsMayDisplayTimesOverAnHour" to TimeControl so that time labels
1927         to the left and right of the scrubber may have extra room to display to account for
1928         the extra "xx:" characters that may appear. We don't lay the time out dynamically
1929         such that we don't see layout jumps as the times shown in the labels go around
1930         the hour mark.
1931
1932         We also refactor the ElapsedTimeSupport and RemainingTimeSupport in a single
1933         TimeLabelsSupport class which updates both elapsed and remaining time labels
1934         and sets the "labelsMayDisplayTimesOverAnHour" on the TimeControl should a
1935         "durationchange" happen to make the media duration reach or go past the hour mark.
1936
1937         Tests: http/tests/media/modern-media-controls/time-labels-support/long-time.html
1938                media/modern-media-controls/time-control/time-control-labels-may-display-times-over-an-hour.html
1939                media/modern-media-controls/time-labels-support/elapsed-time.html
1940                media/modern-media-controls/time-labels-support/remaining-time.html
1941
1942         * Modules/modern-media-controls/controls/time-control.js:
1943         (TimeControl.prototype.get labelsMayDisplayTimesOverAnHour):
1944         (TimeControl.prototype.set labelsMayDisplayTimesOverAnHour):
1945         (TimeControl.prototype.set width):
1946         * Modules/modern-media-controls/controls/time-label.css:
1947         (.time-label):
1948         * Modules/modern-media-controls/js-files:
1949         * Modules/modern-media-controls/media/elapsed-time-support.js: Removed.
1950         * Modules/modern-media-controls/media/media-controller.js:
1951         (MediaController.prototype._updateControlsIfNeeded):
1952         * Modules/modern-media-controls/media/time-labels-support.js: Renamed from Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js.
1953         (TimeLabelsSupport.prototype.get control):
1954         (TimeLabelsSupport.prototype.syncControl):
1955         (TimeLabelsSupport):
1956         * WebCore.xcodeproj/project.pbxproj:
1957
1958 2017-02-06  Per Arne Vollan  <pvollan@apple.com>
1959
1960         Read stroke width of subtitles from MediaAccessibility framework.
1961         https://bugs.webkit.org/show_bug.cgi?id=167871
1962         <rdar://problem/29265906>
1963
1964         Reviewed by Brent Fulgham.
1965
1966         Read MACaptionFontAttributeStrokeWidth from CTFontDescriptorRef.
1967
1968         * page/CaptionUserPreferencesMediaAF.cpp:
1969         (WebCore::CaptionUserPreferencesMediaAF::strokeWidth):
1970         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
1971         * page/CaptionUserPreferencesMediaAF.h:
1972         * platform/cf/MediaAccessibilitySoftLink.cpp:
1973         * platform/cf/MediaAccessibilitySoftLink.h:
1974
1975 2017-02-07  Antoine Quint  <graouts@apple.com>
1976
1977         [Modern Media Controls] Improve handling of <video> with only audio tracks
1978         https://bugs.webkit.org/show_bug.cgi?id=167836
1979         <rdar://problem/30255812>
1980
1981         Reviewed by Dean Jackson.
1982
1983         We now check for the availability of video tracks before considering a <video>
1984         element is displaying an actual video file and turning auto-hide on. We also
1985         check that we have video tracks before enabling the fullscreen button. This
1986         brings the behavior of a <video> pointing to a resource with no video tracks
1987         to be the same as an <audio> element.
1988
1989         Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
1990
1991         * Modules/modern-media-controls/media/controls-visibility-support.js:
1992         (ControlsVisibilitySupport.prototype.get tracksToMonitor):
1993         (ControlsVisibilitySupport.prototype._updateControls):
1994         (ControlsVisibilitySupport):
1995         * Modules/modern-media-controls/media/fullscreen-support.js:
1996         (FullscreenSupport.prototype.syncControl):
1997         (FullscreenSupport):
1998
1999 2017-02-07  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2000
2001         [Readable Streams API] Implement ReadableByteStreamController enqueue()
2002         https://bugs.webkit.org/show_bug.cgi?id=167786
2003
2004         Reviewed by Youenn Fablet.
2005
2006         Implemented ReadableByteStreamController enqueue() method. Also replaced
2007         @queue by an Array instead of a dedicated queue object (said object is
2008         useful for ReadableStreamDefaultController, but not for ReadableByteStreamController).
2009
2010         Added 8 tests to cover newly added code as well as code that was previously unreachable.
2011
2012         * Modules/streams/ReadableByteStreamController.js:
2013         (enqueue): Implemented as defined by spec.
2014         * Modules/streams/ReadableByteStreamInternals.js:
2015         (privateInitializeReadableByteStreamController): Updated @queue.
2016         (readableByteStreamControllerCancel): Updated @queue.
2017         (readableByteStreamControllerError): Updated @queue.
2018         (readableByteStreamControllerPull): Updated @queue.
2019         (readableByteStreamControllerEnqueue): Added.
2020         (readableByteStreamControllerEnqueueChunkToQueue): Added.
2021         * Modules/streams/ReadableStreamInternals.js:
2022         (readableStreamFulfillReadRequest): Added (used at different places).
2023
2024 2017-02-07  Chris Dumez  <cdumez@apple.com>
2025
2026         Object.preventExtensions() on a Location object should throw a TypeError
2027         https://bugs.webkit.org/show_bug.cgi?id=167917
2028
2029         Reviewed by Alex Christensen.
2030
2031         Object.preventExtensions() on a Location object should throw a TypeError:
2032         - https://html.spec.whatwg.org/#location-preventextensions
2033         - https://www.ecma-international.org/ecma-262/7.0/index.html#sec-object.preventextensions
2034
2035         Firefox already implements this.
2036
2037         No new tests, rebaselined existing tests.
2038
2039         * bindings/js/JSLocationCustom.cpp:
2040         (WebCore::JSLocation::preventExtensions):
2041
2042 2017-02-07  Yusuke Suzuki  <utatane.tea@gmail.com>
2043
2044         Web Inspector: allow import() inside the inspector
2045         https://bugs.webkit.org/show_bug.cgi?id=167457
2046
2047         Reviewed by Ryosuke Niwa.
2048
2049         When evaluating `import("...")`, we need the caller's context to resolve
2050         the module specifier correctly. For example, if `import("./cocoa.js")` is
2051         evaluated in the script "drinks/hot.js", this module name is resolved to
2052         "drinks/cocoa.js". If the same import operator is evaluated in the script
2053         "menu/all.js", the module specifier becomes "menu/cocoa.js".
2054
2055         Previously we reject the import operator if the caller does not have such
2056         a context. These context is SourceOrigin and its ScriptFetcher. While they
2057         are offered in the script tag and other code evaluations, the inspector
2058         console does not offer that. These class are offered in the WebCore side
2059         and we should not touch these classes in the JSC's inspector code.
2060
2061         Now we relax the above restriction. If the above caller information is not
2062         offered, we fallback to the default one. In the web page, we use the page's
2063         URL as the caller's source origin. This allows us to evaluate the import
2064         operator in the inspector console.
2065
2066         And as of r167698, the console recognizes `await import("...")` form. We use
2067         this to test this `import()` in the console functionality.
2068
2069         * bindings/js/ScriptModuleLoader.cpp:
2070         (WebCore::ScriptModuleLoader::importModule):
2071
2072 2017-02-07  Myles C. Maxfield  <mmaxfield@apple.com>
2073
2074         Move platform-independent parts of ComplexTextController out of mac/ subfolder
2075         https://bugs.webkit.org/show_bug.cgi?id=167922
2076
2077         Reviewed by Jon Lee.
2078
2079         Just a mechanical git mv, and updating the Xcode projects.
2080
2081         No new tests because there is no behavior change.
2082
2083         * WebCore.xcodeproj/project.pbxproj:
2084         * platform/graphics/ComplexTextController.cpp: Renamed from Source/WebCore/platform/graphics/mac/ComplexTextController.cpp.
2085         * platform/graphics/ComplexTextController.h: Renamed from Source/WebCore/platform/graphics/mac/ComplexTextController.h.
2086
2087 2017-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
2088
2089         Overlay scrolling with iframe-s broken
2090         https://bugs.webkit.org/show_bug.cgi?id=165056
2091
2092         Reviewed by Antonio Gomes.
2093
2094         Mouse press events for overlay scrollbars are ignored if there's a subframe under the scrollbar. This doesn't
2095         happen with normal scrollbars, because the subframe is not really under the scrollbar, so events are always
2096         correctly passed to the scrollbar. With overlay scrollbars, the hit test detects the scrollbar, but events are
2097         always passed first to the subframe. Scrollbars are correctly updated on hover though, because
2098         handleMouseMoveEvent checks the presence of scrollbars before checking for subframes and move events are
2099         actually passed to both, the scrollbar and the subframe. Overlay scrollbars should always take precedence over
2100         subframes to handle mouse press events, so we should check first if mouse is over a scrollbar and never pass the
2101         event to a subframe in that case. Another problem is that the cursor is not updated either when the overlay
2102         scrollbar is hovered and there's a subframe. This is because in handleMouseMoveEvent we pass the event to both
2103         the scrollbar and subframe but we never update the cursor when a suframe was found. So, here again we need to make
2104         an exception for scrollbars and upate the cursor when mouse is over the scrollbar even if a subframe was found.
2105
2106         Test: fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html
2107
2108         * page/EventHandler.cpp:
2109         (WebCore::EventHandler::handleMousePressEvent): Move the scrollbar check before the subframe check.
2110         (WebCore::EventHandler::handleMouseMoveEvent): Update the cursor when hovering a scrollbar even if a subframe
2111         was found.
2112         (WebCore::EventHandler::updateLastScrollbarUnderMouse): Use an enum instead of a boolean for setLast parameter.
2113         * page/EventHandler.h:
2114
2115 2017-02-06  Chris Dumez  <cdumez@apple.com>
2116
2117         Symbols exposed on cross-origin Window / Location objects should be configurable
2118         https://bugs.webkit.org/show_bug.cgi?id=167920
2119
2120         Reviewed by Ryosuke Niwa.
2121
2122         Symbols exposed on cross-origin Window / Location objects should be configurable:
2123         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-) (Step 1)
2124
2125         Firefox behaves as per specification.
2126
2127         No new tests, rebaselined existing test.
2128
2129         * bindings/js/JSDOMWindowCustom.cpp:
2130         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2131         * bindings/js/JSLocationCustom.cpp:
2132         (WebCore::JSLocation::getOwnPropertySlotDelegate):
2133
2134 2017-02-06  Joseph Pecoraro  <pecoraro@apple.com>
2135
2136         Web Inspector: Do not use RunLoop when dispatching inspector GC event
2137         https://bugs.webkit.org/show_bug.cgi?id=167683
2138         <rdar://problem/30167791>
2139
2140         Reviewed by Brian Burg.
2141
2142         Covered by existing tests.
2143
2144         * CMakeLists.txt:
2145         * WebCore.xcodeproj/project.pbxproj:
2146         * inspector/InspectorAllInOne.cpp:
2147         Add new file.
2148
2149         * inspector/PageHeapAgent.cpp:
2150         (WebCore::PageHeapAgent::PageHeapAgent):
2151         (WebCore::PageHeapAgent::enable):
2152         (WebCore::PageHeapAgent::disable):
2153         * inspector/PageHeapAgent.h:
2154         Extend WebHeapAgent.
2155
2156         * inspector/WorkerInspectorController.cpp:
2157         (WebCore::WorkerInspectorController::WorkerInspectorController):
2158         Use WebHeapAgent.
2159
2160         * inspector/WebHeapAgent.cpp: Added.
2161         (WebCore::SendGarbageCollectionEventsTask::SendGarbageCollectionEventsTask):
2162         (WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
2163         (WebCore::SendGarbageCollectionEventsTask::reset):
2164         (WebCore::SendGarbageCollectionEventsTask::timerFired):
2165         (WebCore::WebHeapAgent::WebHeapAgent):
2166         (WebCore::WebHeapAgent::~WebHeapAgent):
2167         (WebCore::WebHeapAgent::disable):
2168         (WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
2169         (WebCore::WebHeapAgent::dispatchGarbageCollectionEventsAfterDelay):
2170         * inspector/WebHeapAgent.h:
2171         Move the defered event dispatch from InspectorHeapAgent here where a RunLoop is guarenteed.
2172
2173 2017-02-06  Joseph Pecoraro  <pecoraro@apple.com>
2174
2175         ExtendedColor leaks seen on leaks bot
2176         https://bugs.webkit.org/show_bug.cgi?id=167912
2177
2178         Reviewed by Alexey Proskuryakov.
2179
2180         * platform/graphics/Color.cpp:
2181         (WebCore::Color::operator=):
2182         Before overwriting m_colorData, we must deref the extended color inside it.
2183
2184 2017-02-06  Simon Fraser  <simon.fraser@apple.com>
2185
2186         Re-land r210095 (avoid a tile revalidation on scale change)
2187         https://bugs.webkit.org/show_bug.cgi?id=167866
2188
2189         Reviewed by Tim Horton.
2190         
2191         r210095 was rolled out in r211230 but now that all TileControllers unparent
2192         offscreen tiles, we can roll it back it.
2193         
2194         Also add more Tiling logging.
2195
2196         * platform/graphics/ca/TileGrid.cpp:
2197         (WebCore::validationPolicyAsString):
2198         (WebCore::TileGrid::setScale):
2199         (WebCore::TileGrid::prepopulateRect):
2200         (WebCore::TileGrid::revalidateTiles):
2201         (WebCore::TileGrid::ensureTilesForRect):
2202
2203 2017-02-06  Myles C. Maxfield  <mmaxfield@apple.com>
2204
2205         Migrate ComplexTextController to use platform-independent types
2206         https://bugs.webkit.org/show_bug.cgi?id=167833
2207
2208         Reviewed by Brent Fulgham.
2209
2210         ComplexTextController will eventually be used on all ports to perform complex text layout.
2211         This is a mechanical patch which migrates the shared parts of ComplexTextController away from
2212         using CoreGraphics and CoreFoundation types in favor of WebCore/platform types. Eventually,
2213         ComplexTextController will get moved to PAL but there is a layering violation (TextLayout) to
2214         fix first.
2215
2216         No new tests because there is no behavior change.
2217
2218         * platform/graphics/GlyphBuffer.h:
2219         (WebCore::GlyphBufferAdvance::GlyphBufferAdvance):
2220         * platform/graphics/mac/ComplexTextController.cpp:
2221         (WebCore::ComplexTextController::offsetForPosition):
2222         (WebCore::advanceByCombiningCharacterSequence):
2223         (WebCore::ComplexTextController::ComplexTextRun::indexAt):
2224         (WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
2225         (WebCore::ComplexTextController::advance):
2226         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2227         * platform/graphics/mac/ComplexTextController.h:
2228         (WebCore::ComplexTextController::ComplexTextRun::create):
2229         (WebCore::ComplexTextController::ComplexTextRun::stringLength):
2230         (WebCore::ComplexTextController::ComplexTextRun::indexBegin):
2231         (WebCore::ComplexTextController::ComplexTextRun::indexEnd):
2232         (WebCore::ComplexTextController::ComplexTextRun::endOffsetAt):
2233         (WebCore::ComplexTextController::ComplexTextRun::glyphs):
2234         (WebCore::ComplexTextController::ComplexTextRun::growInitialAdvanceHorizontally):
2235         (WebCore::ComplexTextController::ComplexTextRun::initialAdvance):
2236         (WebCore::ComplexTextController::ComplexTextRun::baseAdvances):
2237         (WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
2238         (WebCore::ComplexTextController::glyphOrigin):
2239         (WebCore::ComplexTextController::ComplexTextRun::createForTesting): Deleted.
2240         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2241         (SOFT_LINK):
2242         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
2243         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2244
2245 2017-02-06  Brent Fulgham  <bfulgham@apple.com>
2246
2247         Correct File Path Handling in SecurityOrigin and FileSystem
2248         https://bugs.webkit.org/show_bug.cgi?id=167894
2249         <rdar://problem/30380080>
2250
2251         Reviewed by Alexey Proskuryakov.
2252
2253         Roll out the URL decoding being done in the FileSystem class (added in Bug 167894), and instead ensure that
2254         SecurityOrigin properly handles file URLs, and only passes valid file strings to the FileSystem interface.
2255
2256         Tested by FileSystemTests and SecurityOriginTests in TestWebKitAPI.
2257
2258         * page/SecurityOrigin.cpp:
2259         (WebCore::SecurityOrigin::SecurityOrigin): Initialize m_filePath using the url's fileSystemPath, not
2260         the %-encoded 'path' property.
2261         (WebCore::SecurityOrigin::canDisplay): Pass the 'fileSystemPath' to 'filesHaveSameVolume', rather than
2262         the %-encoded 'path' property.
2263         * page/SecurityOrigin.h:
2264         * platform/FileSystem.cpp:
2265         (WebCore::filesHaveSameVolume): Do not use 'decodeURLEscapeSequences' in 'filesHaveSameVolume'.
2266
2267 2017-02-06  Andy Estes  <aestes@apple.com>
2268
2269         [Cocoa] Split FileSystemMac.mm into Mac and Cocoa parts
2270         https://bugs.webkit.org/show_bug.cgi?id=167908
2271
2272         Reviewed by Sam Weinig.
2273
2274         Kept the Mac-only functions in FileSystemMac.mm and moved the rest into FileSystemCocoa.mm.
2275
2276         * PlatformMac.cmake:
2277         * WebCore.xcodeproj/project.pbxproj:
2278         * platform/cocoa/FileSystemCocoa.mm: Copied from Source/WebCore/platform/mac/FileSystemMac.mm.
2279         * platform/mac/FileSystemMac.mm:
2280         (-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]): Moved to FileSystemCocoa.mm.
2281         (WebCore::homeDirectoryPath): Ditto.
2282         (WebCore::openTemporaryFile): Ditto.
2283         (WebCore::moveFile): Ditto.
2284         (WebCore::getVolumeFreeSpace): Ditto.
2285
2286 2017-02-06  Eric Carlson  <eric.carlson@apple.com>
2287
2288         [MediaStream Mac] Remove some unused code
2289         https://bugs.webkit.org/show_bug.cgi?id=167913
2290
2291         Reviewed by Jer Noble.
2292
2293         No new tests, no functional change.
2294
2295         * platform/mediastream/CaptureDeviceManager.h:
2296         (WebCore::CaptureSessionInfo::~CaptureSessionInfo): Deleted.
2297         (WebCore::CaptureSessionInfo::supportsVideoSize): Deleted.
2298         (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
2299         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2300         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2301         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList):
2302         (WebCore::AVCaptureSessionInfo::AVCaptureSessionInfo): Deleted.
2303         (WebCore::AVCaptureSessionInfo::supportsVideoSize): Deleted.
2304         (WebCore::AVCaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
2305         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2306         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
2307
2308 2017-02-06  Youenn Fablet  <youennf@gmail.com>
2309
2310         Allow some schemes to opt-out of CORS
2311         https://bugs.webkit.org/show_bug.cgi?id=167795
2312
2313         Reviewed by Alex Christensen.
2314
2315         Test: http/tests/security/bypassing-cors-checks-for-extension-urls.html
2316
2317         Adding the possibility to opt out of CORS for DocumentThreadableLoader clients (fetch and XHR).
2318         This is made specific to the case of user extension URLs for pages running user scripts.
2319         Introducing a boolean flag in Page for that purpose.
2320         Introducing a helper routine in SchemeRegistry to centralize the various user script extension schemes.
2321
2322         * loader/DocumentThreadableLoader.cpp:
2323         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2324         * page/Frame.cpp:
2325         (WebCore::Frame::injectUserScripts):
2326         * page/Page.h:
2327         (WebCore::Page::setAsRunningUserScripts):
2328         (WebCore::Page::isRunningUserScripts):
2329         * platform/SchemeRegistry.cpp:
2330         (WebCore::SchemeRegistry::isUserExtensionScheme):
2331         * platform/SchemeRegistry.h:
2332         * testing/Internals.cpp:
2333         (WebCore::Internals::setAsRunningUserScripts):
2334         * testing/Internals.h:
2335         * testing/Internals.idl:
2336
2337 2017-02-06  Chris Dumez  <cdumez@apple.com>
2338
2339         Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects
2340         https://bugs.webkit.org/show_bug.cgi?id=167647
2341         <rdar://problem/30339489>
2342
2343         Reviewed by Sam Weinig.
2344
2345         Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects:
2346         - https://html.spec.whatwg.org/#windowproxy-ownpropertykeys [1]
2347         - https://html.spec.whatwg.org/#crossoriginownpropertykeys-(-o-) [2]
2348         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-) [3]
2349
2350         In particular, the following changes were made:
2351         - Location:
2352           - We now return the following symbols as well: @@toStringTag, @@hasInstance,
2353             @@isConcatSpreadable as per [2].
2354         - Window:
2355           - We now return the following symbols as well: @@toStringTag, @@hasInstance,
2356             @@isConcatSpreadable as per [2].
2357           - We now return the indices of the child browsing contexts as per [1].
2358           - We now return the names of the child browsing contexts as per [3].
2359
2360         No new tests, updated / rebaselined existing tests.
2361
2362         * bindings/js/JSDOMWindowCustom.cpp:
2363         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2364         Index properties should be configurable as per:
2365         - https://html.spec.whatwg.org/#windowproxy-getownproperty (step 2.5)
2366
2367         (WebCore::inScope):
2368         (WebCore::addScopedChildrenNames):
2369         (WebCore::addCrossOriginPropertyNames):
2370         (WebCore::addScopedChildrenIndexes):
2371         (WebCore::addCrossOriginOwnPropertyNames):
2372         (WebCore::JSDOMWindow::getOwnPropertyNames):
2373         * bindings/js/JSLocationCustom.cpp:
2374         (WebCore::addCrossOriginPropertyNames):
2375         (WebCore::addCrossOriginOwnPropertyNames):
2376         (WebCore::JSLocation::getOwnPropertyNames):
2377
2378 2017-02-06  Yoav Weiss  <yoav@yoav.ws>
2379
2380         http/tests/preload/dynamic_removing_preload.html fails to test what it should
2381         https://bugs.webkit.org/show_bug.cgi?id=167792
2382
2383         Reviewed by Ryosuke Niwa.
2384
2385         Cancel the link preload resource load when the link element is removed from the DOM.
2386
2387         No new tests, but unskipping an existing test: http/tests/preload/dynamic_removing_preload.html
2388
2389         * html/HTMLLinkElement.cpp:
2390         (WebCore::HTMLLinkElement::removedFrom): Call m_linkLoader.cancelLoad().
2391         * loader/LinkLoader.cpp:
2392         (WebCore::LinkLoader::cancelLoad): Clear m_preloadResourceClient.
2393         * loader/LinkLoader.h:
2394         * loader/LinkPreloadResourceClients.h:
2395         (WebCore::LinkPreloadResourceClient::clearResource): Call m_resource->cancelLoad().
2396         * loader/SubresourceLoader.cpp:
2397         (WebCore::LinkPreloadResourceClient::didFinishLoading): Change ASSERT to exempt cancelled loads.
2398
2399 2017-02-06  Alex Christensen  <achristensen@webkit.org>
2400
2401         More build fixes after r211751
2402         https://bugs.webkit.org/show_bug.cgi?id=166998
2403
2404         * platform/network/soup/ResourceHandleSoup.cpp:
2405         (WebCore::applyAuthenticationToRequest):
2406         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2407         (WebCore::SocketStreamHandleImpl::create):
2408
2409 2017-02-06  Alex Christensen  <achristensen@webkit.org>
2410
2411         Fix non-cocoa builds after r211751.
2412         https://bugs.webkit.org/show_bug.cgi?id=166998
2413
2414         * platform/network/cf/ResourceHandleCFNet.cpp:
2415         (WebCore::ResourceHandle::createCFURLConnection):
2416         (WebCore::ResourceHandle::willSendRequest):
2417         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
2418         (WebCore::ResourceHandle::receivedCredential):
2419         * platform/network/curl/ResourceHandleCurl.cpp:
2420         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2421         (WebCore::ResourceHandle::receivedCredential):
2422         * platform/network/curl/ResourceHandleManager.cpp:
2423         (WebCore::ResourceHandleManager::applyAuthenticationToRequest):
2424         * platform/network/soup/ResourceHandleSoup.cpp:
2425         (WebCore::applyAuthenticationToRequest):
2426         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2427         (WebCore::ResourceHandle::receivedCredential):
2428
2429 2017-02-06  Alex Christensen  <achristensen@webkit.org>
2430
2431         credentials should be partitioned by main document domain
2432         https://bugs.webkit.org/show_bug.cgi?id=166998
2433         rdar://problem/22901123
2434
2435         Reviewed by Brady Eidson.
2436
2437         Covered by http/tests/security/credentials-iframes.html
2438         Also added http/tests/security/credentials-from-different-domains.html to verify existing behavior without iframes.
2439
2440         * Modules/websockets/WebSocketChannel.cpp:
2441         (WebCore::WebSocketChannel::connect):
2442         * dom/Document.h:
2443         * page/SecurityOrigin.cpp:
2444         (WebCore::SecurityOrigin::domainForCachePartition):
2445         Return emptyString instead of a null String because it is used as a key in a HashMap, and hashing null strings dereferences null.
2446         * page/SocketProvider.cpp:
2447         (WebCore::SocketProvider::createSocketStreamHandle):
2448         * page/SocketProvider.h:
2449         * platform/network/CredentialStorage.cpp:
2450         (WebCore::CredentialStorage::set):
2451         (WebCore::CredentialStorage::get):
2452         (WebCore::CredentialStorage::remove):
2453         * platform/network/CredentialStorage.h:
2454         Partition credentials.
2455         * platform/network/ResourceHandleInternal.h:
2456         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2457         * platform/network/cf/SocketStreamHandleImpl.h:
2458         (WebCore::SocketStreamHandleImpl::create):
2459         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2460         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
2461         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
2462         * platform/network/curl/SocketStreamHandleImpl.h:
2463         (WebCore::SocketStreamHandleImpl::create):
2464         * platform/network/mac/ResourceHandleMac.mm:
2465         (WebCore::ResourceHandle::createNSURLConnection):
2466         (WebCore::ResourceHandle::willSendRequest):
2467         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
2468         (WebCore::ResourceHandle::receivedCredential):
2469         * platform/network/soup/SocketStreamHandleImpl.h:
2470
2471 2017-02-06  Simon Fraser  <simon.fraser@apple.com>
2472
2473         Safari pages are blank sometimes (missing tiles)
2474         https://bugs.webkit.org/show_bug.cgi?id=167904
2475
2476         Reviewed by Tim Horton.
2477
2478         After r211683 we failed to udpate the "inWindow" flag on the page tiled layer, because
2479         usingTiledBacking() on GraphicsLayer confusingly was false for the page tiled layer.
2480
2481         Fix by removing usingTiledBacking() entirely, and checking for tiledBacking(),
2482         looking at the layer type when necessary.
2483
2484         Tested by tiled-drawing/tiled-backing-in-window.html
2485
2486         * platform/graphics/GraphicsLayer.cpp:
2487         (WebCore::GraphicsLayer::GraphicsLayer):
2488         (WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): This is the bug fix.
2489         (WebCore::GraphicsLayer::getDebugBorderInfo):
2490         (WebCore::GraphicsLayer::dumpProperties):
2491         * platform/graphics/GraphicsLayer.h:
2492         (WebCore::GraphicsLayer::usingTiledBacking): Deleted.
2493         * platform/graphics/ca/GraphicsLayerCA.cpp:
2494         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2495         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2496         (WebCore::GraphicsLayerCA::changeLayerTypeTo):
2497         * rendering/RenderLayerBacking.cpp:
2498         (WebCore::RenderLayerBacking::willDestroyLayer):
2499         (WebCore::RenderLayerBacking::compositingLayerType):
2500         * rendering/RenderLayerCompositor.cpp: A bit more logging.
2501         (WebCore::RenderLayerCompositor::setIsInWindow):
2502         (WebCore::RenderLayerCompositor::attachRootLayer):
2503
2504 2017-02-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2505
2506         Change the CSS animation timer a to be little more than 60fps to ensure we hit that frame rate
2507         https://bugs.webkit.org/show_bug.cgi?id=167825
2508
2509         Reviewed by Simon Fraser.
2510
2511         The system timer fires little bit slower than 60fps. This might cause the
2512         frame to be missed and hence it can lower the frame rate significantly. The
2513         rAF timer was set to 15ms for the same reason. So set the repeated CSS
2514         animation timer also to 15ms.
2515
2516         * page/animation/CSSAnimationController.cpp:
2517
2518 2017-02-06  Jer Noble  <jer.noble@apple.com>
2519
2520         Playback stalls when a SourceBuffer append causes frame eviction
2521         https://bugs.webkit.org/show_bug.cgi?id=167834
2522
2523         Reviewed by Eric Carlson.
2524
2525         Test: PerformanceTests/Media/MSERemoveCodedFrames.html
2526
2527         Optimize searching through SampleMap by presentationTime.
2528
2529         Many of the methods exposed by PresentationOrderSampleMap used the bare  std::equal_range,
2530         lower_bound, or upper_bound methods. Unlike those methods exposed on std::map, the bare
2531         search methods perform a linear O(n) search, rather than a the binary O(log(n)) search used
2532         by std::map. Rewrite those methods using the bare methods in terms of the std::map search
2533         methods.
2534
2535         Drive-by fix: rename findSampleOnOrAfterPresentationTime to
2536         findSampleStartingOnOrAfterPresentationTime to make the behavior of the method more
2537         explicit.
2538
2539         * Modules/mediasource/SampleMap.cpp:
2540         (WebCore::PresentationOrderSampleMap::findSampleContainingPresentationTime):
2541         (WebCore::PresentationOrderSampleMap::findSampleStartingOnOrAfterPresentationTime):
2542         (WebCore::PresentationOrderSampleMap::reverseFindSampleBeforePresentationTime):
2543         (WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime):
2544         (WebCore::PresentationOrderSampleMap::findSamplesBetweenPresentationTimes):
2545         (WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRange):
2546         (WebCore::PresentationOrderSampleMap::findSampleOnOrAfterPresentationTime): Deleted.
2547         * Modules/mediasource/SampleMap.h:
2548         (WebCore::PresentationOrderSampleMap::begin):
2549         (WebCore::PresentationOrderSampleMap::end):
2550         (WebCore::PresentationOrderSampleMap::rbegin):
2551         (WebCore::PresentationOrderSampleMap::rend):
2552         (WebCore::DecodeOrderSampleMap::begin):
2553         (WebCore::DecodeOrderSampleMap::end):
2554         (WebCore::DecodeOrderSampleMap::rbegin):
2555         (WebCore::DecodeOrderSampleMap::rend):
2556         (WebCore::SampleMap::SampleMap):
2557         (WebCore::SampleMap::sizeInBytes):
2558         (WebCore::SampleMap::decodeOrder):
2559         (WebCore::SampleMap::presentationOrder):
2560         * Modules/mediasource/SourceBuffer.cpp:
2561         (WebCore::removeSamplesFromTrackBuffer):
2562         (WebCore::SourceBuffer::removeCodedFrames):
2563         (WebCore::SourceBuffer::reenqueueMediaForTime):
2564         * WebCore.xcodeproj/project.pbxproj:
2565
2566 2017-02-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2567
2568         Rename AnimationController to CSSAnimationController
2569         https://bugs.webkit.org/show_bug.cgi?id=167829
2570
2571         Reviewed by Simon Fraser.
2572
2573         AnimationController is a very generic name. The current function of this
2574         class is CSS animation.
2575
2576         * CMakeLists.txt:
2577         * WebCore.xcodeproj/project.pbxproj:
2578         * css/CSSComputedStyleDeclaration.cpp:
2579         (WebCore::computeRenderStyleForProperty):
2580         * dom/Document.cpp:
2581         * history/CachedFrame.cpp:
2582         * page/Frame.cpp:
2583         (WebCore::Frame::Frame):
2584         * page/Frame.h:
2585         (WebCore::Frame::animation):
2586         * page/FrameView.cpp:
2587         * page/Page.cpp:
2588         * page/animation/AnimationBase.cpp:
2589         * page/animation/CSSAnimationController.cpp: Renamed from Source/WebCore/page/animation/AnimationController.cpp.
2590         (WebCore::AnimationPrivateUpdateBlock::AnimationPrivateUpdateBlock):
2591         (WebCore::AnimationPrivateUpdateBlock::~AnimationPrivateUpdateBlock):
2592         (WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
2593         (WebCore::CSSAnimationControllerPrivate::~CSSAnimationControllerPrivate):
2594         (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
2595         (WebCore::CSSAnimationControllerPrivate::clear):
2596         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
2597         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
2598         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
2599         (WebCore::CSSAnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
2600         (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
2601         (WebCore::CSSAnimationControllerPrivate::startUpdateStyleIfNeededDispatcher):
2602         (WebCore::CSSAnimationControllerPrivate::addEventToDispatch):
2603         (WebCore::CSSAnimationControllerPrivate::addElementChangeToDispatch):
2604         (WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
2605         (WebCore::CSSAnimationControllerPrivate::animationTimerFired):
2606         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer):
2607         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
2608         (WebCore::CSSAnimationControllerPrivate::suspendAnimations):
2609         (WebCore::CSSAnimationControllerPrivate::resumeAnimations):
2610         (WebCore::CSSAnimationControllerPrivate::animationsAreSuspendedForDocument):
2611         (WebCore::CSSAnimationControllerPrivate::detachFromDocument):
2612         (WebCore::CSSAnimationControllerPrivate::suspendAnimationsForDocument):
2613         (WebCore::CSSAnimationControllerPrivate::resumeAnimationsForDocument):
2614         (WebCore::CSSAnimationControllerPrivate::startAnimationsIfNotSuspended):
2615         (WebCore::CSSAnimationControllerPrivate::setAllowsNewAnimationsWhileSuspended):
2616         (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
2617         (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
2618         (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
2619         (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
2620         (WebCore::CSSAnimationControllerPrivate::endAnimationUpdate):
2621         (WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
2622         (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
2623         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation):
2624         (WebCore::CSSAnimationControllerPrivate::numberOfActiveAnimations):
2625         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle):
2626         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle):
2627         (WebCore::CSSAnimationControllerPrivate::styleAvailable):
2628         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse):
2629         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse):
2630         (WebCore::CSSAnimationControllerPrivate::startTimeResponse):
2631         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
2632         (WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll):
2633         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll):
2634         (WebCore::CSSAnimationControllerPrivate::scrollWasUpdated):
2635         (WebCore::CSSAnimationController::CSSAnimationController):
2636         (WebCore::CSSAnimationController::~CSSAnimationController):
2637         (WebCore::CSSAnimationController::cancelAnimations):
2638         (WebCore::CSSAnimationController::updateAnimations):
2639         (WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
2640         (WebCore::CSSAnimationController::computeExtentOfAnimation):
2641         (WebCore::CSSAnimationController::notifyAnimationStarted):
2642         (WebCore::CSSAnimationController::pauseAnimationAtTime):
2643         (WebCore::CSSAnimationController::numberOfActiveAnimations):
2644         (WebCore::CSSAnimationController::pauseTransitionAtTime):
2645         (WebCore::CSSAnimationController::isRunningAnimationOnRenderer):
2646         (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer):
2647         (WebCore::CSSAnimationController::isSuspended):
2648         (WebCore::CSSAnimationController::suspendAnimations):
2649         (WebCore::CSSAnimationController::resumeAnimations):
2650         (WebCore::CSSAnimationController::allowsNewAnimationsWhileSuspended):
2651         (WebCore::CSSAnimationController::setAllowsNewAnimationsWhileSuspended):
2652         (WebCore::CSSAnimationController::serviceAnimations):
2653         (WebCore::CSSAnimationController::animationsAreSuspendedForDocument):
2654         (WebCore::CSSAnimationController::detachFromDocument):
2655         (WebCore::CSSAnimationController::suspendAnimationsForDocument):
2656         (WebCore::CSSAnimationController::resumeAnimationsForDocument):
2657         (WebCore::CSSAnimationController::startAnimationsIfNotSuspended):
2658         (WebCore::CSSAnimationController::beginAnimationUpdate):
2659         (WebCore::CSSAnimationController::endAnimationUpdate):
2660         (WebCore::CSSAnimationController::supportsAcceleratedAnimationOfProperty):
2661         (WebCore::CSSAnimationController::wantsScrollUpdates):
2662         (WebCore::CSSAnimationController::scrollWasUpdated):
2663         (WebCore::CSSAnimationController::hasAnimations):
2664         * page/animation/CSSAnimationController.h: Renamed from Source/WebCore/page/animation/AnimationController.h.
2665         (WebCore::AnimationUpdateBlock::AnimationUpdateBlock):
2666         (WebCore::AnimationUpdateBlock::~AnimationUpdateBlock):
2667         * page/animation/CSSAnimationControllerPrivate.h: Renamed from Source/WebCore/page/animation/AnimationControllerPrivate.h.
2668         (WebCore::CSSAnimationControllerPrivate::hasAnimations):
2669         (WebCore::CSSAnimationControllerPrivate::isSuspended):
2670         (WebCore::CSSAnimationControllerPrivate::setBeginAnimationUpdateTime):
2671         (WebCore::CSSAnimationControllerPrivate::allowsNewAnimationsWhileSuspended):
2672         (WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates):
2673         (WebCore::CSSAnimationControllerPrivate::scrollPosition):
2674         * page/animation/CSSPropertyAnimation.cpp:
2675         (WebCore::CSSPropertyAnimationWrapperMap::singleton):
2676         * page/animation/CompositeAnimation.cpp:
2677         (WebCore::CompositeAnimation::CompositeAnimation):
2678         * page/animation/CompositeAnimation.h:
2679         (WebCore::CompositeAnimation::create):
2680         (WebCore::CompositeAnimation::animationController):
2681         * page/animation/ImplicitAnimation.cpp:
2682         * page/animation/KeyframeAnimation.cpp:
2683         * page/ios/FrameIOS.mm:
2684         * platform/graphics/GraphicsLayer.h:
2685         * rendering/RenderElement.h:
2686         * rendering/RenderLayer.cpp:
2687         * rendering/RenderLayerBacking.cpp:
2688         * rendering/RenderLayerCompositor.cpp:
2689         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2690         * rendering/RenderObject.cpp:
2691         * rendering/RenderObject.h:
2692         (WebCore::RenderObject::animation):
2693         * testing/Internals.cpp:
2694
2695 2017-02-06  Zalan Bujtas  <zalan@apple.com>
2696
2697         Simple line layout: Use simplified text measuring when possible.
2698         https://bugs.webkit.org/show_bug.cgi?id=167843
2699         <rdar://problem/30364907>
2700
2701         Reviewed by Antti Koivisto.
2702
2703         This patch adds a simplified version of text width measuring.
2704         Certain type of text runs (no spacing etc) only require a subset of what we
2705         currently do in FontCascade::width().
2706
2707         * platform/graphics/FontCascade.cpp:
2708         (WebCore::FontCascade::widthForSimpleText):
2709         * platform/graphics/FontCascade.h:
2710         * platform/graphics/WidthCache.h:
2711         (WebCore::WidthCache::add):
2712         (WebCore::WidthCache::addSlowCase):
2713         * platform/graphics/WidthIterator.cpp:
2714         (WebCore::WidthIterator::advanceInternal):
2715         * rendering/RenderText.cpp:
2716         (WebCore::RenderText::styleDidChange):
2717         (WebCore::RenderText::setRenderedText):
2718         (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring):
2719         * rendering/RenderText.h:
2720         (WebCore::RenderText::canUseSimplifiedTextMeasuring):
2721         * rendering/SimpleLineLayoutFlowContents.cpp:
2722         (WebCore::SimpleLineLayout::initializeSegments):
2723         * rendering/SimpleLineLayoutFlowContents.h:
2724         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2725         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2726         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
2727         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
2728         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2729
2730 2017-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
2731
2732         Resource usage overlay should ignore mouse events outside bounds by default
2733         https://bugs.webkit.org/show_bug.cgi?id=167874
2734
2735         Reviewed by Andreas Kling.
2736
2737         It's overriding the default causing that the first click after the overlay is shown is always handled by the
2738         overlay even when clicked outside bounds. It should only be set false while dragging.
2739
2740         * page/ResourceUsageOverlay.cpp:
2741         (WebCore::ResourceUsageOverlay::initialize):
2742
2743 2017-02-06  Antti Koivisto  <antti@apple.com>
2744
2745         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Node::invalidateStyle
2746         https://bugs.webkit.org/show_bug.cgi?id=167878
2747         rdar://problem/30251840
2748
2749         Reviewed by Andreas Kling.
2750
2751         Speculative fix.
2752
2753         We are trying to invalidate a null node from ~PostResolutionCallbackDisabler. Looks like the only way
2754         this could happen is if HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition is called
2755         with null 'this'. There is one place where this might happen.
2756
2757         * rendering/RenderLayerCompositor.cpp:
2758         (WebCore::RenderLayerCompositor::attachRootLayer): Add null check.
2759
2760 2017-02-06  Ryan Haddad  <ryanhaddad@apple.com>
2761
2762         Unreviewed, rolling out r211722.
2763
2764         This change introduced a LayoutTest failure on mac-wk2.
2765
2766         Reverted changeset:
2767
2768         "[Modern Media Controls] Improve handling of <video> with only
2769         audio tracks"
2770         https://bugs.webkit.org/show_bug.cgi?id=167836
2771         http://trac.webkit.org/changeset/211722
2772
2773 2017-02-06  Eric Carlson  <eric.carlson@apple.com>
2774
2775         [MediaStream Mac] Stop using AVSampleBufferAudioRenderer
2776         https://bugs.webkit.org/show_bug.cgi?id=167821
2777
2778         Reviewed by Jer Noble.
2779
2780         * WebCore.xcodeproj/project.pbxproj: Add new files.
2781
2782         * platform/audio/mac/AudioSampleDataSource.cpp:
2783         (WebCore::AudioSampleDataSource::pullSamplesInternal): Don't assume the first timestamp from the
2784         render proc after a pause is zero.
2785
2786         Stop using an audio renderer for each audio track. No audio renderers means we don't need to use
2787         an AVSampleBufferRenderSynchronizer.
2788         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2789         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2790         (-[WebAVSampleBufferStatusChangeListener invalidate]): No more audio renderers.
2791         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]): Ditto.
2792         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
2793         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Pause
2794           audio tracks explicitly.
2795         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioSourceProvider): Remove the existing code,
2796           it was incorrect and not thread safe.
2797         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushRenderers): No more audio renderers.
2798         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): No more render synchronizer.
2799         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Ditto.
2800         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start each audio track.
2801         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Pause each audio track.
2802         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): Pass the command to each audio track.
2803         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto.
2804         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::streamTime): No more render synchronizer.
2805         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Don't handle audio samples.
2806         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Update for audio track class change. No
2807         more render synchronizer.
2808         (-[WebAVSampleBufferStatusChangeListener beginObservingRenderer:]): Deleted.
2809         (-[WebAVSampleBufferStatusChangeListener stopObservingRenderer:]): Deleted.
2810         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSample): Deleted.
2811         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForAudioData): Deleted.
2812         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createAudioRenderer): Deleted.
2813         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyAudioRenderer): Deleted.
2814         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyAudioRenderers): Deleted.
2815         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::rendererStatusDidChange): Deleted.
2816
2817         * platform/mediastream/AudioTrackPrivateMediaStream.h:
2818
2819         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2820         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate): add/removeObserver takes a reference,
2821         not a pointer.
2822         (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate): Ditto.
2823         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable): Renamed from sourceHasMoreMediaData.
2824         (WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Deleted.
2825         * platform/mediastream/MediaStreamTrackPrivate.h:
2826
2827         * platform/mediastream/RealtimeMediaSource.cpp:
2828         (WebCore::RealtimeMediaSource::addObserver): Take a reference, not a pointer.
2829         (WebCore::RealtimeMediaSource::removeObserver): Ditto.
2830         (WebCore::RealtimeMediaSource::videoSampleAvailable): Renamed from mediaDataUpdated.
2831         (WebCore::RealtimeMediaSource::audioSamplesAvailable): New.
2832         (WebCore::RealtimeMediaSource::stop): Drive-by cleanup.
2833         (WebCore::RealtimeMediaSource::requestStop): Ditto.
2834         (WebCore::RealtimeMediaSource::mediaDataUpdated): Deleted.
2835         * platform/mediastream/RealtimeMediaSource.h:
2836
2837         * platform/mediastream/mac/AVAudioCaptureSource.h:
2838         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2839         (WebCore::AVAudioCaptureSource::AVAudioCaptureSource):
2840         (WebCore::AVAudioCaptureSource::addObserver):
2841         (WebCore::AVAudioCaptureSource::shutdownCaptureSession):
2842         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2843         (WebCore::operator==): Deleted.
2844         (WebCore::operator!=): Deleted.
2845
2846         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2847         (WebCore::AVVideoCaptureSource::processNewFrame): Call videoSampleAvailable, not mediaDataUpdated.
2848
2849         Render audio with a CoreAudio output unit.
2850         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: Added.
2851         (WebCore::AudioTrackPrivateMediaStreamCocoa::AudioTrackPrivateMediaStreamCocoa):
2852         (WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
2853         (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
2854         (WebCore::AudioTrackPrivateMediaStreamCocoa::play):
2855         (WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
2856         (WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
2857         (WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit):
2858         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
2859         (WebCore::AudioTrackPrivateMediaStreamCocoa::sourceStopped):
2860         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
2861         (WebCore::AudioTrackPrivateMediaStreamCocoa::inputProc):
2862         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h: Added.
2863
2864         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
2865         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2866         (WebCore::alignTo16Bytes):
2867         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
2868         (WebCore::MockRealtimeAudioSourceMac::reconfigure): Minor cleanup.
2869         (WebCore::MockRealtimeAudioSourceMac::render): Ditto.
2870
2871         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2872         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Call videoSampleAvailable, not mediaDataUpdated.
2873
2874         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
2875         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2876         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
2877         (WebCore::WebAudioSourceProviderAVFObjC::provideInput): Use a mutex. Get rid of m_writeAheadCount,
2878         it is always 0.
2879         (WebCore::WebAudioSourceProviderAVFObjC::prepare): Use a lock.
2880         (WebCore::WebAudioSourceProviderAVFObjC::unprepare): Ditto.
2881         (WebCore::WebAudioSourceProviderAVFObjC::process): Ditto.
2882         * platform/mock/MockRealtimeAudioSource.h:
2883         (WebCore::MockRealtimeAudioSource::renderInterval): Decrease the render interval.
2884
2885 2017-02-06  Antoine Quint  <graouts@apple.com>
2886
2887         [Modern Media Controls] Add a backdrop filter to the start button on macOS
2888         https://bugs.webkit.org/show_bug.cgi?id=167879
2889         <rdar://problem/30375174>
2890
2891         Reviewed by Eric Carlson.
2892
2893         Add a backdrop filter to the start button on macOS.
2894
2895         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-start-button-style.html
2896
2897         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
2898         (.media-controls.mac.inline > button.start > div):
2899
2900 2017-02-06  Antoine Quint  <graouts@apple.com>
2901
2902         [Modern Media Controls] Bring fullscreen controls up to spec
2903         https://bugs.webkit.org/show_bug.cgi?id=167875
2904         <rdar://problem/29611222>
2905
2906         Reviewed by Eric Carlson.
2907
2908         We update the fullscreen PiP icon to have the correct size and add two new buttons
2909         around the volume slider, "volume-down" to bring the volume to 0 and "volume-up"
2910         to bring the volume to 1.
2911
2912         To accomodate the new volume buttons, we move the volume slider inside an additional
2913         ButtonsContainer object, along with the two new buttons.
2914
2915         Tests: media/modern-media-controls/volume-down-support/volume-down-support.html
2916                media/modern-media-controls/volume-up-support/volume-up-support.html
2917
2918         * Modules/modern-media-controls/controls/icon-service.js:
2919         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
2920         (.media-controls.mac.fullscreen button.volume-down):
2921         (.media-controls.mac.fullscreen button.volume-up):
2922         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2923         * Modules/modern-media-controls/controls/volume-down-button.js: Added.
2924         (VolumeDownButton):
2925         * Modules/modern-media-controls/controls/volume-slider.js:
2926         (VolumeSlider):
2927         * Modules/modern-media-controls/controls/volume-up-button.js: Added.
2928         (VolumeUpButton):
2929         * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png:
2930         * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png:
2931         * Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png: Added.
2932         * Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png: Added.
2933         * Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png: Added.
2934         * Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png: Added.
2935         * Modules/modern-media-controls/js-files:
2936         * Modules/modern-media-controls/media/media-controller.js:
2937         (MediaController.prototype._updateControlsIfNeeded):
2938         * Modules/modern-media-controls/media/volume-down-support.js: Added.
2939         (VolumeDownSupport.prototype.get control):
2940         (VolumeDownSupport.prototype.buttonWasPressed):
2941         (VolumeDownSupport):
2942         * Modules/modern-media-controls/media/volume-up-support.js: Added.
2943         (VolumeUpSupport.prototype.get control):
2944         (VolumeUpSupport.prototype.buttonWasPressed):
2945         (VolumeUpSupport):
2946         * WebCore.xcodeproj/project.pbxproj:
2947
2948 2017-02-06  Antoine Quint  <graouts@apple.com>
2949
2950         [Modern Media Controls] Improve handling of <video> with only audio tracks
2951         https://bugs.webkit.org/show_bug.cgi?id=167836
2952         <rdar://problem/30255812>
2953
2954         Reviewed by Dean Jackson.
2955
2956         We now check for the availability of video tracks before considering a <video>
2957         element is displaying an actual video file and turning auto-hide on. We also
2958         check that we have video tracks before enabling the fullscreen button. This
2959         brings the behavior of a <video> pointing to a resource with no video tracks
2960         to be the same as an <audio> element.
2961
2962         Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
2963
2964         * Modules/modern-media-controls/media/controls-visibility-support.js:
2965         (ControlsVisibilitySupport.prototype.get tracksToMonitor):
2966         (ControlsVisibilitySupport.prototype._updateControls):
2967         (ControlsVisibilitySupport):
2968         * Modules/modern-media-controls/media/fullscreen-support.js:
2969         (FullscreenSupport.prototype.syncControl):
2970         (FullscreenSupport):
2971
2972 2017-02-06  Alex Christensen  <achristensen@webkit.org>
2973
2974         Fix WinCairo build after r211681
2975         https://bugs.webkit.org/show_bug.cgi?id=167096
2976
2977         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
2978         Include some necessary GLES headers.
2979
2980 2017-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2981
2982         Data interaction fails in Safari splitscreen mode when dropping into a contenteditable
2983         https://bugs.webkit.org/show_bug.cgi?id=167862
2984         <rdar://problem/30368405>
2985
2986         Reviewed by Tim Horton.
2987
2988         Adds a counter to WebItemProviderPasteboard that can incremented, decremented, and queried by clients.
2989
2990         * platform/ios/WebItemProviderPasteboard.h:
2991         * platform/ios/WebItemProviderPasteboard.mm:
2992         (-[WebItemProviderPasteboard init]):
2993         (-[WebItemProviderPasteboard hasPendingOperation]):
2994         (-[WebItemProviderPasteboard incrementPendingOperationCount]):
2995         (-[WebItemProviderPasteboard decrementPendingOperationCount]):
2996
2997 2017-02-05  Simon Fraser  <simon.fraser@apple.com>
2998
2999         Remove unparentsOffscreenTiles logic in TileController
3000         https://bugs.webkit.org/show_bug.cgi?id=167823
3001
3002         Reviewed by Tim Horton.
3003
3004         Give all TileGrids the "unparents offscreen tiles" behavior. This was enabled for
3005         only the page tiles in WK2 on Mac and iOS, but there's no reason to not use it for
3006         tiled composited layers also.
3007
3008         Also use more modern C++ idioms in a few places.
3009
3010         * platform/graphics/TiledBacking.h:
3011         * platform/graphics/ca/TileController.h:
3012         * platform/graphics/ca/TileGrid.cpp:
3013         (WebCore::TileGrid::revalidateTiles):
3014         (WebCore::TileGrid::ensureTilesForRect):
3015         * rendering/RenderLayerBacking.cpp:
3016         (WebCore::RenderLayerBacking::RenderLayerBacking):
3017
3018 2017-02-05  Antoine Quint  <graouts@apple.com>
3019
3020         [Modern Media Controls] PiP button is not visible with a live broadcast video
3021         https://bugs.webkit.org/show_bug.cgi?id=167794
3022         <rdar://problem/30348790>
3023
3024         Reviewed by Dean Jackson.
3025
3026         We were only listening to the "loadedmetadata", "error", "webkitpresentationmodechanged"
3027         and "webkitcurrentplaybacktargetiswirelesschanged" events to invalidate the enabled state
3028         for the PiP button. We also need to check availability of video tracks, which we already
3029         did for fullscreen, which is quite similar.
3030         
3031         So we now listen to "addtrack", "removetrack" and "change" events on the media.videoTracks
3032         property, which correctly invalidates the PiP button when the first video track becomes
3033         available or the last video track is removed.
3034
3035         Since a couple of other MediaControllerSupport subclasses (FullscreenSupport and TracksSupport)
3036         would also listen to those events on various track types, we add a new "tracksToMonitor"
3037         property on MediaControllerSupport which subclasses can override to provide a list of tracks
3038         that should listen to those events. This removes the need for dedicated construction and
3039         destruction time in MediaControllerSupport subclasses that need to listen to events on
3040         tracks rather than the media itself.
3041
3042         Test: http/tests/media/modern-media-controls/pip-support/pip-support-live-broadcast.html
3043
3044         * Modules/modern-media-controls/media/fullscreen-support.js:
3045         (FullscreenSupport):
3046         (FullscreenSupport.prototype.get tracksToMonitor):
3047         (FullscreenSupport.prototype.destroy): Deleted.
3048         * Modules/modern-media-controls/media/media-controller-support.js:
3049         (MediaControllerSupport):
3050         (MediaControllerSupport.prototype.destroy):
3051         (MediaControllerSupport.prototype.get tracksToMonitor):
3052         * Modules/modern-media-controls/media/pip-support.js:
3053         (PiPSupport.prototype.get tracksToMonitor):
3054         * Modules/modern-media-controls/media/tracks-support.js:
3055         (TracksSupport):
3056         (TracksSupport.prototype.get tracksToMonitor):
3057         (TracksSupport.prototype.destroy): Deleted.
3058
3059 2017-02-05  Antoine Quint  <graouts@apple.com>
3060
3061         [Modern Media Controls] Time labels may wrap instead of displaying on a single line
3062         https://bugs.webkit.org/show_bug.cgi?id=167835
3063         <rdar://problem/30340534>
3064
3065         Reviewed by Dean Jackson.
3066
3067         No text in modern media controls is expected to wrap, so let's prevent any wrapping.
3068
3069         Test: media/modern-media-controls/time-label/time-label-white-space-nowrap.html
3070
3071         * Modules/modern-media-controls/controls/media-controls.css:
3072         (.media-controls):
3073
3074 2017-02-04  Simon Fraser  <simon.fraser@apple.com>
3075
3076         Clean up how GraphicsLayer's "inWindow" state is set, and fix some issues with Page Overlays
3077         https://bugs.webkit.org/show_bug.cgi?id=167850
3078
3079         Reviewed by Tim Horton.
3080         
3081         RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants() walked the RenderLayer
3082         tree to set the GraphicsLayer's "inWindow" state. This had the problem of skipping non-primary
3083         GraphicsLayers. We also never did this work for page overlay layers.
3084
3085         Fix by giving GraphicsLayers a recursive function that sets the inWindow state, and call that
3086         from RenderLayerCompositor::setIsInWindow() and PageOverlayController.
3087
3088         PageOverlayController also needs to implement tiledBackingUsageChanged so that tiled backings
3089         created dynamically get the correct in-window state.
3090
3091         Page overlays also had some serious issues in MiniBrowser, in that they disappeared on reload,
3092         and on hide/show web view. This was because the overlay root layers were re-parented, but
3093         addChild() for each overlay's layer wasn't called. Clean up by replacing willAttachRootLayer() followed
3094         by viewOverlayRootLayer()/documentOverlayRootLayer() with single calls that set up the layers,
3095         update the inWindow state, and return the layer.
3096
3097         Make it possible to dump tile caches in page overlay tests.
3098
3099         Make showGraphicsLayers() always dump page overlay layers (source of much confusion).
3100
3101         Test: pageoverlay/overlay-remove-reinsert-view.html
3102
3103         * page/PageOverlayController.cpp:
3104         (WebCore::PageOverlayController::documentOverlayRootLayer):
3105         (WebCore::PageOverlayController::viewOverlayRootLayer):
3106         (WebCore::PageOverlayController::layerWithDocumentOverlays):
3107         (WebCore::PageOverlayController::layerWithViewOverlays):
3108         (WebCore::PageOverlayController::tiledBackingUsageChanged):
3109         (WebCore::PageOverlayController::willAttachRootLayer): Deleted.
3110         * page/PageOverlayController.h:
3111         * platform/graphics/GraphicsLayer.cpp:
3112         (WebCore::GraphicsLayer::setIsInWindowIncludingDescendants):
3113         (WebCore::dumpChildren):
3114         * platform/graphics/GraphicsLayer.h:
3115         * rendering/RenderLayerCompositor.cpp:
3116         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
3117         (WebCore::RenderLayerCompositor::setIsInWindow):
3118         (WebCore::RenderLayerCompositor::attachRootLayer):
3119         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
3120         (WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants): Deleted.
3121         * rendering/RenderLayerCompositor.h:
3122         * testing/Internals.cpp:
3123         (WebCore::toLayerTreeFlags):
3124         (WebCore::Internals::layerTreeAsText):
3125         (WebCore::Internals::pageOverlayLayerTreeAsText):
3126         * testing/Internals.h:
3127         * testing/Internals.idl:
3128         * testing/MockPageOverlayClient.cpp:
3129         (WebCore::MockPageOverlayClient::layerTreeAsText):
3130         * testing/MockPageOverlayClient.h:
3131
3132 2017-02-05  Zalan Bujtas  <zalan@apple.com>
3133
3134         Simple line layout: Use RenderText::canUseSimpleFontCodePath() only as a hint.
3135         https://bugs.webkit.org/show_bug.cgi?id=167853
3136         <rdar://problem/30367302>
3137
3138         Reviewed by Simon Fraser.
3139
3140         Apparently RenderText::canUseSimpleFontCodePath() only checks if the string is qualified for
3141         the simple font code path. However certain css properties could still force us to use the complex
3142         path.
3143         In most cases, we still do only one string traversal thanks to TextRun::setCharacterScanForCodePath(). 
3144
3145         Test: fast/text/simple-line-layout-simple-text-but-complex-font-path.html
3146
3147         * rendering/SimpleLineLayout.cpp:
3148         (WebCore::SimpleLineLayout::canUseForFontAndText):
3149
3150 2017-02-05  Zan Dobersek  <zdobersek@igalia.com>
3151
3152         Move TextureMapper-specific logic out of GraphicsContext3DPrivate
3153         https://bugs.webkit.org/show_bug.cgi?id=167096
3154
3155         Reviewed by Alex Christensen.
3156
3157         Move the TextureMapper-specific functionality in GraphicsContext3DPrivate into a
3158         separate class. The new TextureMapperGC3DPlatformLayer class inherits from the
3159         class that's aliased to the PlatformLayer type, like GraphicsContext3DPrivate did
3160         before.
3161
3162         In GraphicsContext3D, the new m_texmapLayer member variable of the
3163         std::unique_ptr<TextureMapperGC3DPlatformLayer> type is used for configurations
3164         that enable TextureMapper, largely the same way the GraphicsContext3DPrivate
3165         object was used before. The remaining code in GraphicsContext3DPrivate is left
3166         unchanged to keep it working for other ports.
3167
3168         No new tests -- no change in behavior.
3169
3170         * platform/TextureMapper.cmake:
3171         * platform/graphics/GraphicsContext3D.h:
3172         * platform/graphics/GraphicsContext3DPrivate.cpp:
3173         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
3174         (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate): Deleted.
3175         (WebCore::GraphicsContext3DPrivate::proxy): Deleted.
3176         (WebCore::GraphicsContext3DPrivate::swapBuffersIfNeeded): Deleted.
3177         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper): Deleted.
3178         * platform/graphics/GraphicsContext3DPrivate.h:
3179         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3180         (WebCore::GraphicsContext3D::GraphicsContext3D):
3181         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3182         (WebCore::GraphicsContext3D::makeContextCurrent):
3183         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
3184         (WebCore::GraphicsContext3D::platformLayer):
3185         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3186         (WebCore::GraphicsContext3D::createForCurrentGLContext):
3187         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: Copied from Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp.
3188         (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
3189         (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
3190         (WebCore::TextureMapperGC3DPlatformLayer::makeContextCurrent):
3191         (WebCore::TextureMapperGC3DPlatformLayer::platformContext):
3192         (WebCore::TextureMapperGC3DPlatformLayer::proxy):
3193         (WebCore::TextureMapperGC3DPlatformLayer::swapBuffersIfNeeded):
3194         (WebCore::TextureMapperGC3DPlatformLayer::paintToTextureMapper):
3195         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DPrivate.h.
3196         (WebCore::TextureMapperGC3DPlatformLayer::renderStyle):
3197
3198 2017-02-05  Zalan Bujtas  <zalan@apple.com>
3199
3200         Simple line layout: Bail out from Simple Line Layout on surrogate pairs.
3201         https://bugs.webkit.org/show_bug.cgi?id=167840
3202         <rdar://problem/30364784>
3203
3204         Reviewed by Myles C. Maxfield.
3205
3206         Surrogate pairs require special line breaking logic. 
3207
3208         Test: fast/text/simple-line-layout-no-surrogate-pairs.html
3209
3210         * rendering/SimpleLineLayout.cpp:
3211         (WebCore::SimpleLineLayout::canUseForCharacter):
3212         (WebCore::SimpleLineLayout::canUseForText): Checking against special characters is faster than
3213         checking against glyphs. Reverse their order. 
3214         (WebCore::SimpleLineLayout::printReason):
3215
3216 2017-02-04  Joseph Pecoraro  <pecoraro@apple.com>
3217
3218         Static Analyzer: WebCoreNSURLExtras.mm: Potential leak of memory pointed to by 'allBytesBuffer'
3219         https://bugs.webkit.org/show_bug.cgi?id=167849
3220
3221         Reviewed by Sam Weinig.
3222
3223         Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:883:20: warning: Potential leak of memory pointed to by 'allBytesBuffer'
3224                     return nil;
3225                            ^~~
3226
3227         * platform/mac/WebCoreNSURLExtras.mm:
3228         (WebCore::dataForURLComponentType):
3229         Free the potentially malloc'd buffer before the early return.
3230
3231 2017-02-04  Chris Dumez  <cdumez@apple.com>
3232
3233         Unreviewed, fix mistake in comment added in r211569.
3234
3235         * history/PageCache.cpp:
3236         (WebCore::PageCache::removeAllItemsForPage):
3237
3238 2017-02-04  Yoav Weiss  <yoav@yoav.ws>
3239
3240         Fix memory issues related to preload eviction.
3241         https://bugs.webkit.org/show_bug.cgi?id=167838
3242
3243         Reviewed by Andreas Kling.
3244
3245         This avoids removing resources from m_preloads during the iteration
3246         by creating a second HashSetList containing the remaining link preloads.
3247
3248         No new tests but this will fix crashes on the leak bots.
3249
3250         * loader/cache/CachedResourceLoader.cpp:
3251         (WebCore::CachedResourceLoader::clearPreloads):
3252
3253 2017-02-04  Zalan Bujtas  <zalan@apple.com>
3254
3255         Simple line layout: Skip 16bit specific checks on 8bit content.
3256         https://bugs.webkit.org/show_bug.cgi?id=167831
3257         <rdar://problem/30361948>
3258
3259         Reviewed by Antti Koivisto and Myles C. Maxfield.
3260
3261         Skip various checks on 8bit content.
3262
3263         Covered by existing tests.
3264
3265         * rendering/SimpleLineLayout.cpp:
3266         (WebCore::SimpleLineLayout::canUseForCharacter):
3267         (WebCore::SimpleLineLayout::canUseForText):
3268         (WebCore::SimpleLineLayout::canUseForFontAndText):
3269
3270 2017-02-03  Zalan Bujtas  <zalan@apple.com>
3271
3272         Simple line layout: Remove redundant codepath check.
3273         https://bugs.webkit.org/show_bug.cgi?id=167827
3274         <rdar://problem/30361850>
3275
3276         Reviewed by Myles C. Maxfield.
3277
3278         FontCascade::codePath() iterates through the entire text. It's rather wasteful to do twice.
3279
3280         No change in functionality.
3281
3282         * rendering/SimpleLineLayout.cpp:
3283         (WebCore::SimpleLineLayout::canUseForFontAndText):
3284         (WebCore::SimpleLineLayout::printReason):
3285
3286 2017-02-03  Myles C. Maxfield  <mmaxfield@apple.com>
3287
3288         REGRESSION(r204858): Synthetic bold text in vertical writing mode is rotated away from original text
3289         https://bugs.webkit.org/show_bug.cgi?id=167826
3290         <rdar://problem/28193222>
3291
3292         Reviewed by Zalan Bujtas.
3293
3294         When drawing vertical text, the rotation is not reset between successive paint calls. We implement
3295         synthetic bold by drawing text twice, which means that the second draw call was getting rotated
3296         twice. This was an oversight in r204858.
3297
3298         Test: fast/text/synthetic-bold-vertical-text.html
3299
3300         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3301         (WebCore::showGlyphsWithAdvances):
3302
3303 2017-02-03  Joseph Pecoraro  <pecoraro@apple.com>
3304
3305         Performance Timing: Convert WTF::MonotonicTime and WTF::Seconds
3306         https://bugs.webkit.org/show_bug.cgi?id=167768
3307
3308         Reviewed by Geoffrey Garen.
3309
3310         The public APIs still return double (DOMHighResTimeStamp), which
3311         is milliseconds since a time origin:
3312         https://w3c.github.io/hr-time/#dom-domhighrestimestamp
3313
3314         * loader/LoadTiming.cpp:
3315         (WebCore::LoadTiming::secondsSinceStartTime):
3316         (WebCore::LoadTiming::monotonicTimeToPseudoWallTime):
3317         (WebCore::LoadTiming::markStartTime):
3318         (WebCore::LoadTiming::addRedirect):
3319         (WebCore::LoadTiming::monotonicTimeToZeroBasedDocumentTime): Deleted.
3320         * loader/LoadTiming.h:
3321         (WebCore::LoadTiming::markUnloadEventStart):
3322         (WebCore::LoadTiming::markUnloadEventEnd):
3323         (WebCore::LoadTiming::markRedirectStart):
3324         (WebCore::LoadTiming::markRedirectEnd):
3325         (WebCore::LoadTiming::markFetchStart):
3326         (WebCore::LoadTiming::setResponseEnd):
3327         (WebCore::LoadTiming::markLoadEventStart):
3328         (WebCore::LoadTiming::markLoadEventEnd):
3329         (WebCore::LoadTiming::startTime):
3330         (WebCore::LoadTiming::unloadEventStart):
3331         (WebCore::LoadTiming::unloadEventEnd):
3332         (WebCore::LoadTiming::redirectStart):
3333         (WebCore::LoadTiming::redirectEnd):
3334         (WebCore::LoadTiming::fetchStart):
3335         (WebCore::LoadTiming::responseEnd):
3336         (WebCore::LoadTiming::loadEventStart):
3337         (WebCore::LoadTiming::loadEventEnd):
3338         (WebCore::LoadTiming::redirectCount):
3339         (WebCore::LoadTiming::referenceMonotonicTime):
3340         (WebCore::LoadTiming::referenceWallTime):
3341         Use MonotonicTime and WallTime for timestamps and references.
3342
3343         * dom/Document.cpp:
3344         (WebCore::Document::setReadyState):
3345         (WebCore::Document::finishedParsing):
3346         (WebCore::Document::monotonicTimestamp):
3347         * dom/DocumentTiming.h:
3348         (WebCore::DocumentTiming::DocumentTiming): Deleted.
3349         * dom/ScriptedAnimationController.cpp:
3350         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3351         * inspector/InspectorNetworkAgent.cpp:
3352         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
3353         (WebCore::InspectorNetworkAgent::didFinishLoading):
3354         * loader/DocumentLoader.cpp:
3355         (WebCore::DocumentLoader::finishedLoading):
3356         (WebCore::DocumentLoader::dataReceived):
3357         * loader/DocumentLoader.h:
3358         * loader/SubresourceLoader.cpp:
3359         (WebCore::SubresourceLoader::didFinishLoading):
3360         * loader/cache/CachedResourceLoader.cpp:
3361         (WebCore::CachedResourceLoader::requestResource):
3362         * page/DOMWindow.cpp:
3363         (WebCore::DOMWindow::performance):
3364         Use new types instead of raw doubles.
3365
3366         * page/Performance.cpp:
3367         (WebCore::Performance::Performance):
3368         (WebCore::Performance::now):
3369         (WebCore::Performance::reduceTimeResolution):
3370         (WebCore::Performance::addResourceTiming):
3371         * page/Performance.h:
3372         Do time arithmatic with WTF::Time classes.
3373         This clarifies that we reduce our timestamps to 100us
3374         resolution instead of the maximum 5us allowed by the spec.
3375
3376         * page/PerformanceResourceTiming.cpp:
3377         (WebCore::monotonicTimeToDOMHighResTimeStamp):
3378         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
3379         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
3380         * page/PerformanceResourceTiming.h:
3381         * page/PerformanceTiming.cpp:
3382         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
3383         (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
3384         (WebCore::toIntegerMilliseconds): Deleted.
3385         * page/PerformanceTiming.h:
3386         Do time arithmatic with WTF::Time classes.
3387
3388         * workers/DedicatedWorkerGlobalScope.cpp:
3389         (WebCore::DedicatedWorkerGlobalScope::create):
3390         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
3391         * workers/DedicatedWorkerGlobalScope.h:
3392         * workers/DedicatedWorkerThread.cpp:
3393         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
3394         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
3395         * workers/DedicatedWorkerThread.h:
3396         * workers/WorkerGlobalScope.cpp:
3397         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3398         * workers/WorkerGlobalScope.h:
3399         * workers/WorkerGlobalScopeProxy.h:
3400         * workers/WorkerMessagingProxy.cpp:
3401         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3402         * workers/WorkerMessagingProxy.h:
3403         * workers/WorkerThread.cpp:
3404         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
3405         (WebCore::WorkerThread::WorkerThread):
3406         * workers/WorkerThread.h:
3407         Pass time origin as MonotonicTime.
3408
3409         * workers/Worker.cpp:
3410         (WebCore::Worker::create):