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