WebKit should default to using sRGB with NSColor conversion instead of device
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-05-08  Beth Dakin  <bdakin@apple.com>
2
3         WebKit should default to using sRGB with NSColor conversion instead of device 
4         color space
5         https://bugs.webkit.org/show_bug.cgi?id=171745
6         -and corresponding-
7         rdar://problem/28314183
8
9         Reviewed by Tim Horton.
10
11         * platform/graphics/mac/ColorMac.mm:
12         (WebCore::makeRGBAFromNSColor):
13         (WebCore::nsColor):
14
15 2017-05-08  Alex Christensen  <achristensen@webkit.org>
16
17         Reduce PassRefPtr use
18         https://bugs.webkit.org/show_bug.cgi?id=171809
19
20         Reviewed by Chris Dumez.
21
22         * platform/graphics/ca/PlatformCALayer.cpp:
23         (WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):
24         * platform/graphics/ca/PlatformCALayer.h:
25         * platform/graphics/ca/TileCoverageMap.cpp:
26         (WebCore::TileCoverageMap::TileCoverageMap):
27         * platform/graphics/ca/TileGrid.cpp:
28         (WebCore::TileGrid::TileGrid):
29         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
30         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
31         (PlatformCALayerCocoa::create):
32         (PlatformCALayerCocoa::clone):
33         (PlatformCALayerCocoa::animationForKey):
34         (PlatformCALayerCocoa::createCompatibleLayer):
35
36 2017-05-08  Jer Noble  <jer.noble@apple.com>
37
38         [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set.
39         https://bugs.webkit.org/show_bug.cgi?id=171710
40
41         Reviewed by Eric Carlson.
42
43         Both the shouldCaptureAudioInUIProcess setting and useAVFoundationAudioCapture setting were trying to set
44         the audio factory for RealtimeMediaSourceCenter, and were stomping on each others' changes. Change the way
45         the useAVFoundationAudioCapture works so that it only affects the defaultAudioFactory, allowing that default
46         to be overridden by the shuoldCaptureAudioInUIProcess setting when it calls setAudioFactory().
47
48         * page/Settings.cpp:
49         (WebCore::Settings::setUseAVFoundationAudioCapture):
50         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
51         (WebCore::RealtimeMediaSourceCenter::audioFactory):
52         (WebCore::RealtimeMediaSourceCenter::videoFactory):
53         (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager):
54         (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager):
55         * platform/mediastream/RealtimeMediaSourceCenter.h:
56         (WebCore::RealtimeMediaSourceCenter::audioFactory): Deleted.
57         (WebCore::RealtimeMediaSourceCenter::videoFactory): Deleted.
58         (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): Deleted.
59         (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): Deleted.
60         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
61         (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):
62         (WebCore::RealtimeMediaSourceCenterMac::singleton):
63         (WebCore::RealtimeMediaSourceCenter::platformCenter):
64         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
65         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager):
66         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
67
68 2017-05-04  Jiewen Tan  <jiewen_tan@apple.com>
69
70         Search events should not fire synchronously for search type input elements with incremental attribute set
71         https://bugs.webkit.org/show_bug.cgi?id=171376
72         <rdar://problem/31863296>
73
74         Reviewed by Chris Dumez.
75
76         For some reasons, we fire search events immediately for search type input elements with incremental
77         attribute set only when the length of the input equals to zero. This behaviour should be prevented
78         as event listeners in the middle might perform unexpectedly.
79
80         Test: fast/forms/search/search-incremental-crash.html
81
82         * html/SearchInputType.cpp:
83         (WebCore::SearchInputType::startSearchEventTimer):
84
85 2017-05-08  Zalan Bujtas  <zalan@apple.com>
86
87         Text overlaps on http://www.duden.de/rechtschreibung/Acre
88         https://bugs.webkit.org/show_bug.cgi?id=171796
89         <rdar://problem/31036028>
90
91         Reviewed by Simon Fraser.
92
93         Simple line layout pre-measures space using the primary font,
94         even if the space glyph requires a fallback font (and even if the string does not have a space in it at all).
95         When this width gets cached (see WidthCache) we might end up using it later during normal line layout and
96         it could produce incorrect layout.
97         This patch removes the space width caching from Simple line layout, since Font already caches it.
98
99         Test: fast/text/simple-line-layout-fallback-space-glyph.html
100
101         * rendering/SimpleLineLayout.cpp:
102         (WebCore::SimpleLineLayout::createLineRuns):
103         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
104         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
105         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
106         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
107         * rendering/SimpleLineLayoutTextFragmentIterator.h:
108
109 2017-05-08  Chris Dumez  <cdumez@apple.com>
110
111         Refactor ImageInputType::width() / height() for clarity
112         https://bugs.webkit.org/show_bug.cgi?id=171810
113
114         Reviewed by Zalan Bujtas.
115
116         Refactor ImageInputType::width() / height() for clarity.
117
118         * html/ImageInputType.cpp:
119         (WebCore::ImageInputType::height):
120         (WebCore::ImageInputType::width):
121
122 2017-05-08  Zalan Bujtas  <zalan@apple.com>
123
124         Bail out of simple line layout when hyphen needs a fallback font.
125         https://bugs.webkit.org/show_bug.cgi?id=171811
126
127         Reviewed by Antti Koivisto.
128
129         With hyphen: auto is set, we don't know if the hypen string is going to be used, until
130         after we started laying out the content and figured that the text overflows the line.
131         However it's too late to bail out of simple line layout at this point, so let's just
132         pre-check if the hyphen string needs a fallback font.
133
134         * rendering/SimpleLineLayout.cpp:
135         (WebCore::SimpleLineLayout::canUseForStyle):
136
137 2017-05-08  Youenn Fablet  <youenn@apple.com>
138
139         TURNS gathering is not working properly
140         https://bugs.webkit.org/show_bug.cgi?id=171747
141
142         Reviewed by Eric Carlson.
143
144         Covered by manual tests.
145
146         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
147         (WebCore::configurationFromMediaEndpointConfiguration): Reveting TURNS ice server skipping.
148
149 2017-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>
150
151         Unreviewed, rolling out r216419.
152
153         Broke 70 layout tests on GTK bot
154
155         Reverted changeset:
156
157         "Ensure clean tree before AX cache update."
158         https://bugs.webkit.org/show_bug.cgi?id=171546
159         http://trac.webkit.org/changeset/216419
160
161 2017-05-08  Youenn Fablet  <youenn@apple.com>
162
163         CoreAudioCaptureSource should not modify its shared unit if already started/stopped
164         https://bugs.webkit.org/show_bug.cgi?id=171804
165
166         Reviewed by Jer Noble.
167
168         Manual testing only since CoreAudioSharedUnit is not mocked.
169
170         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
171         (WebCore::CoreAudioCaptureSource::startProducingData): Exit early if source is already started.
172         (WebCore::CoreAudioCaptureSource::stopProducingData): Exit early if source is already stopped.
173
174 2017-05-08  Antti Koivisto  <antti@apple.com>
175
176         ComposedTreeIterator does not traverse all slotted children if the traversal root is a slot element.
177         https://bugs.webkit.org/show_bug.cgi?id=171375
178         <rdar://problem/31863184>
179
180         Reviewed by Zalan Bujtas.
181
182         We were hitting an assert when using details element with a flow thread. The root cause for this turned
183         out to be that we only traversed the first slotted child if the traversal root was a slot element.
184
185         Test: fast/html/details-flow-thread.html
186
187         * dom/ComposedTreeIterator.cpp:
188         (WebCore::ComposedTreeIterator::traverseNextLeavingContext):
189
190             Try to traverse to the next slotted child before testing if we at the end of the current context.
191
192 2017-05-08  Mark Lam  <mark.lam@apple.com>
193
194         Introduce ExceptionScope::assertNoException() and releaseAssertNoException().
195         https://bugs.webkit.org/show_bug.cgi?id=171776
196
197         Reviewed by Keith Miller.
198
199         No new tests because there's no behavior change in functionality.  We're only
200         refactoring the code to use the new assertion utility function.
201
202         * Modules/plugins/QuickTimePluginReplacement.mm:
203         (WebCore::QuickTimePluginReplacement::installReplacement):
204         * bindings/js/JSCryptoKeySerializationJWK.cpp:
205         (WebCore::getJSArrayFromJSON):
206         (WebCore::getStringFromJSON):
207         (WebCore::getBooleanFromJSON):
208         * bindings/js/JSCustomElementRegistryCustom.cpp:
209         (WebCore::JSCustomElementRegistry::whenDefined):
210         * bindings/js/JSDOMExceptionHandling.cpp:
211         (WebCore::propagateExceptionSlowPath):
212         (WebCore::throwNotSupportedError):
213         (WebCore::throwInvalidStateError):
214         (WebCore::throwSecurityError):
215         (WebCore::throwDOMSyntaxError):
216         (WebCore::throwDataCloneError):
217         (WebCore::throwIndexSizeError):
218         (WebCore::throwTypeMismatchError):
219         * bindings/js/JSDOMGlobalObject.cpp:
220         (WebCore::makeThisTypeErrorForBuiltins):
221         (WebCore::makeGetterTypeErrorForBuiltins):
222         * bindings/js/JSDOMGlobalObjectTask.cpp:
223         * bindings/js/JSDOMPromise.h:
224         (WebCore::callPromiseFunction):
225         * bindings/js/JSDOMWindowBase.cpp:
226         (WebCore::JSDOMWindowMicrotaskCallback::call):
227         * bindings/js/JSMainThreadExecState.h:
228         (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
229         * bindings/js/ReadableStreamDefaultController.cpp:
230         (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
231         * bindings/js/ReadableStreamDefaultController.h:
232         (WebCore::ReadableStreamDefaultController::enqueue):
233         * bindings/js/SerializedScriptValue.cpp:
234         (WebCore::CloneDeserializer::readTerminal):
235         * bindings/scripts/CodeGeneratorJS.pm:
236         (GenerateSerializerFunction):
237         * bindings/scripts/test/JS/JSTestNode.cpp:
238         (WebCore::JSTestNode::serialize):
239         * bindings/scripts/test/JS/JSTestObj.cpp:
240         (WebCore::JSTestObj::serialize):
241         * bindings/scripts/test/JS/JSTestSerialization.cpp:
242         (WebCore::JSTestSerialization::serialize):
243         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
244         (WebCore::JSTestSerializationInherit::serialize):
245         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
246         (WebCore::JSTestSerializationInheritFinal::serialize):
247         * contentextensions/ContentExtensionParser.cpp:
248         (WebCore::ContentExtensions::getTypeFlags):
249         * html/HTMLMediaElement.cpp:
250         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
251         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
252         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
253         * html/HTMLPlugInImageElement.cpp:
254         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
255
256 2017-05-08  Chris Dumez  <cdumez@apple.com>
257
258         Move 'style' from Element to HTMLElement / SVGElement and make it settable
259         https://bugs.webkit.org/show_bug.cgi?id=171795
260
261         Reviewed by Alex Christensen.
262
263         Move 'style' from Element to HTMLElement / SVGElement and make it settable
264         as per:
265         - https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-interface
266
267         Both Firefox and Chrome already match the specification (both for the
268         property location and having it settable).
269
270         Test: fast/css/Element-style.html
271
272         * CMakeLists.txt:
273         * DerivedSources.make:
274         * WebCore.xcodeproj/project.pbxproj:
275         * css/ElementCSSInlineStyle.idl: Added.
276         * css/PropertySetCSSStyleDeclaration.h:
277         * css/StyleProperties.cpp:
278         (WebCore::MutableStyleProperties::ensureCSSStyleDeclaration):
279         (WebCore::MutableStyleProperties::ensureInlineCSSStyleDeclaration):
280         * css/StyleProperties.h:
281         * dom/Attr.cpp:
282         (WebCore::Attr::style):
283         * dom/Document.cpp:
284         (WebCore::Document::createCSSStyleDeclaration):
285         * dom/Element.cpp:
286         * dom/Element.h:
287         * dom/Element.idl:
288         * dom/StyledElement.cpp:
289         (WebCore::StyledElement::cssomStyle):
290         * dom/StyledElement.h:
291         * editing/Editor.cpp:
292         (WebCore::Editor::applyEditingStyleToElement):
293         * editing/ReplaceSelectionCommand.cpp:
294         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
295         * html/HTMLElement.idl:
296
297         * html/ImageInputType.cpp:
298         (WebCore::ImageInputType::height):
299         (WebCore::ImageInputType::width):
300         Fix bug that was found by fast/forms/input-width-height-attributes-without-renderer-loaded-image.html.
301         That test relied on setting HTMLElement.style which did not work until now. Call updateLayout()
302         *before* doing the renderer check.
303
304         * inspector/InspectorCSSAgent.cpp:
305         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
306         (WebCore::InspectorCSSAgent::getInlineStylesForNode):
307         (WebCore::InspectorCSSAgent::getComputedStyleForNode):
308         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
309         (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
310         * inspector/InspectorCSSAgent.h:
311         * inspector/InspectorStyleSheet.cpp:
312         (WebCore::InspectorStyle::create):
313         (WebCore::InspectorStyle::InspectorStyle):
314         (WebCore::InspectorStyle::extractSourceData):
315         (WebCore::InspectorStyle::setText):
316         (WebCore::InspectorStyleSheet::inspectorStyleForId):
317         (WebCore::InspectorStyleSheetForInlineStyle::create):
318         (WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
319         (WebCore::InspectorStyleSheetForInlineStyle::didModifyElementAttribute):
320         (WebCore::InspectorStyleSheetForInlineStyle::setStyleText):
321         (WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady):
322         (WebCore::InspectorStyleSheetForInlineStyle::inlineStyle):
323         * inspector/InspectorStyleSheet.h:
324         * svg/SVGElement.idl:
325
326 2017-05-08  Joanmarie Diggs  <jdiggs@igalia.com>
327
328         AX: Propagate aria-readonly to grid descendants
329         https://bugs.webkit.org/show_bug.cgi?id=171189
330
331         Reviewed by Chris Fleizach.
332
333         Propagate aria-readonly to grid descendants if the property is not
334         explicitly set on the descendant.
335
336         Test: accessibility/gtk/aria-readonly-propagated.html
337               Additional test cases also added to accessibility/aria-readonly.html
338
339         * accessibility/AccessibilityARIAGridCell.cpp:
340         (WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue):
341         * accessibility/AccessibilityARIAGridCell.h:
342         * accessibility/AccessibilityObject.h:
343
344 2017-05-06  Zalan Bujtas  <zalan@apple.com>
345
346         Ensure clean tree before AX cache update.
347         https://bugs.webkit.org/show_bug.cgi?id=171546
348         <rdar://problem/31934942>
349
350         While updating an accessibility object state, we might
351         perform unintentional style updates. This style update could
352         end up destroying renderes that are still referenced by function calls 
353         on the callstack.
354         To avoid that, AXObjectCache should operate on a clean tree only. 
355
356         Reviewed by Chris Fleizach.
357
358         Test: accessibility/crash-when-render-tree-is-not-clean.html
359
360         * accessibility/AXObjectCache.cpp:
361         (WebCore::AXObjectCache::checkedStateChanged):
362         (WebCore::AXObjectCache::selectedChildrenChanged):
363         (WebCore::AXObjectCache::handleAriaExpandedChange):
364         (WebCore::AXObjectCache::handleActiveDescendantChanged):
365         (WebCore::AXObjectCache::handleAriaRoleChanged):
366         (WebCore::AXObjectCache::handleAttributeChanged):
367         (WebCore::AXObjectCache::handleAriaModalChange):
368         (WebCore::AXObjectCache::labelChanged):
369         * accessibility/AXObjectCache.h:
370         (WebCore::AXObjectCache::checkedStateChanged):
371         (WebCore::AXObjectCache::handleActiveDescendantChanged):
372         (WebCore::AXObjectCache::handleAriaExpandedChange):
373         (WebCore::AXObjectCache::handleAriaRoleChanged):
374         (WebCore::AXObjectCache::handleAriaModalChange):
375         (WebCore::AXObjectCache::handleAttributeChanged):
376         (WebCore::AXObjectCache::selectedChildrenChanged):
377         * accessibility/AccessibilityRenderObject.cpp:
378         (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
379         * dom/Element.cpp:
380         (WebCore::Element::attributeChanged):
381         * html/HTMLInputElement.cpp:
382         (WebCore::HTMLInputElement::setChecked):
383
384 2017-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
385
386         Unprefix unicode-bidi CSS values
387         https://bugs.webkit.org/show_bug.cgi?id=171761
388
389         Reviewed by Simon Fraser.
390
391         Create new values which parse to the same internal state as the
392         prefixed values.
393
394         Tests: fast/text/bidi-unprefix.html
395                imported/w3c/i18n/bidi/bidi-embed-001.html
396                imported/w3c/i18n/bidi/bidi-embed-002.html
397                imported/w3c/i18n/bidi/bidi-embed-003.html
398                imported/w3c/i18n/bidi/bidi-embed-004.html
399                imported/w3c/i18n/bidi/bidi-embed-005.html
400                imported/w3c/i18n/bidi/bidi-embed-006.html
401                imported/w3c/i18n/bidi/bidi-embed-007.html
402                imported/w3c/i18n/bidi/bidi-embed-008.html
403                imported/w3c/i18n/bidi/bidi-embed-009.html
404                imported/w3c/i18n/bidi/bidi-embed-010.html
405                imported/w3c/i18n/bidi/bidi-embed-011.html
406                imported/w3c/i18n/bidi/bidi-isolate-001.html
407                imported/w3c/i18n/bidi/bidi-isolate-002.html
408                imported/w3c/i18n/bidi/bidi-isolate-003.html
409                imported/w3c/i18n/bidi/bidi-isolate-004.html
410                imported/w3c/i18n/bidi/bidi-isolate-005.html
411                imported/w3c/i18n/bidi/bidi-isolate-006.html
412                imported/w3c/i18n/bidi/bidi-isolate-007.html
413                imported/w3c/i18n/bidi/bidi-isolate-008.html
414                imported/w3c/i18n/bidi/bidi-isolate-009.html
415                imported/w3c/i18n/bidi/bidi-isolate-010.html
416                imported/w3c/i18n/bidi/bidi-isolate-011.html
417                imported/w3c/i18n/bidi/bidi-isolate-override-001.html
418                imported/w3c/i18n/bidi/bidi-isolate-override-002.html
419                imported/w3c/i18n/bidi/bidi-isolate-override-003.html
420                imported/w3c/i18n/bidi/bidi-isolate-override-004.html
421                imported/w3c/i18n/bidi/bidi-isolate-override-005.html
422                imported/w3c/i18n/bidi/bidi-isolate-override-006.html
423                imported/w3c/i18n/bidi/bidi-isolate-override-007.html
424                imported/w3c/i18n/bidi/bidi-isolate-override-008.html
425                imported/w3c/i18n/bidi/bidi-isolate-override-009.html
426                imported/w3c/i18n/bidi/bidi-isolate-override-010.html
427                imported/w3c/i18n/bidi/bidi-isolate-override-011.html
428                imported/w3c/i18n/bidi/bidi-isolate-override-012.html
429                imported/w3c/i18n/bidi/bidi-normal-001.html
430                imported/w3c/i18n/bidi/bidi-normal-002.html
431                imported/w3c/i18n/bidi/bidi-normal-003.html
432                imported/w3c/i18n/bidi/bidi-normal-004.html
433                imported/w3c/i18n/bidi/bidi-normal-005.html
434                imported/w3c/i18n/bidi/bidi-normal-006.html
435                imported/w3c/i18n/bidi/bidi-normal-007.html
436                imported/w3c/i18n/bidi/bidi-normal-008.html
437                imported/w3c/i18n/bidi/bidi-normal-009.html
438                imported/w3c/i18n/bidi/bidi-normal-010.html
439                imported/w3c/i18n/bidi/bidi-normal-011.html
440                imported/w3c/i18n/bidi/bidi-override-001.html
441                imported/w3c/i18n/bidi/bidi-override-002.html
442                imported/w3c/i18n/bidi/bidi-override-003.html
443                imported/w3c/i18n/bidi/bidi-override-004.html
444                imported/w3c/i18n/bidi/bidi-override-005.html
445                imported/w3c/i18n/bidi/bidi-override-006.html
446                imported/w3c/i18n/bidi/bidi-override-007.html
447                imported/w3c/i18n/bidi/bidi-override-008.html
448                imported/w3c/i18n/bidi/bidi-override-009.html
449                imported/w3c/i18n/bidi/bidi-override-010.html
450                imported/w3c/i18n/bidi/bidi-override-011.html
451                imported/w3c/i18n/bidi/bidi-override-012.html
452                imported/w3c/i18n/bidi/bidi-plaintext-001.html
453                imported/w3c/i18n/bidi/bidi-plaintext-003.html
454                imported/w3c/i18n/bidi/bidi-plaintext-005.html
455                imported/w3c/i18n/bidi/bidi-plaintext-006.html
456                imported/w3c/i18n/bidi/bidi-plaintext-007.html
457                imported/w3c/i18n/bidi/bidi-plaintext-008.html
458                imported/w3c/i18n/bidi/bidi-plaintext-009.html
459                imported/w3c/i18n/bidi/bidi-plaintext-010.html
460                imported/w3c/i18n/bidi/bidi-plaintext-011.html
461                imported/w3c/i18n/bidi/bidi-table-001.html
462                imported/w3c/i18n/bidi/bidi-unset-001.html
463                imported/w3c/i18n/bidi/bidi-unset-002.html
464                imported/w3c/i18n/bidi/bidi-unset-003.html
465                imported/w3c/i18n/bidi/bidi-unset-004.html
466                imported/w3c/i18n/bidi/bidi-unset-005.html
467                imported/w3c/i18n/bidi/bidi-unset-006.html
468                imported/w3c/i18n/bidi/bidi-unset-007.html
469                imported/w3c/i18n/bidi/bidi-unset-008.html
470                imported/w3c/i18n/bidi/bidi-unset-009.html
471                imported/w3c/i18n/bidi/bidi-unset-010.html
472                imported/w3c/i18n/bidi/block-embed-001.html
473                imported/w3c/i18n/bidi/block-embed-002.html
474                imported/w3c/i18n/bidi/block-embed-003.html
475                imported/w3c/i18n/bidi/block-override-001.html
476                imported/w3c/i18n/bidi/block-override-002.html
477                imported/w3c/i18n/bidi/block-override-003.html
478                imported/w3c/i18n/bidi/block-override-004.html
479                imported/w3c/i18n/bidi/block-override-isolate-001.html
480                imported/w3c/i18n/bidi/block-override-isolate-002.html
481                imported/w3c/i18n/bidi/block-override-isolate-003.html
482                imported/w3c/i18n/bidi/block-override-isolate-004.html
483                imported/w3c/i18n/bidi/block-plaintext-001.html
484                imported/w3c/i18n/bidi/block-plaintext-002.html
485                imported/w3c/i18n/bidi/block-plaintext-003.html
486                imported/w3c/i18n/bidi/block-plaintext-004.html
487                imported/w3c/i18n/bidi/block-plaintext-005.html
488                imported/w3c/i18n/bidi/block-plaintext-006.html
489
490         * css/CSSPrimitiveValueMappings.h:
491         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
492         (WebCore::CSSPrimitiveValue::operator EUnicodeBidi):
493         * css/CSSProperties.json:
494         * css/CSSValueKeywords.in:
495         * css/html.css:
496         (bdi, output):
497         * css/parser/CSSParserFastPaths.cpp:
498         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
499         * html/HTMLElement.cpp:
500         (WebCore::unicodeBidiAttributeForDirAuto):
501         * html/track/TextTrackCueGeneric.cpp:
502         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
503         * html/track/VTTCue.cpp:
504         (WebCore::VTTCueBox::applyCSSProperties):
505
506 2017-05-07  Ben Kelly  <ben@wanderview.com>
507
508         Set the Response.blob() type based on the content-type header value.
509         https://bugs.webkit.org/show_bug.cgi?id=170849
510
511         Reviewed by Youenn Fablet.
512
513         There are two problems to fix here:
514
515         1.  Currently the FetchResponse class only called updateContentType()
516         when first created even though all the headers were not available.  This
517         patch calls updateContentType() again after the headers are populated.
518
519         2.  The fetch design requires propagating the normalized blob
520         type to FetchBodyConsumer as well.  Currently this is only done if
521         Response.blob() is called after the body is completely loaded.  If
522         we hit the consumeOnceLoadingFinished() path, then the type is not
523         passed.  This is similar to what was happening in bug 171489 with
524         ReadableStream bodies.  This patch sets the type on the
525         FetchBodyConsumer in consumeOnceLoadingFinished() as well.
526
527         Theses changes allow WebKit to pass the "Consume response's body: from
528         fetch to blob" case in the WPT response-consume.html test.
529
530         Test: http://w3c-test.org/fetch/api/response/response-consume.html
531
532         * Modules/fetch/FetchResponse.cpp:
533         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to
534         call FetchBodyOwner::updateContentType() after filling m_headers.
535         (WebCore::FetchBody::consumeOnceLoadingFinished): Call
536         FetchBodyConsumer::setContentType() when being consumed as
537         a blob.
538         * Modules/fetch/FetchBody.h: Modify consumeOnceLoadingFinished()
539         to take the content type string.
540         * Modules/fetch/FetchBodyOwner.cpp:
541         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished): Pass
542         the content type string down to FetchBody so it can be
543         propagated to the FetchBodyConsumer.
544
545 2017-05-07  Simon Fraser  <simon.fraser@apple.com>
546
547         [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange
548         https://bugs.webkit.org/show_bug.cgi?id=171140
549
550         Reviewed by Sam Weinig.
551
552         WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have
553         an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and
554         resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport
555         from the UI process, but in this case we need to compute one in the web process. So factor code
556         into FrameView to do the computation, called from both places.
557
558         Tests: fast/events/ios/rotation/layout-viewport-during-rotation.html
559                fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html
560
561         * page/FrameView.cpp:
562         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
563         * page/FrameView.h:
564
565 2017-05-07  Chris Dumez  <cdumez@apple.com>
566
567         Drop remaining uses of PassRefPtr in editing code
568         https://bugs.webkit.org/show_bug.cgi?id=171787
569
570         Reviewed by Darin Adler.
571
572         Drop remaining uses of PassRefPtr in editing code.
573
574         * editing/AlternativeTextController.cpp:
575         (WebCore::AlternativeTextController::timerFired):
576         * editing/ApplyStyleCommand.cpp:
577         (WebCore::toIdentifier):
578         * editing/CompositeEditCommand.cpp:
579         (WebCore::CompositeEditCommand::didApplyCommand):
580         (WebCore::CompositeEditCommand::moveParagraphs):
581         * editing/CompositeEditCommand.h:
582         * editing/Editor.cpp:
583         (WebCore::Editor::shouldInsertFragment):
584         (WebCore::Editor::replaceSelectionWithFragment):
585         (WebCore::Editor::appliedEditing):
586         (WebCore::Editor::performCutOrCopy):
587         (WebCore::Editor::willWriteSelectionToPasteboard):
588         (WebCore::Editor::advanceToNextMisspelling):
589         (WebCore::Editor::isSelectionUngrammatical):
590         (WebCore::Editor::guessesForMisspelledOrUngrammatical):
591         (WebCore::Editor::markMisspellingsOrBadGrammar):
592         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
593         (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
594         (WebCore::Editor::markAndReplaceFor):
595         (WebCore::Editor::changeBackToReplacedString):
596         * editing/Editor.h:
597         * editing/EditorCommand.cpp:
598         (WebCore::executeInsertFragment):
599         (WebCore::Editor::command):
600         (WebCore::Editor::Command::Command):
601         * editing/FormatBlockCommand.cpp:
602         (WebCore::FormatBlockCommand::formatRange):
603         * editing/IndentOutdentCommand.cpp:
604         (WebCore::IndentOutdentCommand::indentIntoBlockquote):
605         (WebCore::IndentOutdentCommand::outdentParagraph):
606         * editing/InsertListCommand.cpp:
607         (WebCore::InsertListCommand::fixOrphanedListChild):
608         (WebCore::InsertListCommand::mergeWithNeighboringLists):
609         (WebCore::InsertListCommand::doApplyForSingleParagraph):
610         (WebCore::InsertListCommand::unlistifyParagraph):
611         (WebCore::InsertListCommand::listifyParagraph):
612         * editing/InsertListCommand.h:
613         * editing/InsertParagraphSeparatorCommand.cpp:
614         (WebCore::InsertParagraphSeparatorCommand::doApply):
615         * editing/InsertTextCommand.cpp:
616         (WebCore::InsertTextCommand::InsertTextCommand):
617         * editing/InsertTextCommand.h:
618         (WebCore::InsertTextCommand::createWithMarkerSupplier):
619         * editing/MoveSelectionCommand.cpp:
620         (WebCore::MoveSelectionCommand::MoveSelectionCommand):
621         * editing/MoveSelectionCommand.h:
622         (WebCore::MoveSelectionCommand::create):
623         * editing/ReplaceSelectionCommand.cpp:
624         (WebCore::ReplacementFragment::removeNodePreservingChildren):
625         (WebCore::ReplacementFragment::removeNode):
626         (WebCore::ReplacementFragment::insertNodeBefore):
627         (WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment):
628         (WebCore::ReplacementFragment::removeUnrenderedNodes):
629         (WebCore::ReplacementFragment::removeInterchangeNodes):
630         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
631         (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
632         (WebCore::removeHeadContents):
633         (WebCore::ReplaceSelectionCommand::doApply):
634         (WebCore::ReplaceSelectionCommand::insertAsListItems):
635         * editing/ReplaceSelectionCommand.h:
636         * editing/SpellChecker.cpp:
637         (WebCore::SpellCheckRequest::SpellCheckRequest):
638         (WebCore::SpellCheckRequest::create):
639         (WebCore::SpellChecker::canCheckAsynchronously):
640         (WebCore::SpellChecker::isCheckable):
641         (WebCore::SpellChecker::requestCheckingFor):
642         (WebCore::SpellChecker::invokeRequest):
643         (WebCore::SpellChecker::enqueueRequest):
644         (WebCore::SpellChecker::didCheck):
645         * editing/SpellChecker.h:
646         (WebCore::SpellCheckRequest::checkingRange):
647         (WebCore::SpellCheckRequest::paragraphRange):
648         * editing/TextCheckingHelper.cpp:
649         (WebCore::expandToParagraphBoundary):
650         (WebCore::TextCheckingParagraph::TextCheckingParagraph):
651         (WebCore::TextCheckingParagraph::expandRangeToNextEnd):
652         (WebCore::TextCheckingParagraph::rangeLength):
653         (WebCore::TextCheckingParagraph::paragraphRange):
654         (WebCore::TextCheckingParagraph::subrange):
655         (WebCore::TextCheckingParagraph::offsetTo):
656         (WebCore::TextCheckingParagraph::offsetAsRange):
657         (WebCore::TextCheckingParagraph::text):
658         (WebCore::TextCheckingParagraph::checkingStart):
659         (WebCore::TextCheckingParagraph::checkingEnd):
660         (WebCore::TextCheckingParagraph::checkingLength):
661         (WebCore::TextCheckingHelper::TextCheckingHelper):
662         (WebCore::TextCheckingHelper::findFirstMisspelling):
663         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
664         (WebCore::TextCheckingHelper::findFirstGrammarDetail):
665         (WebCore::TextCheckingHelper::findFirstBadGrammar):
666         (WebCore::TextCheckingHelper::isUngrammatical):
667         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
668         (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled):
669         * editing/TextCheckingHelper.h:
670         * editing/TypingCommand.cpp:
671         (WebCore::TypingCommand::typingAddedToOpenCommand):
672         * editing/cocoa/EditorCocoa.mm:
673         (WebCore::Editor::replaceSelectionWithAttributedString):
674         * editing/gtk/EditorGtk.cpp:
675         (WebCore::Editor::pasteWithPasteboard):
676         * editing/ios/EditorIOS.mm:
677         (WebCore::Editor::pasteWithPasteboard):
678         * editing/mac/EditorMac.mm:
679         (WebCore::Editor::pasteWithPasteboard):
680         (WebCore::Editor::replaceNodeFromPasteboard):
681         * editing/win/EditorWin.cpp:
682         (WebCore::Editor::pasteWithPasteboard):
683         (WebCore::createFragmentFromPlatformData):
684         * page/DragController.cpp:
685         (WebCore::DragController::concludeEditDrag):
686         (WebCore::DragController::startDrag):
687
688 2017-05-07  Youenn Fablet  <youenn@apple.com>
689
690         [MediaStream] r216197 caused some webrtc tests to fail
691         https://bugs.webkit.org/show_bug.cgi?id=171728
692
693         Reviewed by Eric Carlson.
694
695         Covered by existing tests.
696
697         Rename MediaStream::endStream to MediaStream::endCaptureTracks and only stopping capture tracks.
698         Using it when Document is asked to stop media capture.
699
700         Adding the ability to have only one active capture source at a time in a WebProcess.
701         This is done by keeping in its related factory the active capture source.
702         When a new source is created and started, it replaces the active capture source which becomes muted.
703         Using that mechanism for iOS.
704
705         * Modules/mediastream/MediaStream.cpp:
706         (WebCore::MediaStream::endCaptureTracks):
707         (WebCore::MediaStream::endStream): Deleted.
708         * Modules/mediastream/MediaStream.h:
709         * Modules/mediastream/MediaStreamTrack.h:
710         (WebCore::MediaStreamTrack::isCaptureTrack):
711         * dom/Document.cpp:
712         (WebCore::Document::stopMediaCapture):
713         * platform/mediastream/mac/AVAudioCaptureSource.mm:
714         (WebCore::AVAudioCaptureSourceFactory::setActiveSource):
715         (WebCore::AVAudioCaptureSource::setupCaptureSession):
716         * platform/mediastream/mac/AVVideoCaptureSource.mm:
717         (WebCore::AVVideoCaptureSourceFactory::setActiveSource):
718         (WebCore::AVVideoCaptureSource::setupCaptureSession):
719         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
720         (WebCore::CoreAudioCaptureSourceFactory::setActiveSource):
721         (WebCore::CoreAudioSharedUnit::startProducingData):
722
723 2017-05-07  Tim Horton  <timothy_horton@apple.com>
724
725         Clean up some WebProcessProxy, WebPage, and message handler includes
726         https://bugs.webkit.org/show_bug.cgi?id=171791
727
728         Reviewed by Sam Weinig.
729
730         * WebCore.xcodeproj/project.pbxproj:
731         * editing/CompositionUnderline.h: Added.
732         (WebCore::CompositionUnderline::CompositionUnderline):
733         * editing/Editor.h:
734         (WebCore::CompositionUnderline::CompositionUnderline): Deleted.
735         Move CompositionUnderline out of Editor.h, so that other files can
736         include that without Editor.h (which is quite large). Also, modernize it slightly.
737
738 2017-05-07  Sam Weinig  <sam@webkit.org>
739
740         Implement Subresource Integrity (SRI)
741         https://bugs.webkit.org/show_bug.cgi?id=148363
742         <rdar://problem/18945879>
743
744         Reviewed by Daniel Bates.
745
746         Tests: http/tests/subresource-integrity/sri-disabled-with-setting.html
747                http/tests/subresource-integrity/sri-enabled-with-setting.html
748                http/tests/subresource-integrity/sri-script-cors.html
749                http/tests/subresource-integrity/sri-style-cors.html
750
751         * CMakeLists.txt:
752         * WebCore.xcodeproj/project.pbxproj:
753         Add new files.
754
755         * dom/LoadableClassicScript.cpp:
756         (WebCore::LoadableClassicScript::create):
757         (WebCore::LoadableClassicScript::notifyFinished):
758         * dom/LoadableClassicScript.h:
759         * dom/LoadableScript.h:
760         * dom/ScriptElement.cpp:
761         (WebCore::ScriptElement::requestClassicScript):
762         Store integrity metadata in the script fetcher so it can be passed to
763         the checked when script load finishes.
764
765         * html/HTMLAttributeNames.in:
766         Add 'integrity'.
767
768         * html/HTMLLinkElement.cpp:
769         (WebCore::HTMLLinkElement::process):
770         When requesting a stylesheet, cache the integrity metadata so it can
771         be used when the load completes (accessing the attribute at load completion
772         time is incorrect, as a script might have changed the attributes value since
773         the request was made).
774
775         (WebCore::HTMLLinkElement::setCSSStyleSheet):
776         Add an integrity check using the cached integrity metadata when a load
777         finishes.
778
779         * html/HTMLLinkElement.h:
780         Add cached integrity metadata member.
781
782         * html/HTMLLinkElement.idl:
783         * html/HTMLScriptElement.idl:
784         Add integrity property.
785
786         * html/parser/HTMLParserIdioms.h:
787         (WebCore::isNotHTMLSpace):
788         Templatize isNotHTMLSpace so it can work for both UChar and LChar.
789
790         * loader/ResourceCryptographicDigest.cpp:
791         (WebCore::parseCryptographicDigestImpl):
792         (WebCore::parseEncodedCryptographicDigestImpl):
793         (WebCore::parseEncodedCryptographicDigest):
794         (WebCore::decodeEncodedResourceCryptographicDigest):
795         * loader/ResourceCryptographicDigest.h:
796         Add concept of an encoded digest to more closely model the spec so that hashes
797         that match the grammar but are invalid (say, mixing base64 and base64URL) make
798         it through the algorithm longer, and don't cause us to load something that should
799         be blocked.
800
801         * loader/SubresourceIntegrity.cpp: Added.
802         * loader/SubresourceIntegrity.h: Added.
803         Add implementation of Subresource Integrity metadata validation allowing
804         for a CachedResource and integrity metadata to be passed for validation.
805
806         * page/Settings.in:
807         Add setting for Subresource Integrity, defaulted to enabled.
808
809 2017-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
810
811         [GTK] Cannot sign in with new Google sign-in page
812         https://bugs.webkit.org/show_bug.cgi?id=171770
813
814         Reviewed by Carlos Garcia Campos.
815
816         Google's new authentication page does not work with the Firefox user
817         agent that's required to make various Google websites work. Special-case
818         accounts.google.com so that it receives our standard user agent.
819
820         * platform/UserAgentQuirks.cpp:
821         (WebCore::isGoogle):
822         (WebCore::urlRequiresFirefoxBrowser):
823
824 2017-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
825
826         [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
827         https://bugs.webkit.org/show_bug.cgi?id=171636
828         <rdar://problem/30811218>
829
830         Reviewed by Dean Jackson.
831
832         LastResort is the only name which needs to be looked up case-sensitively. We can handle
833         this in our existing function which handles special font names (like -apple-system) to
834         make sure that we always do the right thing.
835
836         Test: fast/text/lastResort.html
837
838         * platform/graphics/ios/FontCacheIOS.mm:
839         (WebCore::platformFontWithFamilySpecialCase):
840         * platform/graphics/mac/FontCacheMac.mm:
841         (WebCore::platformFontWithFamilySpecialCase):
842         * platform/spi/cocoa/CoreTextSPI.h:
843
844 2017-05-06  Chris Dumez  <cdumez@apple.com>
845
846         Implement the concept of cookie-averse document
847         https://bugs.webkit.org/show_bug.cgi?id=171746
848         <rdar://problem/32004466>
849
850         Reviewed by Sam Weinig.
851
852         Implement the concept of cookie-averse document:
853         - https://html.spec.whatwg.org/#cookie-averse-document-object
854
855         Test: fast/cookies/cookie-averse-document.html
856
857         * dom/Document.cpp:
858         (WebCore::Document::isCookieAverse):
859         (WebCore::Document::cookie):
860         (WebCore::Document::setCookie):
861         * dom/Document.h:
862
863 2017-05-06  Chris Dumez  <cdumez@apple.com>
864
865         Unreviewed build fix after r216339.
866
867         * dom/Document.h:
868         (WebCore::Document::readyState):
869
870 2017-05-06  Chris Dumez  <cdumez@apple.com>
871
872         Align our IDL files with the latest DOM specification
873         https://bugs.webkit.org/show_bug.cgi?id=171777
874
875         Reviewed by Sam Weinig.
876
877         Align our IDL files with the latest DOM specification:
878         - https://dom.spec.whatwg.org
879
880         No Web-facing behavior change. Things that do not match the specification
881         have been annotated with FIXME comments.
882
883         * dom/CharacterData.idl:
884         * dom/Comment.idl:
885         * dom/CustomEvent.idl:
886         * dom/DOMImplementation.idl:
887         * dom/Document.cpp:
888         * dom/Document.h:
889         (WebCore::Document::readyState):
890         * dom/Document.idl:
891         * dom/MutationObserver.idl:
892         * dom/NamedNodeMap.idl:
893         * dom/NodeFilter.idl:
894         * dom/NodeIterator.idl:
895         * dom/NodeList.idl:
896         * dom/NonDocumentTypeChildNode.idl:
897         * dom/ParentNode.idl:
898         * dom/ProcessingInstruction.idl:
899         * dom/Range.idl:
900         * dom/ShadowRoot.idl:
901         * dom/Text.idl:
902         * dom/TreeWalker.idl:
903         * html/DOMTokenList.idl:
904
905 2017-05-06  Tim Horton  <timothy_horton@apple.com>
906
907         Reduce the number of includes in WebPage.h and WebProcess.h
908         https://bugs.webkit.org/show_bug.cgi?id=171779
909
910         Reviewed by Sam Weinig.
911
912         * page/TextIndicator.h:
913
914 2017-05-06  Alexey Proskuryakov  <ap@apple.com>
915
916         REGRESSION (r216294): The new test fails on WebKit1
917         https://bugs.webkit.org/show_bug.cgi?id=171780
918
919         Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
920         https://trac.webkit.org/216299, https://trac.webkit.org/216330
921
922         * page/FrameView.cpp:
923         (WebCore::FrameView::paintContents):
924         * page/FrameView.h:
925         * platform/ScrollView.cpp:
926         (WebCore::ScrollView::paint):
927         * platform/ScrollView.h:
928         * platform/Scrollbar.cpp:
929         (WebCore::Scrollbar::paint):
930         * platform/Scrollbar.h:
931         * platform/Widget.h:
932         * platform/graphics/filters/FilterOperation.h:
933         (WebCore::FilterOperation::movesPixels):
934         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): Deleted.
935         * platform/graphics/filters/FilterOperations.cpp:
936         (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): Deleted.
937         * platform/graphics/filters/FilterOperations.h:
938         * platform/gtk/WidgetGtk.cpp:
939         (WebCore::Widget::paint):
940         * platform/ios/WidgetIOS.mm:
941         (WebCore::Widget::paint):
942         * platform/mac/WidgetMac.mm:
943         (WebCore::Widget::paint):
944         * platform/win/WidgetWin.cpp:
945         (WebCore::Widget::paint):
946         * rendering/FilterEffectRenderer.cpp:
947         (WebCore::FilterEffectRenderer::build):
948         * rendering/FilterEffectRenderer.h:
949         * rendering/PaintInfo.h:
950         (WebCore::PaintInfo::PaintInfo):
951         (): Deleted.
952         * rendering/RenderLayer.cpp:
953         (WebCore::RenderLayer::paint):
954         (WebCore::RenderLayer::setupFilters):
955         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
956         * rendering/RenderLayer.h:
957         * rendering/RenderScrollbar.cpp:
958         (WebCore::RenderScrollbar::paint):
959         * rendering/RenderScrollbar.h:
960         * rendering/RenderWidget.cpp:
961         (WebCore::RenderWidget::paintContents):
962
963 2017-05-06  Chris Dumez  <cdumez@apple.com>
964
965         Unreviewed, rolling out r216333.
966
967         Caused layout test failures
968
969         Reverted changeset:
970
971         "Implement the concept of cookie-averse document"
972         https://bugs.webkit.org/show_bug.cgi?id=171746
973         http://trac.webkit.org/changeset/216333
974
975 2017-05-06  Chris Dumez  <cdumez@apple.com>
976
977         Implement the concept of cookie-averse document
978         https://bugs.webkit.org/show_bug.cgi?id=171746
979         <rdar://problem/32004466>
980
981         Reviewed by Sam Weinig.
982
983         Implement the concept of cookie-averse document:
984         - https://html.spec.whatwg.org/#cookie-averse-document-object
985
986         Test: fast/cookies/cookie-averse-document.html
987
988         * dom/Document.cpp:
989         (WebCore::Document::isCookieAverse):
990         (WebCore::Document::cookie):
991         (WebCore::Document::setCookie):
992         * dom/Document.h:
993
994 2017-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
995
996         REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
997         https://bugs.webkit.org/show_bug.cgi?id=171750
998         <rdar://problem/31122612>
999
1000         Reviewed by Zalan Bujtas.
1001
1002         Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through
1003         the string to determine which code path to use, we ask if a particular codepoint is an emoji
1004         group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers,
1005         which means the next "if" statement would never be hit. Instead, we should check that "if"
1006         statement first (because order is not important here). The next checks do not intersect with
1007         any emoji group candidates.
1008
1009         Test: fast/text/fitzpatrick-combination.html
1010
1011         * platform/graphics/FontCascade.cpp:
1012         (WebCore::FontCascade::characterRangeCodePath):
1013
1014 2017-05-06  Youenn Fablet  <youenn@apple.com>
1015
1016         RealtimeMediaSourceCenter callbacks should be passed as r-values
1017         https://bugs.webkit.org/show_bug.cgi?id=171407
1018
1019         Reviewed by Eric Carlson.
1020
1021         No change of behavior, this is mostly style here.
1022
1023         * platform/mediastream/RealtimeMediaSourceCenter.h:
1024         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1025         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
1026         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
1027         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
1028         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
1029         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
1030         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
1031         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1032         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
1033         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
1034         * platform/mock/MockRealtimeMediaSourceCenter.h:
1035
1036 2017-05-05  Zalan Bujtas  <zalan@apple.com>
1037
1038         Renderers being destroyed should not be added to AX's deferred list.
1039         https://bugs.webkit.org/show_bug.cgi?id=171768
1040         <rdar://problem/31955660>
1041
1042         Reviewed by Simon Fraser.
1043
1044         In certain cases, when custom scrollbars are present, while destroying the scrollbars' block parent, we
1045           - first remove the block from the AX's deferred list (AXObjectCache::remove)
1046           - destroy the render layer that owns the custom scrollbars (RenderLayer::destroyLayer) 
1047           - detach the scrollbars from the parent (block) (RenderObject::removeFromParent)
1048             - clean up the block's lines (RenderBlock::deleteLines)
1049               - push the block back to the AX's deferred list (AXObjectCache::recomputeDeferredIsIgnored)
1050         At this point no one will remove the current block from AX's deferred list.
1051
1052         Test: accessibility/crash-when-renderers-are-added-back-to-deferred-list.html
1053
1054         * accessibility/AXObjectCache.cpp:
1055         (WebCore::AXObjectCache::recomputeDeferredIsIgnored):
1056         (WebCore::AXObjectCache::deferTextChanged):
1057
1058 2017-05-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1059
1060         Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation
1061         https://bugs.webkit.org/show_bug.cgi?id=171736
1062
1063         Reviewed by Tim Horton.
1064
1065         Tests: Covered by run-webkit-tests fast/images/image-formats-support.html
1066         --guard-malloc.
1067
1068         Because an image format is not supported, the ImageObserver of the Image
1069         is deleted then the Image itself is deleted. In BitmapImage destructor,
1070         we make a call which ends up accessing the deleted ImageObserver.
1071
1072         To fix this, we need to change the BitImage destructor to avoid calling 
1073         ImageFrameCache::decodedSizeChanged() since it is not really needed.
1074
1075         * platform/graphics/BitmapImage.cpp:
1076         (WebCore::BitmapImage::~BitmapImage):
1077
1078 2017-05-05  Timothy Horton  <timothy_horton@apple.com>
1079
1080         [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging)
1081         https://bugs.webkit.org/show_bug.cgi?id=171764
1082         <rdar://problem/32005865>
1083
1084         Reviewed by Simon Fraser.
1085
1086         * page/DragController.cpp:
1087         (WebCore::DragController::startDrag):
1088         Compute dragImageAnchorPoint only if it is needed.
1089         Don't compute a random unused imageRect.
1090         Factor link drag image offset computation out into DragImage functions
1091         for platforms to override.
1092
1093         Pass dragOrigin (the mouseDown point), not mouseDraggedPoint, to
1094         doSystemDrag, just like all the other drag types. This plus the
1095         WebKit2 change makes the link stable vs. the cursor, instead of
1096         positioned based on how fast you move after the mouse down.
1097
1098         * page/DragController.h:
1099         * page/gtk/DragControllerGtk.cpp:
1100         * page/mac/DragControllerMac.mm:
1101         * page/win/DragControllerWin.cpp:
1102         Move LinkDragBorderInset into DragImage, and share between the non-Mac platforms.
1103
1104         * platform/DragImage.cpp:
1105         (WebCore::dragOffsetForLinkDragImage):
1106         (WebCore::anchorPointForLinkDragImage):
1107         * platform/DragImage.h:
1108         As previously mentioned, move the computation of drag image offset here.
1109
1110         * platform/mac/DragImageMac.mm:
1111         (WebCore::dragOffsetForLinkDragImage):
1112         (WebCore::anchorPointForLinkDragImage):
1113         Put the new drag image to the bottom right of the cursor.
1114
1115 2017-05-05  Dean Jackson  <dino@apple.com>
1116
1117         ...and now the GTK and Windows builds.
1118
1119         * platform/gtk/WidgetGtk.cpp:
1120         (WebCore::Widget::paint):
1121         * platform/win/WidgetWin.cpp:
1122         (WebCore::Widget::paint):
1123
1124 2017-05-05  Brady Eidson  <beidson@apple.com>
1125
1126         API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator.
1127         <rdar://problem/31977294> and https://bugs.webkit.org/show_bug.cgi?id=171513
1128
1129         Reviewed by Andy Estes.
1130
1131         Covered by API test.
1132
1133         * platform/spi/cf/CFNetworkSPI.h:
1134
1135 2017-05-05  Dean Jackson  <dino@apple.com>
1136
1137         Try to fix iOS build.
1138
1139         * platform/ios/WidgetIOS.mm:
1140         (WebCore::Widget::paint):
1141
1142 2017-05-05  Dean Jackson  <dino@apple.com>
1143
1144         Restrict SVG filters to accessible security origins
1145         https://bugs.webkit.org/show_bug.cgi?id=118689
1146         <rdar://problem/27362159>
1147
1148         Reviewed by Brent Fulgham.
1149
1150         Certain SVG filters should only be allowed to operate
1151         on content that is has SecurityOrigin access to. Implement
1152         this by including a flag in PaintInfo and LayerPaintingInfo,
1153         and have RenderWidget make sure the documents have acceptable
1154         SecurityOrigins as it goes to paint.
1155
1156         This could be used as the first step in a "safe painting"
1157         strategy, allowing some content to be rendered into a 
1158         canvas or via the element() CSS function... but it is only
1159         a small first step.
1160
1161         Test: http/tests/css/filters-on-iframes.html
1162
1163         * page/FrameView.cpp:
1164         (WebCore::FrameView::paintContents):
1165         * page/FrameView.h:
1166         * platform/ScrollView.cpp:
1167         (WebCore::ScrollView::paint):
1168         * platform/ScrollView.h:
1169         * platform/Scrollbar.cpp:
1170         (WebCore::Scrollbar::paint):
1171         * platform/Scrollbar.h:
1172         * platform/Widget.h:
1173         * platform/graphics/filters/FilterOperation.h:
1174         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin):
1175         * platform/graphics/filters/FilterOperations.cpp:
1176         (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin):
1177         * platform/graphics/filters/FilterOperations.h:
1178         * platform/mac/WidgetMac.mm:
1179         (WebCore::Widget::paint):
1180         * rendering/FilterEffectRenderer.cpp:
1181         (WebCore::FilterEffectRenderer::build):
1182         * rendering/FilterEffectRenderer.h:
1183         * rendering/PaintInfo.h:
1184         (WebCore::PaintInfo::PaintInfo):
1185         * rendering/RenderLayer.cpp:
1186         (WebCore::RenderLayer::paint):
1187         (WebCore::RenderLayer::setupFilters):
1188         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1189         * rendering/RenderLayer.h:
1190         * rendering/RenderScrollbar.cpp:
1191         (WebCore::RenderScrollbar::paint):
1192         * rendering/RenderScrollbar.h:
1193         * rendering/RenderWidget.cpp:
1194         (WebCore::RenderWidget::paintContents):
1195
1196 2017-05-05  Ryan Haddad  <ryanhaddad@apple.com>
1197
1198         Unreviewed, rolling out r216273.
1199
1200         This change caused an assertion failure on WK1.
1201
1202         Reverted changeset:
1203
1204         "Crash in ImageFrameCache::decodedSizeChanged() after image
1205         load cancellation"
1206         https://bugs.webkit.org/show_bug.cgi?id=171736
1207         http://trac.webkit.org/changeset/216273
1208
1209 2017-05-05  Brian Burg  <bburg@apple.com>
1210
1211         [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies
1212         https://bugs.webkit.org/show_bug.cgi?id=171748
1213         <rdar://problem/32027327>
1214
1215         Reviewed by Michael Catanzaro.
1216
1217         The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
1218         also misusing the NSHTTPCookieDiscard property. If any value is provided for
1219         this key, even @NO, CFNetwork interprets that to mean that the cookie has the
1220         "session" flag.
1221
1222         This is known to affect cookies set via WebCookieManager, WKHTTPCookieStore,
1223         and WebAutomationSession.
1224
1225         This is covered by existing test WebKit2.WKHTTPCookieStore.
1226
1227         * platform/network/cocoa/CookieCocoa.mm:
1228         (WebCore::Cookie::operator NSHTTPCookie *):
1229         Don't include the property if the cookie is not a session cookie.
1230
1231 2017-05-05  Youenn Fablet  <youenn@apple.com>
1232
1233         TURNS gathering is not working properly
1234         https://bugs.webkit.org/show_bug.cgi?id=171747
1235
1236         Reviewed by Eric Carlson.
1237
1238         Did manual testing on real TURNS servers.
1239
1240         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1241         (WebCore::configurationFromMediaEndpointConfiguration): Disabling TURNS servers gathering.
1242
1243 2017-05-05  Ryan Haddad  <ryanhaddad@apple.com>
1244
1245         Unreviewed, rolling out r216275.
1246
1247         This change broke internal builds.
1248
1249         Reverted changeset:
1250
1251         "[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not
1252         case insensitive"
1253         https://bugs.webkit.org/show_bug.cgi?id=171636
1254         http://trac.webkit.org/changeset/216275
1255
1256 2017-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
1257
1258         [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
1259         https://bugs.webkit.org/show_bug.cgi?id=171636
1260         <rdar://problem/30811218>
1261
1262         Reviewed by Dean Jackson.
1263
1264         LastResort is the only name which needs to be looked up case-sensitively. We can handle
1265         this in our existing function which handles special font names (like -apple-system) to
1266         make sure that we always do the right thing.
1267
1268         Test: fast/text/lastResort.html
1269
1270         * platform/spi/cocoa/CoreTextSPI.h:
1271         * platform/graphics/ios/FontCacheIOS.mm:
1272         (WebCore::platformFontWithFamilySpecialCase):
1273         * platform/graphics/mac/FontCacheMac.mm:
1274         (WebCore::platformFontWithFamilySpecialCase):
1275
1276 2017-05-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1277
1278         Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation
1279         https://bugs.webkit.org/show_bug.cgi?id=171736
1280
1281         Reviewed by Tim Horton.
1282
1283         Tests: Covered by run-webkit-tests fast/images/image-formats-support.html
1284         --guard-malloc.
1285
1286         Because an image format is not supported, the ImageObserver of the Image
1287         is deleted then the Image itself is deleted. In BitmapImage destructor,
1288         we make a call which ends up accessing the deleted ImageObserver.
1289
1290         To fix this, we need to setImageObsever of the Image to-be-deleted to 
1291         nullptr. So the Image can avoid accessing its ImageObserver, while it is
1292         being deleted. Also we can change the BitImage destructor to avoid calling 
1293         ImageFrameCache::decodedSizeChanged() since it is not really needed.
1294
1295         * loader/cache/CachedImage.cpp:
1296         (WebCore::CachedImage::clearImage):
1297         * platform/graphics/BitmapImage.cpp:
1298         (WebCore::BitmapImage::~BitmapImage):
1299
1300 2017-05-05  Brian Burg  <bburg@apple.com>
1301
1302         CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57
1303         https://bugs.webkit.org/show_bug.cgi?id=171669
1304         <rdar://problem/31967684>
1305
1306         Reviewed by Mark Lam.
1307
1308         * bindings/js/CommonVM.h:
1309         (WebCore::commonVMOrNull):
1310         Add an inline accessor function to expose the global variable.
1311
1312 2017-05-05  Filip Pizlo  <fpizlo@apple.com>
1313
1314         GCController.cpp's collect() should be Async
1315         https://bugs.webkit.org/show_bug.cgi?id=171708
1316
1317         Reviewed by Saam Barati.
1318
1319         No new tests because no change in behavior.
1320         
1321         This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to
1322         make bisecting super easy.
1323
1324         * bindings/js/GCController.cpp:
1325         (WebCore::collect):
1326
1327 2017-05-05  Chris Dumez  <cdumez@apple.com>
1328
1329         Attr Nodes should not have children
1330         https://bugs.webkit.org/show_bug.cgi?id=171688
1331         <rdar://problem/31998412>
1332
1333         Reviewed by Andreas Kling.
1334
1335         Attr Nodes should not have children as per the latest DOM specification:
1336         - https://dom.spec.whatwg.org/#interface-attr
1337         - https://dom.spec.whatwg.org/#dom-attr-value
1338         - https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity (Step 1)
1339
1340         Firefox and Chrome both have been matching the DOM specification for a while so I think
1341         we should do the same. This aligns us with other browsers, simplifies the code, is
1342         more efficient and the code being removed has been prone to security bugs.
1343
1344         Test: fast/dom/Attr/cannot-have-children.html
1345
1346         * dom/Attr.cpp:
1347         (WebCore::Attr::Attr):
1348         (WebCore::Attr::create):
1349         (WebCore::Attr::setValue):
1350         (WebCore::Attr::cloneNodeInternal):
1351         * dom/Attr.h:
1352         - Have Attr subclass Node instead of ContainerNode as it can no longer have children.
1353         - Drop logic to dealing with children / creating a Text child.
1354
1355         * dom/CharacterData.cpp:
1356         (WebCore::CharacterData::notifyParentAfterChange):
1357         Drop useless check found by the compiler. parentNode() can no longer be an Attr node.
1358
1359         * dom/Node.cpp:
1360         (WebCore::appendTextContent):
1361         appendTextContent() is called by Node.TextContent(). For Attr Nodes, we should no longer traverse
1362         its subtree to gather Text Nodes. Instead, we now return Attr.value, as per the specification:
1363         - https://dom.spec.whatwg.org/#dom-node-textcontent
1364
1365         * dom/Range.cpp:
1366         (WebCore::lengthOfContentsInNode):
1367         As per https://dom.spec.whatwg.org/#concept-node-length, we should return the number of children
1368         for Attr Nodes, which will always be 0.
1369
1370         * xml/XPathUtil.cpp:
1371         (WebCore::XPath::isValidContextNode):
1372         Always return true for TEXT_NODE as the !(node->parentNode() && node->parentNode()->isAttributeNode())
1373         check will also with true now. This is because a parentNode() cannot be an Attribute Node.
1374
1375 2017-05-05  Brian Burg  <bburg@apple.com>
1376
1377         [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as secure
1378         https://bugs.webkit.org/show_bug.cgi?id=171700
1379         <rdar://problem/32017975>
1380
1381         Reviewed by Brady Eidson.
1382
1383         The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
1384         misusing the NSHTTPCookieSecure property. If any value is provided for this key,
1385         even @NO, CFNetwork interprets that to mean that the cookie has the "secure" flag.
1386         Thus, in some cases we would store an "insecure" cookie on a site that uses the
1387         http:// protocol, and be unable to later retrieve the cookie. This is known to
1388         affect cookies set via WebCookieManager, WKHTTPCookieStore, and WebAutomationSession.
1389
1390         This is covered by existing test WebKit2.WKHTTPCookieStore.
1391         The test had a bug that masked this problem.
1392
1393         * platform/network/cocoa/CookieCocoa.mm:
1394         (WebCore::Cookie::operator NSHTTPCookie *):
1395         Don't include the property if the cookie is not secure.
1396
1397 2017-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1398
1399         Add SPI to WebItemProviderPasteboard to synchronously load data with a given timeout
1400         https://bugs.webkit.org/show_bug.cgi?id=171725
1401         <rdar://problem/32014052>
1402
1403         Reviewed by Beth Dakin.
1404
1405         Adds a synchronousTimeout: argument to doAfterLoadingProvidedContentIntoFileURLs:. If a positive timeout
1406         interval is specified by the client, then we will block the main thread for at most that amount of time after
1407         beginning to load from the item providers.
1408
1409         To do this, we introduce another `dispatch_group_t` in parallel to the `fileLoadingGroup` that is entered and
1410         left in the same places. However, instead of attaching a handler block, we simply perform a synchronous wait for
1411         either the time limit to be reached, or the item providers to finish loading.
1412
1413         No new tests -- no change in behavior yet.
1414
1415         * platform/ios/WebItemProviderPasteboard.h:
1416         * platform/ios/WebItemProviderPasteboard.mm:
1417         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
1418         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
1419
1420 2017-05-05  Chris Dumez  <cdumez@apple.com>
1421
1422         Clean up Attr.idl
1423         https://bugs.webkit.org/show_bug.cgi?id=171691
1424
1425         Reviewed by Andreas Kling.
1426
1427         Clean up Attr.idl to match the spec:
1428         - https://dom.spec.whatwg.org/#interface-attr
1429
1430         No Web-facing behavior change except for Attr properties being enumerated
1431         in a slightly different order.
1432
1433         * dom/Attr.idl:
1434
1435 2017-05-05  Antti Koivisto  <antti@apple.com>
1436
1437         ASSERTION FAILED: !frame().document()->inRenderTreeUpdate() in WebCore::FrameView::layout(bool)
1438         https://bugs.webkit.org/show_bug.cgi?id=171717
1439
1440         Reviewed by Brent Fulgham.
1441
1442         * loader/FrameLoader.cpp:
1443         (WebCore::FrameLoader::checkCompleted):
1444
1445             Don't allow frame load to complete in the middle of a render tree update. Instead delay the check.
1446
1447 2017-05-05  Chris Dumez  <cdumez@apple.com>
1448
1449         Refactor / Clean up Element.idl
1450         https://bugs.webkit.org/show_bug.cgi?id=171734
1451
1452         Reviewed by Sam Weinig.
1453
1454         Refactor / Clean up Element.idl to match the latest specification:
1455         - https://dom.spec.whatwg.org/#interface-element
1456
1457         There is no Web-facing behavior change in this patch besides the Element properties
1458         being enumerated in a slightly different order. Things that do not match the
1459         specification have merely been annotated with FIXME comments for now. This makes
1460         it much more obvious what's standard, what's not and what needs fixing.
1461
1462         * dom/Element.idl:
1463
1464 2017-05-05  Tim Horton  <timothy_horton@apple.com>
1465
1466         Link drag images for apple.com front page links have a lot of spurious whitespace
1467         https://bugs.webkit.org/show_bug.cgi?id=171719
1468         <rdar://problem/32010854>
1469
1470         Reviewed by Wenson Hsieh.
1471
1472         * page/DragController.cpp:
1473         (WebCore::DragController::startDrag):
1474         Use the white-space-simplified string that we put on the pasteboard
1475         for the drag image, too!
1476
1477 2017-05-04  Mark Lam  <mark.lam@apple.com>
1478
1479         DRT's setAudioResultCallback() and IDBRequest::setResult() need to acquire the JSLock.
1480         https://bugs.webkit.org/show_bug.cgi?id=171716
1481         <rdar://problem/30878027>
1482
1483         Reviewed by Saam Barati.
1484
1485         No new tests.  This issue was caught by existing tests.
1486
1487         IDBRequest::setResult() needs to acquire the JSLock before calling toJS() (which
1488         does JS conversion and therefore, potentially JS allocations).
1489
1490         * Modules/indexeddb/IDBRequest.cpp:
1491         (WebCore::IDBRequest::setResult):
1492         (WebCore::IDBRequest::setResultToStructuredClone):
1493
1494 2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1495
1496         [GStreamer] Do not report more errors after the first one
1497         https://bugs.webkit.org/show_bug.cgi?id=171722
1498
1499         Reviewed by Xabier Rodriguez-Calvar.
1500
1501         We can receive several error messages for the same error from different elements. That's not expected by the
1502         media source selection algorithm implementation. I don't know if didn't happen with previous versions of GST,
1503         but since the upgrade to 1.10.4 several tests are failing because of this.
1504
1505         Fixes: media/video-error-does-not-exist.html
1506                media/video-load-networkState.html
1507                media/video-source-error.html
1508                media/video-source-none-supported.html
1509                media/video-source-moved.html
1510
1511         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1512         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Return early also when an error already occured.
1513
1514 2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1515
1516         [GStreamer] Fix handling of gst errors in MediaPlayerPrivateGStreamer::handleMessage
1517         https://bugs.webkit.org/show_bug.cgi?id=171721
1518
1519         Reviewed by Xabier Rodriguez-Calvar.
1520
1521         We are checking the GError only comparing the code, and ignoring the domain in some cases. Use g_error_matches()
1522         in those cases instead of only checking the code.
1523
1524         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1525         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1526
1527 2017-05-04  Commit Queue  <commit-queue@webkit.org>
1528
1529         Unreviewed, rolling out r216206.
1530         https://bugs.webkit.org/show_bug.cgi?id=171714
1531
1532         Multiple LayoutTests crashing in Document::page() (Requested
1533         by ap on #webkit).
1534
1535         Reverted changeset:
1536
1537         "Remove support for legacy Notifications"
1538         https://bugs.webkit.org/show_bug.cgi?id=171487
1539         http://trac.webkit.org/changeset/216206
1540
1541 2017-05-04  Chris Dumez  <cdumez@apple.com>
1542
1543         Drop remaining uses of PassRefPtr from CompositeEditCommand
1544         https://bugs.webkit.org/show_bug.cgi?id=171645
1545
1546         Reviewed by Darin Adler.
1547
1548         Drop remaining uses of PassRefPtr from CompositeEditCommand.
1549
1550         * editing/ApplyBlockElementCommand.cpp:
1551         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
1552         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
1553         * editing/ApplyStyleCommand.cpp:
1554         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
1555         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
1556         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
1557         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
1558         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
1559         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
1560         (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
1561         (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
1562         (WebCore::ApplyStyleCommand::removeCSSStyle):
1563         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
1564         (WebCore::ApplyStyleCommand::splitTextAtStart):
1565         (WebCore::ApplyStyleCommand::splitTextAtEnd):
1566         (WebCore::ApplyStyleCommand::splitTextElementAtStart):
1567         (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
1568         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
1569         (WebCore::ApplyStyleCommand::addBlockStyle):
1570         (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
1571         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
1572         (WebCore::ApplyStyleCommand::joinChildTextNodes):
1573         * editing/BreakBlockquoteCommand.cpp:
1574         (WebCore::BreakBlockquoteCommand::doApply):
1575         * editing/CompositeEditCommand.cpp:
1576         (WebCore::applyCommand):
1577         (WebCore::CompositeEditCommand::insertNodeAt):
1578         (WebCore::CompositeEditCommand::removeChildrenInRange):
1579         (WebCore::CompositeEditCommand::removeNode):
1580         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
1581         (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors):
1582         (WebCore::CompositeEditCommand::moveRemainingSiblingsToNewParent):
1583         (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes):
1584         (WebCore::CompositeEditCommand::prune):
1585         (WebCore::CompositeEditCommand::splitTextNode):
1586         (WebCore::CompositeEditCommand::splitElement):
1587         (WebCore::CompositeEditCommand::mergeIdenticalElements):
1588         (WebCore::CompositeEditCommand::splitTextNodeContainingElement):
1589         (WebCore::CompositeEditCommand::positionOutsideTabSpan):
1590         (WebCore::CompositeEditCommand::removeNodeAttribute):
1591         (WebCore::CompositeEditCommand::setNodeAttribute):
1592         (WebCore::CompositeEditCommand::deleteInsignificantText):
1593         (WebCore::CompositeEditCommand::removePlaceholderAt):
1594         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
1595         (WebCore::CompositeEditCommand::pushAnchorElementDown):
1596         (WebCore::CompositeEditCommand::cleanupAfterDeletion):
1597         (WebCore::CompositeEditCommand::moveParagraphs):
1598         * editing/CompositeEditCommand.h:
1599         * editing/DeleteSelectionCommand.cpp:
1600         (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
1601         (WebCore::DeleteSelectionCommand::removeNodeUpdatingStates):
1602         (WebCore::DeleteSelectionCommand::removeNode):
1603         (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
1604         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
1605         (WebCore::DeleteSelectionCommand::mergeParagraphs):
1606         (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
1607         (WebCore::DeleteSelectionCommand::removeRedundantBlocks):
1608         * editing/DeleteSelectionCommand.h:
1609         * editing/Editor.cpp:
1610         (WebCore::ClearTextCommand::CreateAndApply):
1611         (WebCore::Editor::replaceSelectionWithFragment):
1612         (WebCore::Editor::handleAcceptedCandidate):
1613         * editing/EditorCommand.cpp:
1614         (WebCore::executeFormatBlock):
1615         * editing/IndentOutdentCommand.cpp:
1616         (WebCore::IndentOutdentCommand::outdentParagraph):
1617         * editing/InsertLineBreakCommand.cpp:
1618         (WebCore::InsertLineBreakCommand::doApply):
1619         * editing/InsertListCommand.cpp:
1620         (WebCore::InsertListCommand::fixOrphanedListChild):
1621         (WebCore::InsertListCommand::doApplyForSingleParagraph):
1622         (WebCore::InsertListCommand::unlistifyParagraph):
1623         * editing/InsertParagraphSeparatorCommand.cpp:
1624         (WebCore::InsertParagraphSeparatorCommand::doApply):
1625         * editing/InsertTextCommand.cpp:
1626         (WebCore::InsertTextCommand::insertTab):
1627         * editing/ModifySelectionListLevel.cpp:
1628         (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeBefore):
1629         (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeAfter):
1630         (WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange):
1631         (WebCore::DecreaseSelectionListLevelCommand::doApply):
1632         * editing/RemoveNodePreservingChildrenCommand.cpp:
1633         (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
1634         (WebCore::RemoveNodePreservingChildrenCommand::doApply):
1635         * editing/RemoveNodePreservingChildrenCommand.h:
1636         (WebCore::RemoveNodePreservingChildrenCommand::create):
1637         * editing/ReplaceNodeWithSpanCommand.cpp:
1638         (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand):
1639         (WebCore::ReplaceNodeWithSpanCommand::doApply):
1640         (WebCore::ReplaceNodeWithSpanCommand::doUnapply):
1641         (WebCore::ReplaceNodeWithSpanCommand::getNodesInCommand):
1642         * editing/ReplaceNodeWithSpanCommand.h:
1643         (WebCore::ReplaceNodeWithSpanCommand::create):
1644         * editing/ReplaceSelectionCommand.cpp:
1645         (WebCore::ReplacementFragment::removeNodePreservingChildren):
1646         (WebCore::ReplacementFragment::removeInterchangeNodes):
1647         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
1648         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
1649         (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
1650         (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
1651         (WebCore::handleStyleSpansBeforeInsertion):
1652         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
1653         (WebCore::ReplaceSelectionCommand::doApply):
1654         (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
1655         (WebCore::ReplaceSelectionCommand::insertAsListItems):
1656         (WebCore::ReplaceSelectionCommand::performTrivialReplace):
1657         * editing/SetNodeAttributeCommand.cpp:
1658         (WebCore::SetNodeAttributeCommand::SetNodeAttributeCommand):
1659         (WebCore::SetNodeAttributeCommand::getNodesInCommand):
1660         * editing/SetNodeAttributeCommand.h:
1661         (WebCore::SetNodeAttributeCommand::create):
1662         * editing/SimplifyMarkupCommand.cpp:
1663         (WebCore::SimplifyMarkupCommand::doApply):
1664         (WebCore::SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove):
1665         * editing/SimplifyMarkupCommand.h:
1666         * editing/SplitElementCommand.cpp:
1667         (WebCore::SplitElementCommand::SplitElementCommand):
1668         (WebCore::SplitElementCommand::executeApply):
1669         (WebCore::SplitElementCommand::getNodesInCommand):
1670         * editing/SplitElementCommand.h:
1671         (WebCore::SplitElementCommand::create):
1672         * editing/SplitTextNodeCommand.cpp:
1673         (WebCore::SplitTextNodeCommand::SplitTextNodeCommand):
1674         (WebCore::SplitTextNodeCommand::doApply):
1675         (WebCore::SplitTextNodeCommand::doUnapply):
1676         (WebCore::SplitTextNodeCommand::doReapply):
1677         (WebCore::SplitTextNodeCommand::insertText1AndTrimText2):
1678         * editing/SplitTextNodeCommand.h:
1679         (WebCore::SplitTextNodeCommand::create):
1680         * editing/SplitTextNodeContainingElementCommand.cpp:
1681         (WebCore::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
1682         (WebCore::SplitTextNodeContainingElementCommand::doApply):
1683         * editing/SplitTextNodeContainingElementCommand.h:
1684         (WebCore::SplitTextNodeContainingElementCommand::create):
1685         * editing/TextInsertionBaseCommand.cpp:
1686         (WebCore::TextInsertionBaseCommand::applyTextInsertionCommand):
1687         * editing/TypingCommand.cpp:
1688         (WebCore::TypingCommand::makeEditableRootEmpty):
1689         * page/ContextMenuController.cpp:
1690         (WebCore::ContextMenuController::contextMenuItemSelected):
1691
1692 2017-05-04  Daniel Bates  <dabates@apple.com>
1693
1694         Fix misspelled word "interrupt" as pointed out by Darin Adler
1695         in <https://bugs.webkit.org/show_bug.cgi?id=171577>.
1696
1697         * loader/FrameLoader.cpp:
1698         (WebCore::FrameLoader::transitionToCommitted):
1699
1700 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
1701
1702         UIColor +whiteColor and +clearColor are ambiguous and need to be casted when soft linked.
1703         https://bugs.webkit.org/show_bug.cgi?id=171704
1704
1705         Reviewed by Jer Noble.
1706
1707         No new tests because no behavior change.
1708
1709         Fix build by casting result of +clearColor to UIColor.
1710
1711         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1712         (clearUIColor):
1713         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
1714         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
1715         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
1716
1717 2017-05-04  Chris Dumez  <cdumez@apple.com>
1718
1719         Element.slot should be marked as [Unscopable]
1720         https://bugs.webkit.org/show_bug.cgi?id=171683
1721
1722         Reviewed by Darin Adler.
1723
1724         Element.slot should be marked as [Unscopable]:
1725         - https://dom.spec.whatwg.org/#interface-element
1726         - https://heycam.github.io/webidl/#Unscopable
1727
1728         Test: fast/shadow-dom/Element-slot-unscopable.html
1729
1730         * dom/Element.idl:
1731
1732 2017-05-04  Don Olmstead  <don.olmstead@am.sony.com>
1733
1734         [Win] Remove redundant macros that are set in the CMake config
1735         https://bugs.webkit.org/show_bug.cgi?id=171571
1736
1737         Reviewed by Brent Fulgham.
1738
1739         No new tests. No change in behavior.
1740
1741         * WebCorePrefix.h:
1742         * config.h:
1743         * platform/win/COMPtr.h:
1744         * platform/win/WindowsTouch.h:
1745         * testing/js/WebCoreTestSupportPrefix.h:
1746
1747 2017-05-04  Tim Horton  <timothy_horton@apple.com>
1748
1749         [Mac] Modernize image for dragged link
1750         https://bugs.webkit.org/show_bug.cgi?id=171701
1751         <rdar://problem/31978818>
1752
1753         Reviewed by Simon Fraser.
1754
1755         * WebCore.xcodeproj/project.pbxproj:
1756         * page/mac/DragControllerMac.mm:
1757         * platform/mac/DragImageMac.mm:
1758         (WebCore::dragImageSize):
1759         (WebCore::scaleDragImage):
1760         (WebCore::dissolveDragImageToFraction):
1761         (WebCore::createDragImageFromImage):
1762         (WebCore::LinkImageLayout::LinkImageLayout):
1763         (WebCore::LinkImageLayout::layOutText):
1764         (WebCore::LinkImageLayout::addLine):
1765         (WebCore::createDragImageForLink):
1766         (WebCore::fontFromNSFont): Deleted.
1767         (WebCore::canUseFastRenderer): Deleted.
1768         (WebCore::widthWithFont): Deleted.
1769         (WebCore::drawAtPoint): Deleted.
1770         (WebCore::drawDoubledAtPoint): Deleted.
1771         * platform/spi/cocoa/LinkPresentationSPI.h: Added.
1772         Improve the design of URL drag images.
1773         The margins are increased, the background is now white, the text is
1774         not drawn doubled-up, the title will now wrap to two lines, and the
1775         domain name will appear simplified and de-punycoded.
1776
1777         Much of the implementation of text painting is borrowed from
1778         <attachment> for now, but we should figure out how to generalize
1779         it for UI-like parts of WebKit in the future.
1780
1781 2017-05-04  Commit Queue  <commit-queue@webkit.org>
1782
1783         Unreviewed, rolling out r216223.
1784         https://bugs.webkit.org/show_bug.cgi?id=171706
1785
1786         not quite ready (Requested by thorton on #webkit).
1787
1788         Reverted changeset:
1789
1790         "[Mac] Modernize image for dragged link"
1791         https://bugs.webkit.org/show_bug.cgi?id=171701
1792         http://trac.webkit.org/changeset/216223
1793
1794 2017-05-04  Tim Horton  <timothy_horton@apple.com>
1795
1796         [Mac] Modernize image for dragged link
1797         https://bugs.webkit.org/show_bug.cgi?id=171701
1798         <rdar://problem/31978818>
1799
1800         Reviewed by Simon Fraser.
1801
1802         * page/mac/DragControllerMac.mm:
1803         * platform/mac/DragImageMac.mm:
1804         (WebCore::dragImageSize):
1805         (WebCore::scaleDragImage):
1806         (WebCore::dissolveDragImageToFraction):
1807         (WebCore::createDragImageFromImage):
1808         (WebCore::LinkImageLayout::LinkImageLayout):
1809         (WebCore::LinkImageLayout::addLine):
1810         (WebCore::createDragImageForLink):
1811         (WebCore::fontFromNSFont): Deleted.
1812         (WebCore::canUseFastRenderer): Deleted.
1813         (WebCore::widthWithFont): Deleted.
1814         (WebCore::drawAtPoint): Deleted.
1815         (WebCore::drawDoubledAtPoint): Deleted.
1816         Improve the design of URL drag images.
1817         The margins are increased, the background is now white, the text is
1818         not drawn doubled-up, the title will now wrap to two lines, and the
1819         domain name will appear simplified and de-punycoded.
1820
1821         Much of the implementation of text painting is borrowed from
1822         <attachment> for now, but we should figure out how to generalize
1823         it for UI-like parts of WebKit in the future.
1824
1825 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
1826
1827         Use if instead of return early for 13 places in WebAVPlayerController
1828         https://bugs.webkit.org/show_bug.cgi?id=171692
1829
1830         Reviewed by Jer Noble.
1831
1832         No new tests because no behavior change.
1833
1834         * platform/ios/WebAVPlayerController.mm:
1835         (-[WebAVPlayerController play:]):
1836         (-[WebAVPlayerController pause:]):
1837         (-[WebAVPlayerController togglePlayback:]):
1838         (-[WebAVPlayerController beginScrubbing:]):
1839         (-[WebAVPlayerController endScrubbing:]):
1840         (-[WebAVPlayerController seekToTime:]):
1841         (-[WebAVPlayerController beginScanningForward:]):
1842         (-[WebAVPlayerController endScanningForward:]):
1843         (-[WebAVPlayerController beginScanningBackward:]):
1844         (-[WebAVPlayerController endScanningBackward:]):
1845         (-[WebAVPlayerController seekToBeginning:]):
1846         (-[WebAVPlayerController seekToEnd:]):
1847         (-[WebAVPlayerController toggleMuted:]):
1848
1849 2017-05-04  Filip Pizlo  <fpizlo@apple.com>
1850
1851         JSC::Heap should expose a richer API for requesting GCs
1852         https://bugs.webkit.org/show_bug.cgi?id=171690
1853
1854         Reviewed by Geoffrey Garen.
1855
1856         No new tests because this is just a refactoring.
1857         
1858         Change some function calls now that some JSC::Heap APIs got renamed.
1859
1860         * bindings/js/GCController.cpp:
1861         (WebCore::collect):
1862         (WebCore::GCController::garbageCollectNow):
1863         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
1864
1865 2017-05-04  Mark Lam  <mark.lam@apple.com>
1866
1867         NeverDestroyed<String>(ASCIILiteral(...)) is not thread safe.
1868         https://bugs.webkit.org/show_bug.cgi?id=171586
1869         <rdar://problem/31873190>
1870
1871         Reviewed by Yusuke Suzuki.
1872
1873         No new tests because we're just converting uses of ASCIILiteral (in the
1874         instantiation of NeverDestroyed<String> and NeverDestroyed<const String>) to
1875         MAKE_STATIC_STRING_IMPL.
1876
1877         The correctness of using MAKE_STATIC_STRING_IMPL is tested in the newly added
1878         API test in this patch.
1879
1880         Also changed "static NeverDestroyed<ASCIILiteral>" instances in
1881         SQLiteIDBBackingStore.cpp to "static const char* const" because they are only
1882         ever used to get the underlying const char*.
1883
1884         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1885         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1886         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
1887         * Modules/mediastream/MediaEndpointSessionDescription.cpp:
1888         * Modules/mediastream/RTCRtpTransceiver.cpp:
1889         * Modules/mediastream/SDPProcessor.cpp:
1890         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
1891         (WebCore::customHandlersStateString):
1892         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
1893         * Modules/speech/SpeechSynthesis.cpp:
1894         (WebCore::SpeechSynthesis::boundaryEventOccurred):
1895         * accessibility/AccessibilityMediaControls.cpp:
1896         (WebCore::AccessibilityMediaControl::controlTypeName):
1897         (WebCore::AccessibilityMediaControl::title):
1898         (WebCore::AccessibilityMediaControlsContainer::elementTypeName):
1899         (WebCore::AccessibilityMediaTimeline::helpText):
1900         (WebCore::AccessibilityMediaTimeDisplay::accessibilityDescription):
1901         * bindings/js/JSLazyEventListener.cpp:
1902         (WebCore::eventParameterName):
1903         * contentextensions/ContentExtensionsBackend.cpp:
1904         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
1905         * css/CSSDefaultStyleSheets.cpp:
1906         (WebCore::screenEval):
1907         (WebCore::printEval):
1908         * css/MediaList.cpp:
1909         (WebCore::addResolutionWarningMessageToConsole):
1910         * css/StyleSheetContents.cpp:
1911         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1912         * dom/Document.cpp:
1913         (WebCore::Document::readyState):
1914         * dom/LoadableClassicScript.cpp:
1915         (WebCore::LoadableClassicScript::notifyFinished):
1916         * dom/PseudoElement.cpp:
1917         (WebCore::PseudoElement::pseudoElementNameForEvents):
1918         * editing/MarkupAccumulator.cpp:
1919         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
1920         * editing/cocoa/DataDetection.mm:
1921         (WebCore::DataDetection::dataDetectorURLProtocol):
1922         * editing/markup.cpp:
1923         (WebCore::StyledMarkupAccumulator::styleNodeCloseTag):
1924         (WebCore::createMarkupInternal):
1925         * html/FormController.cpp:
1926         (WebCore::formStateSignature):
1927         * html/ImageInputType.cpp:
1928         (WebCore::ImageInputType::appendFormData):
1929         * html/canvas/CanvasRenderingContext2D.cpp:
1930         (WebCore::CanvasRenderingContext2D::realizeSaves):
1931         (WebCore::CanvasRenderingContext2D::getImageData):
1932         * html/parser/XSSAuditor.cpp:
1933         (WebCore::XSSAuditor::init):
1934         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
1935         * html/track/VTTCue.cpp:
1936         (WebCore::startKeyword):
1937         (WebCore::middleKeyword):
1938         (WebCore::endKeyword):
1939         (WebCore::leftKeyword):
1940         (WebCore::rightKeyword):
1941         (WebCore::verticalGrowingLeftKeyword):
1942         (WebCore::verticalGrowingRightKeyword):
1943         (WebCore::VTTCue::determineTextDirection):
1944         (WebCore::VTTCue::markFutureAndPastNodes):
1945         * inspector/InspectorCSSAgent.cpp:
1946         (WebCore::computePseudoClassMask):
1947         * inspector/InspectorIndexedDBAgent.cpp:
1948         * inspector/InspectorPageAgent.cpp:
1949         (WebCore::InspectorPageAgent::sourceMapURLForResource):
1950         * inspector/PageDebuggerAgent.cpp:
1951         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
1952         * loader/ImageLoader.cpp:
1953         (WebCore::ImageLoader::notifyFinished):
1954         * loader/TextTrackLoader.cpp:
1955         (WebCore::TextTrackLoader::corsPolicyPreventedLoad):
1956         * loader/icon/IconDatabase.cpp:
1957         (WebCore::IconDatabase::defaultDatabaseFilename):
1958         * page/CaptionUserPreferencesMediaAF.cpp:
1959         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
1960         * page/SecurityOrigin.cpp:
1961         (WebCore::SecurityOrigin::urlWithUniqueSecurityOrigin):
1962         * page/UserContentURLPattern.cpp:
1963         (WebCore::UserContentURLPattern::parse):
1964         * platform/MIMETypeRegistry.cpp:
1965         (WebCore::defaultMIMEType):
1966         * platform/animation/Animation.cpp:
1967         (WebCore::Animation::initialName):
1968         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1969         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::engineDescription):
1970         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1971         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::engineDescription):
1972         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1973         (WebCore::FontCache::similarFont):
1974         * platform/gtk/UserAgentGtk.cpp:
1975         (WebCore::platformVersionForUAString):
1976         * platform/mock/mediasource/MockBox.cpp:
1977         (WebCore::MockTrackBox::type):
1978         (WebCore::MockInitializationBox::type):
1979         (WebCore::MockSampleBox::type):
1980         * platform/network/HTTPHeaderValues.cpp:
1981         (WebCore::HTTPHeaderValues::textPlainContentType):
1982         (WebCore::HTTPHeaderValues::formURLEncodedContentType):
1983         (WebCore::HTTPHeaderValues::noCache):
1984         (WebCore::HTTPHeaderValues::maxAge0):
1985         * platform/network/HTTPParsers.cpp:
1986         (WebCore::parseXSSProtectionHeader):
1987         * replay/MemoizedDOMResult.cpp:
1988         (JSC::InputTraits<MemoizedDOMResultBase>::type):
1989         * svg/SVGTransformValue.cpp:
1990         (WebCore::SVGTransformValue::transformTypePrefixForParsing):
1991
1992 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
1993
1994         Add muted to WebPlaybackSessionModel.
1995         https://bugs.webkit.org/show_bug.cgi?id=171592
1996         rdar://problem/31814074
1997
1998         Reviewed by Jer Noble.
1999
2000         No behavior change. This just adds the ability for UI to mute.
2001
2002         * platform/cocoa/WebPlaybackSessionModel.h:
2003         (WebCore::WebPlaybackSessionModelClient::mutedChanged):
2004         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
2005         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2006         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
2007         (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
2008         (WebCore::WebPlaybackSessionModelMediaElement::observedEventNames):
2009         (WebCore::WebPlaybackSessionModelMediaElement::isMuted):
2010         * platform/ios/WebAVPlayerController.h:
2011         * platform/ios/WebAVPlayerController.mm:
2012         (-[WebAVPlayerController toggleMuted:]):
2013         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
2014         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
2015         (WebCore::WebPlaybackSessionInterfaceAVKit::mutedChanged):
2016         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2017         (WebVideoFullscreenControllerContext::mutedChanged):
2018         (WebVideoFullscreenControllerContext::isMuted):
2019         (WebVideoFullscreenControllerContext::toggleMuted):
2020         * platform/spi/ios/MediaPlayerSPI.h:
2021
2022 2017-05-04  Joseph Pecoraro  <pecoraro@apple.com>
2023
2024         REGRESSION(r216138): Web Inspector: ASSERT(!content.isNull()) when checking for source map url opening inspector
2025         https://bugs.webkit.org/show_bug.cgi?id=171697
2026         <rdar://problem/31999512>
2027
2028         Reviewed by Matt Baker.
2029
2030         * inspector/InspectorPageAgent.cpp:
2031         (WebCore::InspectorPageAgent::cachedResourceContent):
2032         Always set base64Encoded when returning true. Return the empty
2033         string instead of a null string matching previous behavior.
2034
2035 2017-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2036
2037         [WK2] Add support for keeping the selection in a focused editable element when dragging begins
2038         https://bugs.webkit.org/show_bug.cgi?id=171585
2039         <rdar://problem/31544320>
2040
2041         Reviewed by Beth Dakin and Zalan Bujtas.
2042
2043         Covered by 4 API tests.
2044
2045         * dom/DocumentMarker.h:
2046
2047         Introduces the DraggedContent DocumentMarker type, which applies to the Range in the DOM that is being used as
2048         a drag source. Also adds DraggedContentData, which contains nodes found by the TextIterator in the process of
2049         finding Ranges to mark.
2050
2051         (WebCore::DocumentMarker::AllMarkers::AllMarkers):
2052         * dom/DocumentMarkerController.cpp:
2053         (WebCore::DocumentMarkerController::addDraggedContentMarker):
2054         (WebCore::shouldInsertAsSeparateMarker):
2055         (WebCore::DocumentMarkerController::addMarker):
2056
2057         When adding DocumentMarkers of type DraggedContent, keep adjacent RenderReplaced elements separate, rather than
2058         merging them into existing RenderedDocumentMarkers. This is because the data for each of these (i.e. the target
2059         node) needs to be preserved.
2060
2061         (WebCore::DocumentMarkerController::markersFor):
2062
2063         Bail and return an empty list if the map of document markers cannot possibly contain a dragged content marker.
2064
2065         * dom/DocumentMarkerController.h:
2066         * page/DragController.h:
2067         * page/DragState.h:
2068
2069         Add draggedContentRange to DragState. This tracks the Range that is being dragged; it is created when the drag
2070         session has begun, and ends when drag session finishes (either via WebPage::dragEnded or WebPage::dragCancelled).
2071
2072         * page/EventHandler.cpp:
2073         (WebCore::repaintContentsOfRange):
2074         (WebCore::EventHandler::dragCancelled):
2075
2076         Called when a drag is cancelled in the UI process without a session ever getting a chance to begin. We use this
2077         as a hook to remove all DraggedContent document markers from the document of the dragged content range.
2078
2079         (WebCore::EventHandler::didStartDrag):
2080
2081         Called when a drag session has begun in the UI process. We use this as a hook to set up document markers for the
2082         Range of content being dragged.
2083
2084         (WebCore::EventHandler::dragSourceEndedAt):
2085
2086         Called when a drag session ends. We use this as a hook to remove all DraggedContent document markers from the
2087         document of the dragged content range.
2088
2089         (WebCore::EventHandler::draggedElement):
2090         * page/EventHandler.h:
2091         * page/FocusController.cpp:
2092         (WebCore::shouldClearSelectionWhenChangingFocusedElement):
2093
2094         Prevent the selection from clearing when the previously focused element is editable and also contains the drag
2095         source element. Ideally, we should experiment with clearing out the selection whenever the element is blurred
2096         (and not have additional restrictions on editability and containing the drag source), but this change is much
2097         riskier.
2098
2099         (WebCore::FocusController::setFocusedElement):
2100         * rendering/InlineTextBox.cpp:
2101         (WebCore::InlineTextBox::paint):
2102
2103         Use RenderText::draggedContentStartEnd to find the range of text (if any) that is dragged content, and paint
2104         these ranges of text at a lower alpha using TextPainter::paintTextInRange.
2105
2106         * rendering/RenderReplaced.cpp:
2107         (WebCore::draggedContentContainsReplacedElement):
2108
2109         Determines whether or not the element being rendered is contained within a dragged content range. Assuming that
2110         the DraggedContent type flag is set in DocumentMarkerController, we first look to see whether or not the
2111         container node is in the document marker map. If so, instead of consulting node offset ranges (since this is, in
2112         the worst-case, linear in the number of sibling nodes per RenderReplaced) we simply check the DraggedContentData
2113         to see if the current element being rendered matches one of the target nodes.
2114
2115         (WebCore::RenderReplaced::paint):
2116
2117         If the element rendered by this RenderReplaced is dragged content, then render it at a low alpha.
2118
2119         * rendering/RenderText.cpp:
2120         (WebCore::RenderText::draggedContentRangesBetweenOffsets):
2121
2122         Determines what range of text, if any, contains dragged content by consulting the Document's DocumentMarkers.
2123
2124         * rendering/RenderText.h:
2125         * rendering/TextPainter.cpp:
2126         (WebCore::TextPainter::paintTextInRange):
2127
2128         Teach TextPainter to only paint a given range in a TextRun.
2129
2130         * rendering/TextPainter.h:
2131
2132         Add TextPainter support for specifying special text offset ranges when rendering a TextRun, such that each
2133         special range in text is rendered after applying some modification to the GraphicsContext.
2134
2135 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
2136
2137         Crash when pointer lock element is removed before pointer lock allowed arrives.
2138         https://bugs.webkit.org/show_bug.cgi?id=171642
2139
2140         Reviewed by Jer Noble.
2141
2142         Make sure there a pending lock before attempting to complete pointer lock.
2143
2144         * page/PointerLockController.cpp:
2145         (WebCore::PointerLockController::didAcquirePointerLock):
2146
2147 2017-05-04  Chris Dumez  <cdumez@apple.com>
2148
2149         Reformat / Clean up Node.idl to match the specification
2150         https://bugs.webkit.org/show_bug.cgi?id=171686
2151
2152         Reviewed by Sam Weinig.
2153
2154         Reformat / Clean up Node.idl to match the specification:
2155         - https://dom.spec.whatwg.org/#node
2156
2157         There should be no Web-facing behavior change, except for Node properties
2158         being enumerated in a slightly different order.
2159
2160         * dom/Node.idl:
2161
2162 2017-05-04  Sam Weinig  <sam@webkit.org>
2163
2164         Remove support for legacy Notifications
2165         https://bugs.webkit.org/show_bug.cgi?id=171487
2166
2167         Reviewed by Jon Lee.
2168
2169         * CMakeLists.txt:
2170         * WebCore.xcodeproj/project.pbxproj:
2171         Remove files.
2172
2173         * Configurations/FeatureDefines.xcconfig:
2174         Remove definition of ENABLE_LEGACY_NOTIFICATIONS.
2175
2176         * DerivedSources.make:
2177         Remove IDL files.
2178
2179         * Modules/notifications/DOMWindowNotifications.cpp: Removed.
2180         * Modules/notifications/DOMWindowNotifications.h: Removed.
2181         * Modules/notifications/DOMWindowNotifications.idl: Removed.
2182         * Modules/notifications/NotificationCenter.cpp: Removed.
2183         * Modules/notifications/NotificationCenter.h: Removed.
2184         * Modules/notifications/NotificationCenter.idl: Removed.
2185         * Modules/notifications/NotificationClient.h:
2186         * Modules/notifications/NotificationController.cpp:
2187         * Modules/notifications/NotificationController.h:
2188         * Modules/notifications/WorkerGlobalScopeNotifications.cpp: Removed.
2189         * Modules/notifications/WorkerGlobalScopeNotifications.h: Removed.
2190         * Modules/notifications/WorkerGlobalScopeNotifications.idl: Removed.
2191         * Modules/notifications/Notification.idl:
2192         * Modules/notifications/Notification.cpp:
2193         * Modules/notifications/Notification.h:
2194         * dom/EventTargetFactory.in:
2195         * page/DOMWindow.cpp:
2196         * workers/WorkerThread.h:
2197         Remove code legacy Notification code. Replace use of NotificationCenter with direct
2198         calls to the NotificationClient.
2199
2200 2017-05-04  Antti Koivisto  <antti@apple.com>
2201
2202         REGRESSION (Safari 10.1): When 'transition' contains -ms-transform, transform-origin is also transitioned
2203         https://bugs.webkit.org/show_bug.cgi?id=171250
2204         <rdar://problem/31827243>
2205
2206         Reviewed by Geoffrey Garen.
2207
2208         We were mapping unknown properties to 'all' animation. With this patch we ignore them instead.
2209         The patch also implements roundtripping of unknown properties via CSSOM, matching Blink and Gecko.
2210
2211         Test: transitions/transition-unknown-property-ignore.html
2212
2213         * css/CSSComputedStyleDeclaration.cpp:
2214         (WebCore::createTransitionPropertyValue):
2215
2216             Return the correct name for unknown properties.
2217
2218         * css/CSSToStyleMap.cpp:
2219         (WebCore::CSSToStyleMap::mapAnimationProperty):
2220
2221             Map any unknown property to AnimateUnknownProperty mode instead of falling back to the default of AnimateAll.
2222             Save the unknown property name so we can roundtrip it properly.
2223
2224         * page/animation/CompositeAnimation.cpp:
2225         (WebCore::CompositeAnimation::updateTransitions):
2226
2227             Ignore AnimateUnknownProperty like AnimateNone.
2228
2229         * platform/animation/Animation.h:
2230         (WebCore::Animation::unknownProperty):
2231         (WebCore::Animation::setUnknownProperty):
2232
2233 2017-05-04  Chris Dumez  <cdumez@apple.com>
2234
2235         Clean up MutationRecord.idl
2236         https://bugs.webkit.org/show_bug.cgi?id=171685
2237
2238         Reviewed by Sam Weinig.
2239
2240         Clean up MutationRecord.idl to match the specification:
2241         - https://dom.spec.whatwg.org/#mutationrecord
2242
2243         There is no Web-facing behavior change.
2244
2245         * dom/MutationRecord.idl:
2246
2247 2017-05-04  Chris Dumez  <cdumez@apple.com>
2248
2249         Reformat / clean up Event.idl
2250         https://bugs.webkit.org/show_bug.cgi?id=171675
2251
2252         Reviewed by Sam Weinig.
2253
2254         Reformat / clean up Event.idl to match the latest spec more closely:
2255         - https://dom.spec.whatwg.org/#interface-event
2256
2257         There is no web-facing behavior change, except for properties being
2258         enumerated in a slightly different order.
2259
2260         * dom/Event.idl:
2261
2262 2017-05-04  Daniel Bates  <dabates@apple.com>
2263
2264         Cleanup: Extract CachedScript::mimeTypeAllowedByNosniff() into a common function
2265         https://bugs.webkit.org/show_bug.cgi?id=171678
2266
2267         Reviewed by Andy Estes.
2268
2269         Extract CachedScript::mimeTypeAllowedByNosniff() into a common function that can
2270         be shared by LoadableClassicScript and WorkerScriptLoader.
2271
2272         No functionality was changed. So, no new tests.
2273
2274         * dom/LoadableClassicScript.cpp:
2275         (WebCore::LoadableClassicScript::notifyFinished): Modified to use WebCore::isScriptAllowedByNosniff().
2276         * loader/cache/CachedScript.cpp:
2277         (WebCore::CachedScript::mimeType): Deleted; incorporated into WebCore::isScriptAllowedByNosniff().
2278         (WebCore::CachedScript::mimeTypeAllowedByNosniff): Deleted; incorporated into WebCore::isScriptAllowedByNosniff().
2279         * loader/cache/CachedScript.h:
2280         * platform/network/ResourceResponseBase.cpp:
2281         (WebCore::isScriptAllowedByNosniff): Added. Note that it is sufficient to extract the MIME type
2282         as-is and query the MIME type registry because the MIME type registry performs look ups case-insensitively.
2283         * platform/network/ResourceResponseBase.h:
2284         * workers/WorkerScriptLoader.cpp:
2285         (WebCore::WorkerScriptLoader::didReceiveResponse): Modified to use WebCore::isScriptAllowedByNosniff().
2286         (WebCore::mimeTypeAllowedByNosniff): Deleted.
2287
2288 2017-05-04  Sam Weinig  <sam@webkit.org>
2289
2290         Make the [EnabledBySetting] extended attribute work for any attribute or operation on a prototype
2291         https://bugs.webkit.org/show_bug.cgi?id=171588
2292
2293         Reviewed by Dean Jackson.
2294
2295         * bindings/js/JSDOMIterator.h:
2296         (WebCore::JSDOMIterator::createPrototype):
2297         * bindings/js/JSDOMWindowShell.cpp:
2298         (WebCore::JSDOMWindowShell::setWindow):
2299         * bindings/js/JSDOMWrapperCache.h:
2300         (WebCore::getDOMStructure):
2301         (WebCore::getDOMPrototype):
2302         * bindings/js/WorkerScriptController.cpp:
2303         (WebCore::WorkerScriptController::initScript):
2304         Update to account for createPrototype and prototype taking the global object by reference.
2305         
2306         * bindings/scripts/CodeGeneratorJS.pm:
2307         (NeedsSettingsCheckForPrototypeProperty):
2308         Add predicate to determine if an interface has any settings enabled properties on the prototype,
2309         needed to determine if we should pass the global object to finishCreation.
2310
2311         (GenerateHeader):
2312         Update signature of both createPrototype and prototype to take JSDOMGlobalObject& rather than
2313         a JSC::JSGlobalObject*, this allows us to pass the more specific type to the prototype constructor,
2314         and access the ScriptExecutionContext for the Settings.
2315
2316         (GeneratePropertiesHashTable):
2317         Update to return, via out parameter, arrays with the attributes and operations that specify EnabledBySetting. This
2318         mimics the model used for RuntimeEnabledFeatures.
2319
2320         (GenerateImplementation):
2321         In {Class}Prototype::finishCreation, add code to check settings to see if an attribute or operation should be enabled,
2322         and if it shouldn't remove it from the object. This, again, is modeled on RuntimeEnabledFeatures.
2323
2324         (GeneratePrototypeDeclaration):
2325         Update signatures to take JSDOMGlobalObject& and specialize finishCreation to take one if there are any properties
2326         that require settings to enable.
2327
2328         (GenerateConstructorHelperMethods):
2329         Update for new signature of prototype(...).
2330
2331         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2332         * bindings/scripts/test/JS/JSInterfaceName.h:
2333         * bindings/scripts/test/JS/JSMapLike.cpp:
2334         * bindings/scripts/test/JS/JSMapLike.h:
2335         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2336         * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
2337         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2338         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2339         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2340         * bindings/scripts/test/JS/JSTestCEReactions.h:
2341         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2342         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
2343         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2344         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2345         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2346         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2347         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2348         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2349         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2350         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2351         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2352         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2353         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2354         * bindings/scripts/test/JS/JSTestEventTarget.h:
2355         * bindings/scripts/test/JS/JSTestException.cpp:
2356         * bindings/scripts/test/JS/JSTestException.h:
2357         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2358         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2359         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2360         * bindings/scripts/test/JS/JSTestInterface.cpp:
2361         * bindings/scripts/test/JS/JSTestInterface.h:
2362         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2363         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
2364         * bindings/scripts/test/JS/JSTestIterable.cpp:
2365         * bindings/scripts/test/JS/JSTestIterable.h:
2366         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2367         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
2368         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2369         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2370         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2371         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2372         * bindings/scripts/test/JS/JSTestNode.cpp:
2373         * bindings/scripts/test/JS/JSTestNode.h:
2374         * bindings/scripts/test/JS/JSTestObj.cpp:
2375         * bindings/scripts/test/JS/JSTestObj.h:
2376         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2377         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2378         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2379         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
2380         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2381         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2382         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2383         * bindings/scripts/test/JS/JSTestSerialization.h:
2384         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2385         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
2386         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2387         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
2388         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2389         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2390         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2391         * bindings/scripts/test/JS/JSTestTypedefs.h:
2392         Update test results for new test values and changes in signatures to pass JSDOMGlobalObject.
2393
2394         * bindings/scripts/test/TestObj.idl:
2395         Add tests for [EnableBySetting] for attributes and operations.
2396
2397         * bridge/objc/objc_runtime.h:
2398         * bridge/runtime_array.h:
2399         * bridge/runtime_method.h:
2400         * bridge/runtime_object.h:
2401         * inspector/CommandLineAPIHost.cpp:
2402         Update createPrototype function to take the global object by reference.
2403
2404 2017-05-04  Eric Carlson  <eric.carlson@apple.com>
2405
2406         [MediaStream] Allow host application to enable/disable media capture
2407         https://bugs.webkit.org/show_bug.cgi?id=171292
2408         <rdar://problem/31821492>
2409
2410         Reviewed by Jer Noble.
2411
2412         No new layout tests, added an API test instead.
2413
2414         * Modules/mediastream/MediaStream.cpp:
2415         (WebCore::MediaStream::endStream): New, stop all tracks.
2416         * Modules/mediastream/MediaStream.h:
2417
2418         * Modules/mediastream/MediaStreamRegistry.cpp:
2419         (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
2420         (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
2421         (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
2422         * Modules/mediastream/MediaStreamRegistry.h:
2423
2424         * Modules/mediastream/MediaStreamTrack.cpp:
2425         (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' 
2426         event should be sent or not.
2427         (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
2428         * Modules/mediastream/MediaStreamTrack.h:
2429
2430         * dom/Document.cpp:
2431         (WebCore::Document::stopMediaCapture): Stop all streams in the document.
2432         * dom/Document.h:
2433
2434         * page/Page.cpp:
2435         (WebCore::Page::stopMediaCapture): Stop all streams.
2436         * page/Page.h:
2437
2438         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2439         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
2440         when the stream ends.
2441         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
2442         change to HTMLMediaElement refresh state.
2443         * platform/mediastream/MediaStreamPrivate.h:
2444
2445         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2446         (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't 
2447         running, we always need to clear m_session on iOS.
2448
2449 2017-05-04  Zalan Bujtas  <zalan@apple.com>
2450
2451         Should never hit layout while updating the render tree.
2452         https://bugs.webkit.org/show_bug.cgi?id=171643
2453
2454         Reviewed by Antti Koivisto.
2455
2456         Laying out a half-baked render tree is not a great idea. Especially considering
2457         that layout (sadly) can mutate the render tree.  
2458
2459         * page/FrameView.cpp:
2460         (WebCore::FrameView::layout):
2461
2462 2017-05-04  Daniel Bates  <dabates@apple.com>
2463
2464         importScripts() should respect X-Content-Type-Options: nosniff
2465         https://bugs.webkit.org/show_bug.cgi?id=171248
2466         <rdar://problem/31819023>
2467
2468         Reviewed by Andy Estes.
2469
2470         Do not load a worker script if it has the HTTP response header "X-Content-Type-Options: nosniff"
2471         and its Content-type header is not an allowed JavaScript script mime type. This behavior follows
2472         from <https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-imported-script> (3 May 2017),
2473         <https://fetch.spec.whatwg.org/#concept-fetch> (2 May 2017), and <https://fetch.spec.whatwg.org/#concept-main-fetch>.
2474
2475         * workers/WorkerScriptLoader.cpp:
2476         (WebCore::mimeTypeAllowedByNosniff): Added.
2477         (WebCore::WorkerScriptLoader::didReceiveResponse): Mark the load as failed if the response
2478         is not allowed by X-Content-Type-Options: nosniff.
2479
2480 2017-05-04  Dave Hyatt  <hyatt@apple.com>
2481
2482         REGRESSION(STP): rgb() with calc() containing variables doesn't work
2483         https://bugs.webkit.org/show_bug.cgi?id=169939
2484
2485         Reviewed by Zalan Bujtas.
2486
2487         Added new test in fast/css/variables.
2488
2489         * css/CSSCalculationValue.cpp:
2490         (WebCore::CSSCalcExpressionNodeParser::parseValue):
2491         Treat floats in calcs as integers when we can.
2492
2493 2017-05-04  Commit Queue  <commit-queue@webkit.org>
2494
2495         Unreviewed, rolling out r216172.
2496         https://bugs.webkit.org/show_bug.cgi?id=171654
2497
2498         FTBFS for iOS due to missing WebPageProxy::stopMediaCapture()
2499         implementation. (Requested by ddkilzer on #webkit).
2500
2501         Reverted changeset:
2502
2503         "[MediaStream] Allow host application to enable/disable media
2504         capture"
2505         https://bugs.webkit.org/show_bug.cgi?id=171292
2506         http://trac.webkit.org/changeset/216172
2507
2508 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2509
2510         REGRESSION(r215686): Incremental reads from SharedBuffer are wrong after r215686
2511         https://bugs.webkit.org/show_bug.cgi?id=171602
2512
2513         Reviewed by Michael Catanzaro.
2514
2515         In TextTrackLoader::processNewCueData() and PNGImageReader::decode() we changed the patter to read data from a
2516         SharedBuffer at a given offset. The new pattern is not correct, because it assumes the whole segment is always
2517         read, and the new offset is not correct when that's not the case. This has broken the rendering of png images in
2518         the GTK+ port, only the first bytes are correctly decoded and drawn, but not the rest of the image.
2519
2520         Fixes: editing/pasteboard/paste-image-using-image-data.html
2521
2522         * loader/TextTrackLoader.cpp:
2523         (WebCore::TextTrackLoader::processNewCueData):
2524         * platform/image-decoders/png/PNGImageDecoder.cpp:
2525         (WebCore::PNGImageReader::decode):
2526
2527 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
2528
2529         [MediaStream] Allow host application to enable/disable media capture
2530         https://bugs.webkit.org/show_bug.cgi?id=171292
2531         <rdar://problem/31821492>
2532
2533         Reviewed by Jer Noble.
2534
2535         No new layout tests, added an API test instead.
2536
2537         * Modules/mediastream/MediaStream.cpp:
2538         (WebCore::MediaStream::endStream): New, stop all tracks.
2539         * Modules/mediastream/MediaStream.h:
2540
2541         * Modules/mediastream/MediaStreamRegistry.cpp:
2542         (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
2543         (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
2544         (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
2545         * Modules/mediastream/MediaStreamRegistry.h:
2546
2547         * Modules/mediastream/MediaStreamTrack.cpp:
2548         (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' 
2549         event should be sent or not.
2550         (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
2551         * Modules/mediastream/MediaStreamTrack.h:
2552
2553         * dom/Document.cpp:
2554         (WebCore::Document::stopMediaCapture): Stop all streams in the document.
2555         * dom/Document.h:
2556
2557         * page/Page.cpp:
2558         (WebCore::Page::stopMediaCapture): Stop all streams.
2559         * page/Page.h:
2560
2561         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2562         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
2563         when the stream ends.
2564         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
2565         change to HTMLMediaElement refresh state.
2566         * platform/mediastream/MediaStreamPrivate.h:
2567
2568         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2569         (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't 
2570         running, we always need to clear m_session on iOS.
2571
2572 2017-05-03  John Wilander  <wilander@apple.com>
2573
2574         Resource Load Statistics: Remove all statistics for modifiedSince website data removals
2575         https://bugs.webkit.org/show_bug.cgi?id=171584
2576         <rdar://problem/24702576>
2577
2578         Reviewed by Brent Fulgham.
2579
2580         Test: http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html
2581
2582         * loader/ResourceLoadObserver.cpp:
2583         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
2584             Now clears all regardless of the modifiedSince parameter's value.
2585
2586 2017-05-03  Andy Estes  <aestes@apple.com>
2587
2588         Try to fix the macOS Public SDK build
2589         https://bugs.webkit.org/show_bug.cgi?id=171635
2590         <rdar://problem/31812751>
2591
2592         Unreviewed because the commit queue told me to say this.
2593
2594         * platform/spi/cocoa/AVKitSPI.h:
2595
2596 2017-05-03  Joanmarie Diggs  <jdiggs@igalia.com>
2597
2598         AX: aria-rowspan value should be ignored if td/th rowspan value is provided
2599         https://bugs.webkit.org/show_bug.cgi?id=171214
2600
2601         Reviewed by Chris Fleizach.
2602
2603         Return -1 in AccessibilityTableCell::ariaColumnSpan() and ariaRowSpan() if the
2604         cell element has an explicit value for the native host language's span attribute.
2605         Add checks to AccessibilityTableCell::columnIndexRange() and rowIndexRange() so
2606         that we prefer an author-provided ARIA span value over an implicit host-language
2607         span value. Similarly, add checks to AccessibilityARIAGridCell::columnIndexRange()
2608         and rowIndexRange() so that we fall back on implicit host-language span values
2609         when there is no author-provided ARIA span value and the ARIA cell is associated
2610         with a cell element.
2611
2612         Test: accessibility/aria-cellspans-with-native-cellspans.html
2613
2614         * accessibility/AccessibilityARIAGridCell.cpp:
2615         (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex):
2616         (WebCore::AccessibilityARIAGridCell::columnIndexRange):
2617         * accessibility/AccessibilityTableCell.cpp:
2618         (WebCore::AccessibilityTableCell::rowIndexRange):
2619         (WebCore::AccessibilityTableCell::columnIndexRange):
2620         (WebCore::AccessibilityTableCell::ariaColumnSpan):
2621         (WebCore::AccessibilityTableCell::ariaRowSpan):
2622
2623 2017-05-03  Commit Queue  <commit-queue@webkit.org>
2624
2625         Unreviewed, rolling out r216160 and r216161.
2626         https://bugs.webkit.org/show_bug.cgi?id=171640
2627
2628         These changes broke the iOS build. (Requested by mlewis13 on
2629         #webkit).
2630
2631         Reverted changesets:
2632
2633         "[MediaStream] Allow host application to enable/disable media
2634         capture"
2635         https://bugs.webkit.org/show_bug.cgi?id=171292
2636         http://trac.webkit.org/changeset/216160
2637
2638         "[MediaStream] Allow host application to enable/disable media
2639         capture"
2640         https://bugs.webkit.org/show_bug.cgi?id=171292
2641         http://trac.webkit.org/changeset/216161
2642
2643 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
2644
2645         [MediaStream] Allow host application to enable/disable media capture
2646         https://bugs.webkit.org/show_bug.cgi?id=171292
2647         <rdar://problem/31821492>
2648
2649         Reviewed by Jer Noble.
2650
2651         No new layout tests, added an API test instead.
2652
2653         * Modules/mediastream/MediaStream.cpp:
2654         (WebCore::MediaStream::endStream): New, stop all tracks.
2655         * Modules/mediastream/MediaStream.h:
2656
2657         * Modules/mediastream/MediaStreamRegistry.cpp:
2658         (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
2659         (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
2660         (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
2661         * Modules/mediastream/MediaStreamRegistry.h:
2662
2663         * Modules/mediastream/MediaStreamTrack.cpp:
2664         (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' 
2665         event should be sent or not.
2666         (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
2667         * Modules/mediastream/MediaStreamTrack.h:
2668
2669         * dom/Document.cpp:
2670         (WebCore::Document::stopMediaCapture): Stop all streams in the document.
2671         * dom/Document.h:
2672
2673         * page/Page.cpp:
2674         (WebCore::Page::stopMediaCapture): Stop all streams.
2675         * page/Page.h:
2676
2677         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2678         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
2679         when the stream ends.
2680         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
2681         change to HTMLMediaElement refresh state.
2682         * platform/mediastream/MediaStreamPrivate.h:
2683
2684         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2685         (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't 
2686         running, we always need to clear m_session on iOS.
2687
2688 2017-05-03  Zalan Bujtas  <zalan@apple.com>
2689
2690         SearchInputType could end up with a mismatched renderer.
2691         https://bugs.webkit.org/show_bug.cgi?id=171547
2692         <rdar://problem/31935047>
2693
2694         Reviewed by Antti Koivisto.
2695
2696         Normally we've got the correct renderer by the time we call into SearchInputType.
2697         However, since HTMLInputElement::updateType() eagerly updates the type while the associated renderers are done lazily
2698         (so we don't get them updated until after the next tree update), we could actually end up
2699         with a mismatched renderer (e.g. through form submission).
2700
2701         Test: fast/forms/change-input-type-and-submit-form-crash.html
2702
2703         * html/SearchInputType.cpp:
2704         (WebCore::SearchInputType::addSearchResult):
2705         (WebCore::SearchInputType::didSetValueByUserEdit):
2706
2707 2017-05-03  Jer Noble  <jer.noble@apple.com>
2708
2709         Make the VPIO audio unit a singleton, shared between multiple CaptureSources
2710         https://bugs.webkit.org/show_bug.cgi?id=171622
2711
2712         Reviewed by Eric Carlson.
2713
2714         Move the implemnetation of CoreAudioCaptureSource into a shared singleton class, CoreAudioSharedUnit,
2715         which will send audio to each of it's client CoreAudioCaptureSources. The first registered client will
2716         define the settings used by the shared unit.
2717
2718         Drive-by fixes: Fix up setUseAVFoundationAudioCapture() to always accept the first value set.
2719
2720         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2721         (WebCore::CoreAudioSharedUnit::isProducingData):
2722         (WebCore::CoreAudioSharedUnit::microphoneFormat):
2723         (WebCore::CoreAudioSharedUnit::singleton):
2724         (WebCore::CoreAudioSharedUnit::addClient):
2725         (WebCore::CoreAudioSharedUnit::removeClient):
2726         (WebCore::CoreAudioSharedUnit::addEchoCancellationSource):
2727         (WebCore::CoreAudioSharedUnit::removeEchoCancellationSource):
2728         (WebCore::CoreAudioSharedUnit::preferredIOBufferSize):
2729         (WebCore::CoreAudioSharedUnit::setupAudioUnits):
2730         (WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
2731         (WebCore::CoreAudioSharedUnit::configureSpeakerProc):
2732         (WebCore::CoreAudioSharedUnit::checkTimestamps):
2733         (WebCore::CoreAudioSharedUnit::provideSpeakerData):
2734         (WebCore::CoreAudioSharedUnit::speakerCallback):
2735         (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
2736         (WebCore::CoreAudioSharedUnit::microphoneCallback):
2737         (WebCore::CoreAudioSharedUnit::cleanupAudioUnits):
2738         (WebCore::CoreAudioSharedUnit::startProducingData):
2739         (WebCore::CoreAudioSharedUnit::stopProducingData):
2740         (WebCore::CoreAudioSharedUnit::suspend):
2741         (WebCore::CoreAudioSharedUnit::defaultInputDevice):
2742         (WebCore::CoreAudioCaptureSource::create):
2743         (WebCore::CoreAudioCaptureSource::factory):
2744         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2745         (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
2746         (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
2747         (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
2748         (WebCore::CoreAudioCaptureSource::startProducingData):
2749         (WebCore::CoreAudioCaptureSource::stopProducingData):
2750         (WebCore::CoreAudioCaptureSource::audioSourceProvider):
2751         (WebCore::CoreAudioCaptureSource::preferredSampleRate): Deleted.
2752         (WebCore::CoreAudioCaptureSource::preferredIOBufferSize): Deleted.
2753         (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Deleted.
2754         (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Deleted.
2755         (WebCore::CoreAudioCaptureSource::checkTimestamps): Deleted.
2756         (WebCore::CoreAudioCaptureSource::provideSpeakerData): Deleted.
2757         (WebCore::CoreAudioCaptureSource::speakerCallback): Deleted.
2758         (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Deleted.
2759         (WebCore::CoreAudioCaptureSource::microphoneCallback): Deleted.
2760         (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted.
2761         (WebCore::CoreAudioCaptureSource::defaultInputDevice): Deleted.
2762         (WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted.
2763         (WebCore::CoreAudioCaptureSource::suspend): Deleted.
2764         (WebCore::CoreAudioCaptureSource::resume): Deleted.
2765         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2766         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2767         (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):
2768
2769 2017-05-03  Jer Noble  <jer.noble@apple.com>
2770
2771         getUserMedia() fails because devices list is empty / inactive
2772         https://bugs.webkit.org/show_bug.cgi?id=171626
2773
2774         Reviewed by Eric Carlson.
2775
2776         When creating a AVAudioSessionCaptureDevice, set the device's enabled state to true if the port description
2777         has any items in its dataSources property (which is the best analogue to "isActive" we have in AVAudioSession).
2778
2779         Also, when creating the generic list of CaptureDevices, use the copy constructor to ensure the enabled state
2780         gets copied to the new generic device.
2781
2782         * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
2783         (WebCore::AVAudioSessionCaptureDevice::create):
2784         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
2785         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
2786
2787 2017-05-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2788
2789         Implement the imageready event to reliably test the async image decoding
2790         https://bugs.webkit.org/show_bug.cgi?id=171016
2791
2792         Reviewed by Simon Fraser.
2793
2794         The event will be fired for each client of the image. Firing the event
2795         will happen after finishing the decoding and repainting the client.
2796
2797         Existing tests will be modified in a separate patch to use this event.
2798
2799         * dom/Element.cpp:
2800         (WebCore::Element::dispatchWebKitImageReadyEventForTesting):
2801         * dom/Element.h:
2802         * page/Settings.in:
2803         * rendering/RenderElement.cpp:
2804         (WebCore::RenderElement::imageFrameAvailable):
2805
2806 2017-05-03  Tim Horton  <timothy_horton@apple.com>
2807
2808         Maintain interaction information URL as a URL, not a string
2809         https://bugs.webkit.org/show_bug.cgi?id=171623
2810
2811         Reviewed by Simon Fraser.
2812
2813         No new tests, not a behavior change.
2814
2815         * platform/URL.h:
2816
2817 2017-05-03  Yoav Weiss  <yoav@yoav.ws>
2818
2819         Link preload HTMLPreloadScanner support
2820         https://bugs.webkit.org/show_bug.cgi?id=170747
2821
2822         Reviewed by Youenn Fablet.
2823
2824         Test: http/tests/preload/preloadscanner_download_resources.html
2825
2826         * html/parser/HTMLPreloadScanner.cpp:
2827         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Initialize link preload flag.
2828         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Create a request only if the type is known (so ignore
2829         preloads with unknown type).
2830         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Add handling for link preload and the `as` attribute.
2831         (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet): Get LinkRelAttribute as input.
2832         (WebCore::TokenPreloadScanner::StartTagScanner::resourceType): Return an std::optional, in case the preload type is unknown.
2833         (WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload): Return true for the link preload case.
2834         * loader/cache/CachedResourceLoader.cpp:
2835         (WebCore::CachedResourceLoader::preload): Return the resource rather than a nullptr if it's already in m_preloads.
2836
2837 2017-05-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2838
2839         YouTube user agent quirk breaks new YouTube
2840         https://bugs.webkit.org/show_bug.cgi?id=171603
2841
2842         Reviewed by Carlos Garcia Campos.
2843
2844         Our user agent quirk to make YouTube 360 work breaks the new YouTube UI, causing it to
2845         attempt to use the obsolete custom elements v0 API. WebKit only supports the v1 API. We
2846         have to remove this quirk.
2847
2848         Note this does not affect Safari as Apple ports don't use our user agent quirks.
2849
2850         * platform/UserAgentQuirks.cpp:
2851         (WebCore::urlRequiresChromeBrowser):
2852
2853 2017-05-03  Joseph Pecoraro  <pecoraro@apple.com>
2854
2855         Web Inspector: 404 Image Load does not appear as a failure in Web Inspector
2856         https://bugs.webkit.org/show_bug.cgi?id=171587
2857         <rdar://problem/13222846>
2858
2859         Reviewed by Matt Baker.
2860
2861         * inspector/InspectorPageAgent.h:
2862         * inspector/InspectorPageAgent.cpp:
2863         (WebCore::InspectorPageAgent::cachedResourceContent):
2864         (WebCore::prepareCachedResourceBuffer): Deleted.
2865         Inline the function to make this less confusing.
2866
2867         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
2868         Treat a DecodeError as a failure.
2869
2870 2017-05-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2871
2872         Async image decoding should be disabled for snapshots, printing and preview
2873         https://bugs.webkit.org/show_bug.cgi?id=171467
2874  
2875         Reviewed by Simon Fraser.
2876  
2877         Asynchronous image decoding should only be used for window display where
2878         RenderElements can be repainted and painted. For cases where there is only
2879         one chance to draw the image, synchronous decoding should be used. 
2880
2881         * rendering/RenderBoxModelObject.cpp:
2882         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2883         * rendering/RenderImage.cpp:
2884         (WebCore::RenderImage::paintIntoRect):
2885
2886 2017-05-03  Nan Wang  <n_wang@apple.com>
2887
2888         AX: VO skips cells after cell with aria-colspan
2889         https://bugs.webkit.org/show_bug.cgi?id=171579
2890
2891         Reviewed by Chris Fleizach.
2892
2893         We should consider the previous cells' column span value when
2894         calculating the column index.
2895
2896         Test: accessibility/mac/aria-grid-column-span.html
2897
2898         * accessibility/AccessibilityARIAGridCell.cpp:
2899         (WebCore::AccessibilityARIAGridCell::columnIndexRange):
2900
2901 2017-05-03  Jiewen Tan  <jiewen_tan@apple.com>
2902
2903         ASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest crypto/workers/crypto-random-values-limits-worker.html
2904         https://bugs.webkit.org/show_bug.cgi?id=171462
2905         <rdar://problem/31906859>
2906
2907         Reviewed by Brent Fulgham.
2908
2909         Covered by existing tests.
2910
2911         * workers/WorkerGlobalScope.cpp:
2912         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
2913         Clear Crypto early in destruction since its ContextDestructionObserver
2914         destruction makes checks about the WorkerThread.
2915
2916 2017-05-03  Zalan Bujtas  <zalan@apple.com>
2917
2918         RenderSearchField should not use isTextField() in SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT
2919         https://bugs.webkit.org/show_bug.cgi?id=171608
2920
2921         Reviewed by Simon Fraser.
2922
2923         isTextField() is true for any generic single line text control.
2924
2925         * rendering/RenderObject.h:
2926         (WebCore::RenderObject::isSearchField):
2927         * rendering/RenderSearchField.h:
2928
2929 2017-05-03  Frederic Wang  <fwang@igalia.com>
2930
2931         Remove ScrollingCoordinator::supportsFixedPositionLayers()
2932         https://bugs.webkit.org/show_bug.cgi?id=171557
2933
2934         Reviewed by Simon Fraser.
2935
2936         No new tests, behavior is not changed.
2937
2938         * page/FrameView.cpp:
2939         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
2940         * page/scrolling/AsyncScrollingCoordinator.cpp:
2941         (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
2942         * page/scrolling/AsyncScrollingCoordinator.h:
2943         * page/scrolling/ScrollingCoordinator.cpp:
2944         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
2945         * page/scrolling/ScrollingCoordinator.h:
2946         (WebCore::ScrollingCoordinator::supportsFixedPositionLayers): Deleted.
2947         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2948         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
2949         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
2950         (): Deleted.
2951         * rendering/RenderLayerCompositor.cpp:
2952         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2953
2954 2017-05-03  Chris Dumez  <cdumez@apple.com>
2955
2956         Use PassRefPtr less in CompositeEditCommand
2957         https://bugs.webkit.org/show_bug.cgi?id=171590
2958
2959         Reviewed by Sam Weinig.
2960
2961         Use PassRefPtr less in CompositeEditCommand.
2962
2963         * CMakeLists.txt:
2964         * WebCore.xcodeproj/project.pbxproj:
2965         * editing/ApplyStyleCommand.cpp:
2966         (WebCore::hasNoAttributeOrOnlyStyleAttribute):
2967         (WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
2968         (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
2969         (WebCore::isEmptyFontTag):
2970         (WebCore::ApplyStyleCommand::doApply):
2971         (WebCore::ApplyStyleCommand::applyBlockStyle):
2972         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
2973         (WebCore::dummySpanAncestorForNode):
2974         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
2975         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
2976         (WebCore::ApplyStyleCommand::applyInlineStyle):
2977         (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
2978         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
2979         (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
2980         (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
2981         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
2982         (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
2983         (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
2984         (WebCore::ApplyStyleCommand::removeCSSStyle):
2985         (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
2986         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
2987         (WebCore::ApplyStyleCommand::removeInlineStyle):
2988         (WebCore::ApplyStyleCommand::shouldSplitTextElement):
2989         (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
2990         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
2991         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
2992         (WebCore::ApplyStyleCommand::addBlockStyle):
2993         (WebCore::ApplyStyleCommand::joinChildTextNodes):
2994         * editing/ApplyStyleCommand.h:
2995         (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
2996         * editing/CompositeEditCommand.cpp:
2997         (WebCore::CompositeEditCommand::removeChildrenInRange):
2998         (WebCore::CompositeEditCommand::mergeIdenticalElements):
2999         (WebCore::CompositeEditCommand::insertTextIntoNode):
3000         (WebCore::CompositeEditCommand::deleteTextFromNode):
3001         (WebCore::CompositeEditCommand::replaceTextInNode):
3002         (WebCore::CompositeEditCommand::replaceSelectedTextInNode):
3003         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
3004         (WebCore::CompositeEditCommand::removeNodeAttribute):
3005         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
3006         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
3007         (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
3008         (WebCore::CompositeEditCommand::deleteInsignificantText):
3009         (WebCore::CompositeEditCommand::removePlaceholderAt):
3010         (WebCore::CompositeEditCommand::cleanupAfterDeletion):
3011         (WebCore::CompositeEditCommand::moveParagraphs):
3012         * editing/CompositeEditCommand.h:
3013         * editing/DeleteFromTextNodeCommand.cpp:
3014         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
3015         (WebCore::DeleteFromTextNodeCommand::doApply):
3016         (WebCore::DeleteFromTextNodeCommand::doUnapply):
3017         (WebCore::DeleteFromTextNodeCommand::getNodesInCommand):
3018         * editing/DeleteFromTextNodeCommand.h:
3019         (WebCore::DeleteFromTextNodeCommand::create):
3020         * editing/DeleteSelectionCommand.cpp:
3021         (WebCore::DeleteSelectionCommand::deleteTextFromNode):
3022         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
3023         (WebCore::DeleteSelectionCommand::fixupWhitespace):
3024         * editing/DeleteSelectionCommand.h:
3025         * editing/EditingAllInOne.cpp:
3026         * editing/EditingStyle.cpp:
3027         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
3028         (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl):
3029         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
3030         (WebCore::EditingStyle::wrappingStyleForSerialization):
3031         (WebCore::styleFromMatchedRulesForElement):
3032         (WebCore::EditingStyle::mergeStyleFromRules):
3033         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
3034         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
3035         (WebCore::EditingStyle::removePropertiesInElementDefaultStyle):
3036         * editing/EditingStyle.h:
3037         * editing/IndentOutdentCommand.cpp:
3038         (WebCore::IndentOutdentCommand::tryIndentingAsListItem):
3039         * editing/InsertIntoTextNodeCommand.cpp:
3040         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
3041         (WebCore::InsertIntoTextNodeCommand::getNodesInCommand):
3042         * editing/InsertIntoTextNodeCommand.h:
3043         (WebCore::InsertIntoTextNodeCommand::create):
3044         * editing/InsertLineBreakCommand.cpp:
3045         (WebCore::InsertLineBreakCommand::doApply):
3046         * editing/InsertListCommand.cpp:
3047         (WebCore::InsertListCommand::mergeWithNeighboringLists):
3048         (WebCore::InsertListCommand::listifyParagraph):
3049         * editing/InsertParagraphSeparatorCommand.cpp:
3050         (WebCore::InsertParagraphSeparatorCommand::doApply):
3051         * editing/InsertTextCommand.cpp:
3052         (WebCore::InsertTextCommand::performOverwrite):
3053         (WebCore::InsertTextCommand::doApply):
3054         (WebCore::InsertTextCommand::insertTab):
3055         * editing/MergeIdenticalElementsCommand.cpp:
3056         (WebCore::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
3057         (WebCore::MergeIdenticalElementsCommand::doApply):
3058         (WebCore::MergeIdenticalElementsCommand::doUnapply):
3059         (WebCore::MergeIdenticalElementsCommand::getNodesInCommand):
3060         * editing/MergeIdenticalElementsCommand.h:
3061         (WebCore::MergeIdenticalElementsCommand::create):
3062         * editing/RemoveCSSPropertyCommand.cpp: Removed.
3063         * editing/RemoveCSSPropertyCommand.h: Removed.
3064         * editing/ReplaceSelectionCommand.cpp:
3065         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
3066         (WebCore::ReplaceSelectionCommand::doApply):
3067         (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
3068         (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
3069         * editing/markup.cpp:
3070         (WebCore::StyledMarkupAccumulator::appendElement):
3071         (WebCore::styleFromMatchedRulesAndInlineDecl):
3072         (WebCore::createMarkupInternal):
3073
3074 2017-05-03  Joanmarie Diggs  <jdiggs@igalia.com>
3075
3076         AX: Treat cells with ARIA table cell properties as cells
3077         https://bugs.webkit.org/show_bug.cgi?id=171178
3078
3079         Reviewed by Chris Fleizach.
3080
3081         Add the following checks to heuristics in AccessibilityTable::isDataTable():
3082         1. If the author has provided a valid aria-rowcount or aria-colcount value on
3083            the table element, expose it as a data table.
3084         2. If the author has provided a valid aria-colindex or aria-rowindex on the
3085            cell element, expose it as a data table.
3086         3. If the author has provided a valid aria-rowindex on the row element, expose
3087            it as a data table.
3088         4. If the author has provided a value for aria-colspan or aria-rowspan on a cell,
3089            expose it as a data table (even though we are supposed to ignore the value for
3090            the purpose of exposing the span via platform accessibility APIs)
3091
3092         Remove the heuristic that a table with only one cell is "not a good AXTable candidate."
3093         It prevents us from ever doing the above checks.
3094
3095         Test: accessibility/minimal-table-with-aria-is-data-table.html
3096
3097         * accessibility/AccessibilityTable.cpp:
3098         (WebCore::AccessibilityTable::isDataTable):
3099
3100 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3101
3102         [Cairo] Handle extended colors in gradients
3103         https://bugs.webkit.org/show_bug.cgi?id=171596
3104
3105         Reviewed by Michael Catanzaro.
3106
3107         Check if every gradient color step is an extended color and use asExtended() instead of getRGBA() in such case.
3108
3109         Fixes: css3/color/gradients.html
3110
3111         * platform/graphics/cairo/GradientCairo.cpp:
3112         (WebCore::Gradient::platformGradient):
3113
3114 2017-05-03  Daniel Bates  <dabates@apple.com>
3115
3116         Abandon the current load once the provisional loader detaches from the frame
3117         https://bugs.webkit.org/show_bug.cgi?id=171577
3118         <rdar://problem/31581227>
3119
3120         Reviewed by Brent Fulgham and Brady Eidson.
3121
3122         We detach all child frames as part of setting our document loader to the provisional
3123         document loader when committing a load for a frame. Detaching child frames invokes
3124         the unload event handler on the child frames that can run arbitrary JavaScript script.
3125         Among other things, such script can initiate a new load in the frame whose current
3126         load is being committed. We should stop processing the current load as soon as we
3127         detect that updating our document loader has started a new provisional load.
3128
3129         Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash.html
3130
3131         * loader/FrameLoader.cpp:
3132         (WebCore::FrameLoader::transitionToCommitted):
3133
3134 2017-05-03  Daniel Bates  <dabates@apple.com>
3135
3136         Cleanup: Remove out-of-date comment and null check from DocumentLoader::detachFromFrame()
3137         https://bugs.webkit.org/show_bug.cgi?id=171604
3138
3139         Reviewed by Brady Eidson.
3140
3141         We no longer want to passively allow DocumentLoader::detachFromFrame() to be called twice.
3142         It does not make sense to be called twice and should never be called twice. A release assert
3143         in DocumentLoader::cancelPolicyCheckIfNeeded() (added in r187558) called by DocumentLoader::detachFromFrame()
3144         enforces this invariant. Therefore we can remove the null check of DocumentLoader::m_frame
3145         and the comment that explains the purpose of this null check from DocumentLoader::detachFromFrame().
3146
3147         * loader/DocumentLoader.cpp:
3148         (WebCore::DocumentLoader::detachFromFrame):
3149
3150 2017-05-03  Ryan Haddad  <ryanhaddad@apple.com>
3151
3152         Unreviewed attempt to fix the Windows build after r216117.
3153         https://bugs.webkit.org/show_bug.cgi?id=171601
3154
3155         * css/CSSAllInOne.cpp:
3156
3157 2017-05-03  Antti Koivisto  <antti@apple.com>
3158
3159         Rename StyleInvalidationAnalysis to Style::Invalidator
3160         https://bugs.webkit.org/show_bug.cgi?id=171601
3161
3162         Reviewed by Žan Doberšek.
3163
3164         Also move it to the 'style' directory.
3165
3166         * CMakeLists.txt:
3167         * WebCore.xcodeproj/project.pbxproj:
3168         * css/StyleInvalidationAnalysis.cpp: Removed.
3169         * css/StyleInvalidationAnalysis.h: Removed.
3170         * dom/ExtensionStyleSheets.cpp:
3171         * style/AttributeChangeInvalidation.cpp:
3172         (WebCore::Style::AttributeChangeInvalidation::invalidateDescendants):
3173         * style/ClassChangeInvalidation.cpp:
3174         (WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle):
3175         * style/StyleInvalidator.cpp: Copied from Source/WebCore/css/StyleInvalidationAnalysis.cpp.
3176         (WebCore::Style::Invalidator::Invalidator):
3177         (WebCore::Style::Invalidator::invalidateIfNeeded):
3178         (WebCore::Style::Invalidator::invalidateStyleForTree):
3179         (WebCore::Style::Invalidator::invalidateStyle):
3180         (WebCore::shouldDirtyAllStyle): Deleted.
3181         (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis): Deleted.
3182         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded): Deleted.
3183         (WebCore::StyleInvalidationAnalysis::invalidateStyleForTree): Deleted.
3184         (WebCore::StyleInvalidationAnalysis::invalidateStyle): Deleted.
3185         * style/StyleInvalidator.h: Copied from Source/WebCore/css/StyleInvalidationAnalysis.h.
3186         (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle): Deleted.
3187         (WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet): Deleted.
3188         * style/StyleScope.cpp:
3189         (WebCore::Style::Scope::resolver):
3190         (WebCore::Style::Scope::analyzeStyleSheetChange):
3191
3192 2017-05-02  Andrew Gold  <agold@apple.com>
3193
3194         Typo in AVAudioSessionCaptureDeviceManager.mm
3195         https://bugs.webkit.org/show_bug.cgi?id=171572
3196
3197         Reviewed by Jer Noble.
3198
3199         We attempt to call +[AVAudioSession sharedSession], but the actual method is 
3200         called +[AVAudioSession sharedInstance].
3201
3202         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
3203         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
3204
3205 2017-05-02  Simon Fraser  <simon.fraser@apple.com>
3206
3207         Improve scrolling tree logging
3208         https://bugs.webkit.org/show_bug.cgi?id=171574
3209
3210         Reviewed by Tim Horton.
3211
3212         Make a call to showScrollingStateTree() print debugging-related information like node and layer IDs.
3213         Required fixing scrolling state tree nodes to respect ScrollingStateTreeAsTextBehavior, and fixing
3214         fixed and sticky nodes to call super.
3215
3216         Also enhance compositing logging to show layer IDs, and to log for layer scrolling tree registration.
3217
3218         * page/scrolling/AsyncScrollingCoordinator.cpp:
3219         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
3220         * page/scrolling/AsyncScrollingCoordinator.h:
3221         * page/scrolling/ScrollingCoordinator.cpp:
3222         (WebCore::ScrollingCoordinator::scrollingStateTreeAsText):
3223         * page/scrolling/ScrollingCoordinator.h:
3224         * page/scrolling/ScrollingStateFixedNode.cpp:
3225         (WebCore::ScrollingStateFixedNode::dumpProperties):
3226         * page/scrolling/ScrollingStateNode.cpp:
3227         (WebCore::ScrollingStateNode::dumpProperties):
3228         (WebCore::ScrollingStateNode::scrollingStateTreeAsText):
3229         * page/scrolling/ScrollingStateNode.h:
3230         * page/scrolling/ScrollingStateScrollingNode.cpp:
3231         (WebCore::ScrollingStateScrollingNode::dumpProperties):
3232         * page/scrolling/ScrollingStateStickyNode.cpp:
3233         (WebCore::ScrollingStateStickyNode::dumpProperties):
3234         * page/scrolling/ScrollingStateTree.cpp:
3235         (showScrollingStateTree):
3236         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
3237         (WebCore::ScrollingCoordinatorMac::commitTreeState):
3238         * rendering/RenderLayerBacking.cpp:
3239         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
3240         * rendering/RenderLayerCompositor.cpp:
3241         (WebCore::RenderLayerCompositor::logLayerInfo):
3242         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3243
3244 2017-05-02  Daniel Bates  <dabates@apple.com>
3245
3246         Using StringView.split() instead of String.split() in some places
3247         https://bugs.webkit.org/show_bug.cgi?id=170925
3248
3249         Reviewed by Darin Adler and Sam Weinig.
3250
3251         Replace some uses of String.split() with StringView.split() (added in r211087) as the latter
3252         avoids the need to allocate an intermediary Vector of substrings. Instead StringView.split()
3253         returns an iterator for traversing the substrings.
3254
3255         No functionality changed. So, no new tests.
3256
3257         * accessibility/AccessibilityObject.cpp: Convert some typedefs to modern C++ using declarations.
3258         (WebCore::AccessibilityObject::ariaRoleToWebCoreRole): Modified code to use StringView.split().
3259         (WebCore::AccessibilityObject::elementsFromAttribute): Ditto.
3260         * dom/TreeScope.cpp:
3261         (WebCore::TreeScope::getElementById): Added.
3262         * dom/TreeScope.h:
3263         * html/LinkRelAttribute.cpp:
3264         (WebCore::LinkRelAttribute::LinkRelAttribute): Modified code to use StringView.split().
3265         * html/parser/XSSAuditor.cpp:
3266         (WebCore::semicolonSeparatedValueContainsJavaScriptURL): Ditto.
3267         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
3268         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Ditto.
3269         * platform/network/CacheValidation.cpp:
3270         (WebCore::collectVaryingRequestHeaders): Simplify code by using the String.split(UChar, Vector<String>&) overload.
3271         * svg/SVGAnimationElement.cpp:
3272         (WebCore::parseKeyTimes): Modified code to use StringView.split().
3273         * svg/SVGToOTFFontConversion.cpp:
3274         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Ditto.
3275         * testing/Internals.cpp:
3276         (WebCore::Internals::setMediaSessionRestrictions): Ditto.
3277         (WebCore::Internals::setMediaElementRestrictions): Ditto.
3278         (WebCore::Internals::setAudioContextRestrictions): Ditto.
3279         (WebCore::Internals::setPageMuted): Ditto.
3280         * testing/Internals.h:
3281
3282 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
3283
3284         [GTK] Drop coordinated surfaces from the compositing thread as soon as possible
3285         https://bugs.webkit.org/show_bug.cgi?id=171544
3286
3287         Reviewed by Žan Doberšek.
3288
3289         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3290         Remove atlasesToRemove from the GraphicsState. It is not a commit
3291         state anymore.
3292
3293 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
3294
3295         [GTK] Recycle textures while handling tiles
3296         https://bugs.webkit.org/show_bug.cgi?id=171541
3297
3298         Reviewed by Žan Doberšek.
3299
3300         * platform/graphics/texmap/TextureMapperTile.h:
3301         Modified m_texture as a protected member to avoid unnessary
3302         refcountings from the CoordinatedBackingStore.
3303         * platform/graphics/texmap/coordinated/CoordinatedSurface.h:
3304         Use reference instead of RefPtr to pass BitmapTexture
3305
3306         No new tests since there should be no change in behavior.
3307
3308 2017-05-02  Zalan Bujtas  <zalan@apple.com>
3309
3310         Defer AX cache update when text content changes until after layout is finished.
3311         https://bugs.webkit.org/show_bug.cgi?id=171429
3312         <rdar://problem/31885984>
3313
3314         Reviewed by Simon Fraser.
3315
3316         When the content of the RenderText changes (even as the result of a text-transform change)
3317         instead of updating the AX cache eagerly (and trigger layout on a half-backed render tree)
3318         we should just defer it until after the subsequent layout is done. 
3319
3320         Test: accessibility/crash-while-adding-text-child-with-transform.html
3321
3322         * accessibility/AXObjectCache.cpp:
3323         (WebCore::AXObjectCache::remove):
3324         (WebCore::AXObjectCache::performDeferredCacheUpdate):
3325         (WebCore::AXObjectCache::recomputeDeferredIsIgnored):
3326         (WebCore::AXObjectCache::deferTextChanged):
3327         (WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted.
3328         * accessibility/AXObjectCache.h:
3329         (WebCore::AXObjectCache::deferTextChanged):
3330         (WebCore::AXObjectCache::performDeferredCacheUpdate):
3331         (WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted.
3332         * page/FrameView.cpp:
3333         (WebCore::FrameView::performPostLayoutTasks):
3334         * rendering/RenderText.cpp:
3335         (WebCore::RenderText::setText):
3336
3337 2017-05-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3338
3339         Remove an extraneous call to dispatch_group_async in WebItemProviderPasteboard.mm
3340         https://bugs.webkit.org/show_bug.cgi?id=171561
3341
3342         Reviewed by Tim Horton.
3343
3344         In -[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:], the lifetime of the dispatch group
3345         `fileLoadingGroup` is already guarded by dispatch_group_enter/leave calls when beginning and concluding an
3346         item provider load, respectively. As such, the call to dispatch_group_async serves no purpose and should be removed.
3347
3348         No new tests, since there is no change in behavior.
3349
3350         * platform/ios/WebItemProviderPasteboard.mm:
3351         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
3352
3353 2017-05-02  Youenn Fablet  <youenn@apple.com>
3354
3355         [LibWebRTC] Set explicitly logging level in debug mode
3356         https://bugs.webkit.org/show_bug.cgi?id=171562
3357
3358         Reviewed by Eric Carlson.
3359
3360         No change of behavior.
3361
3362         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3363         (WebCore::initializePeerConnectionFactoryAndThreads): Setting explictly LibWebRTC logging to Info level for
3364         debug builds if WebRTC channel is on.
3365
3366 2017-05-02  Joanmarie Diggs  <jdiggs@igalia.com>
3367
3368         AX: Update implementation of aria-orientation
3369         https://bugs.webkit.org/show_bug.cgi?id=171166
3370
3371         Reviewed by Chris Fleizach.
3372
3373         Update AccessibilityRenderObject::orientation() to be consistent with what is
3374         in the ARIA 1.1 spec. Also add an isTreeGrid() convenience method to be consistent
3375         with what we do for other roles.
3376
3377         Test: accessibility/aria-orientation.html
3378
3379         * accessibility/AccessibilityARIAGridRow.cpp:
3380         (WebCore::AccessibilityARIAGridRow::isARIATreeGridRow):
3381         * accessibility/AccessibilityObject.h:
3382         (WebCore::AccessibilityObject::isTreeGrid):
3383         * accessibility/AccessibilityRenderObject.cpp:
3384         (WebCore::AccessibilityRenderObject::orientation):
3385
3386 2017-05-02  Myles C. Maxfield  <mmaxfield@apple.com>
3387
3388         REGRESSION (r211382): Partial right-to-left text runs are painted at an offset (breaks Find indicators, Look Up, and custom ::selection style)
3389         https://bugs.webkit.org/show_bug.cgi?id=169517
3390         <rdar://problem/30652443>
3391
3392         Reviewed by Dean Jackson.
3393
3394         FontCascade::getGlyphsAndAdvancesForComplexText() is tasked with calculating paint advances for a
3395         subrange of RTL text. It does this by creating a ComplexTextController, telling it to iterate to
3396         the beginning of the subrange (outputting to a GlyphBuffer), then telling it to iterate to the end
3397         of the subrange (outputting to another GlyphBuffer). Because the text is RTL, the sum of the
3398         advances gathered so far is the distance from the right edge of the text to the left edge of the
3399         subrange (because we advance in logical order). Therefore, the x-coordinate we are at now is the
3400         total width minus the sum of both of the GlyphBuffers. For some reason, when I wrote this code I
3401         forgot to add in the contribution from the first GlyphBuffer. Unfortunately, this particular
3402         codepath is rarely hit in practice and completely untested, which made me miss it when I wrote it.
3403
3404         Test: fast/text/complex-text-selection.html
3405
3406         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3407         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
3408
3409 2017-05-02  Chris Dumez  <cdumez@apple.com>
3410
3411         [macOS] Flaky Crash under EventTarget::fireEventListeners on imported/blink/paint/deprecatedpaintlayer/non-self-painting-layer-overrides-visibility.html
3412         https://bugs.webkit.org/show_bug.cgi?id=171406
3413         <rdar://problem/30945281>
3414
3415         Reviewed by Eric Carlson.
3416
3417         I was unfortunately unable to reproduce the flaky crash locally. However, the crash trace
3418         indicates that one of the EventTarget::scriptExecutionContext() overrides is returning a
3419         stale ScriptExecutionContext pointer. Since a GenericEventQueue is involved, the EventTarget
3420         is likely a media-related object. I therefore audited media classes that override
3421         EventTarget::scriptExecutionContext() and found several that look unsafe. I am fixing those
3422         by having them override ContextDestructionObserver, instead of having a raw
3423         ScriptExecutionContext pointer member. This makes sure the pointer gets nulled out whenever
3424         the scriptexecutioncontext gets destroyed, ensuring that those classes's
3425         EventTarget::scriptExecutionContext() overrides can never return a stale pointer.
3426
3427         * Modules/mediasource/SourceBufferList.cpp:
3428         (WebCore::SourceBufferList::SourceBufferList):
3429         * Modules/mediasource/SourceBufferList.h:
3430         * html/track/TextTrack.cpp:
3431         (WebCore::TextTrack::TextTrack):
3432         * html/track/TextTrack.h:
3433         * html/track/TrackListBase.cpp:
3434         (TrackListBase::TrackListBase):
3435         * html/track/TrackListBase.h:
3436
3437 2017-05-02  Antti Koivisto  <antti@apple.com>
3438
3439         Document style resolvers should share user rulesets
3440         https://bugs.webkit.org/show_bug.cgi?id=171549
3441
3442         Reviewed by Andreas Kling.