Add an argument indicating the type of insertion to Node::insertedInto
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-17  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Add an argument indicating the type of insertion to Node::insertedInto
4         https://bugs.webkit.org/show_bug.cgi?id=178431
5
6         Reviewed by Antti Koivisto.
7
8         Added InsertionType as the first argument to Node::insertedInto, which contains two booleans indicating
9         whether the node just become newly connected to a document, and whether node's tree scope had changed or not.
10
11         These boolean flags simplifie the logic in insertedInto implementations, and are required to have a better
12         guarantee about the correctness of node flags during calls to insertedInto. Right now, isConnected() and
13         isInShadowTree() are both outdated until Node::insertedInto is called.
14
15         Also renamed the second argument from insertionPoint to parentOfInsertedTree to make the semantics clear,
16         and renamed finishedInsertingSubtree to didFinishInsertingNode, and renamed InsertionNotificationRequest
17         to InsertedIntoResult using enum class.
18
19         Note that in some implementations of insertedInto, we check whether isConnected() was false to decide whether
20         the node is newly connected to a document. This extra check is no longer necessary since no node will be inserted
21         into a document without first being completely removed after r223458.
22
23         No new tests since there should be no behavioral changes.
24
25         * dom/ContainerNode.cpp:
26         (WebCore::ContainerNode::notifyChildInserted):
27         * dom/ContainerNodeAlgorithms.cpp:
28         (WebCore::notifyNodeInsertedIntoDocument): Replaced the check that the node had not been disconnected by scripts
29         by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
30         (WebCore::notifyNodeInsertedIntoTree): Removed NoEventDispatchAssertion since notifyChildNodeInserted has it
31         already since r223458.
32         (WebCore::notifyChildNodeInserted): Made this function return NodeVector (copy elision).
33         * dom/ContainerNodeAlgorithms.h:
34         * dom/Element.cpp:
35         (WebCore::Element::insertedInto): Use insertionType.connectedToDocument to detect when this element had become
36         connected to some document. Similarly, use insertionType.treeScopeChanged to detect when this element had been
37         inserted into a new tree scope. Removed the comment which became obsolete due to this cleanup.
38         (WebCore::Element::addShadowRoot): Simplified the code here since we never attach a ShadowRoot with children.
39         * dom/Element.h:
40         * dom/Node.cpp:
41         (WebCore::Node::insertedInto):
42         * dom/Node.h:
43         (WebCore::Node::InsertedIntoResult): Renamed from InsertionNotificationRequest, and turned into an enum class.
44         (WebCore::Node::InsertionType): Added. We pass this object by value to insertedInto as a performance optimization
45         as passing two booleans by value is faster than passing a pointer and then de-referencing it in a virtual callee.
46         (WebCore::Node::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
47         * dom/ProcessingInstruction.cpp:
48         (WebCore::ProcessingInstruction::insertedInto):
49         (WebCore::ProcessingInstruction::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
50         * dom/ProcessingInstruction.h:
51         * dom/ScriptElement.cpp:
52         (WebCore::ScriptElement::shouldCallFinishedInsertingSubtree): Deleted.
53         (WebCore::ScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
54         * dom/ScriptElement.h:
55         (WebCore::ScriptElement::insertedInto const): Added. Extracted from shouldCallFinishedInsertingSubtree.
56         * dom/ShadowRoot.cpp:
57         (WebCore::ShadowRoot::insertedInto): The extra isConnected() check is no longer needed. See the description above.
58         * dom/ShadowRoot.h:
59         * html/FormAssociatedElement.cpp:
60         (WebCore::FormAssociatedElement::insertedInto):
61         * html/FormAssociatedElement.h:
62         * html/HTMLBaseElement.cpp:
63         (WebCore::HTMLBaseElement::insertedInto):
64         * html/HTMLBaseElement.h:
65         * html/HTMLBodyElement.cpp:
66         (WebCore::HTMLBodyElement::insertedInto):
67         (WebCore::HTMLBodyElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
68         * html/HTMLBodyElement.h:
69         * html/HTMLFormControlElement.cpp:
70         (WebCore::HTMLFormControlElement::insertedInto):
71         (WebCore::HTMLFormControlElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
72         * html/HTMLFormControlElement.h:
73         * html/HTMLFormControlElementWithState.cpp:
74         (WebCore::HTMLFormControlElementWithState::insertedInto):
75         * html/HTMLFormControlElementWithState.h:
76         * html/HTMLFormElement.cpp:
77         (WebCore::HTMLFormElement::insertedInto):
78         * html/HTMLFormElement.h:
79         * html/HTMLFrameElementBase.cpp:
80         (WebCore::HTMLFrameElementBase::insertedInto):
81         (WebCore::HTMLFrameElementBase::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
82         * html/HTMLFrameElementBase.h:
83         * html/HTMLFrameSetElement.cpp:
84         (WebCore::HTMLFrameSetElement::insertedInto):
85         * html/HTMLFrameSetElement.h:
86         * html/HTMLImageElement.cpp:
87         (WebCore::HTMLImageElement::insertedInto):
88         * html/HTMLImageElement.h:
89         * html/HTMLInputElement.cpp:
90         (WebCore::HTMLInputElement::insertedInto):
91         (WebCore::HTMLInputElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
92         * html/HTMLInputElement.h:
93         * html/HTMLLinkElement.cpp:
94         (WebCore::HTMLLinkElement::insertedInto): The extra isConnected() check is no longer needed. See above.
95         (WebCore::HTMLLinkElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
96         * html/HTMLLinkElement.h:
97         * html/HTMLMapElement.cpp:
98         (WebCore::HTMLMapElement::insertedInto):
99         * html/HTMLMapElement.h:
100         * html/HTMLMediaElement.cpp:
101         (WebCore::HTMLMediaElement::insertedInto):
102         (WebCore::HTMLMediaElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
103         * html/HTMLMediaElement.h:
104         * html/HTMLMetaElement.cpp:
105         (WebCore::HTMLMetaElement::insertedInto):
106         * html/HTMLMetaElement.h:
107         * html/HTMLObjectElement.cpp:
108         (WebCore::HTMLObjectElement::insertedInto):
109         (WebCore::HTMLObjectElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
110         * html/HTMLObjectElement.h:
111         * html/HTMLOptionElement.cpp:
112         (WebCore::HTMLOptionElement::insertedInto):
113         * html/HTMLOptionElement.h:
114         * html/HTMLScriptElement.cpp:
115         (WebCore::HTMLScriptElement::insertedInto):
116         (WebCore::HTMLScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
117         * html/HTMLScriptElement.h:
118         * html/HTMLSelectElement.cpp:
119         (WebCore::HTMLSelectElement::insertedInto):
120         * html/HTMLSelectElement.h:
121         * html/HTMLSlotElement.cpp:
122         (WebCore::HTMLSlotElement::insertedInto): Replaced a cumbersome condition by a boolean check on insertionType's
123         treeScopeChanged and removed the accompanying comment which is no longer needed.
124         * html/HTMLSlotElement.h:
125         * html/HTMLSourceElement.cpp:
126         (WebCore::HTMLSourceElement::insertedInto):
127         * html/HTMLSourceElement.h:
128         * html/HTMLStyleElement.cpp:
129         (WebCore::HTMLStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above.
130         * html/HTMLStyleElement.h:
131         * html/HTMLTextFormControlElement.cpp:
132         (WebCore::HTMLTextFormControlElement::insertedInto):
133         * html/HTMLTextFormControlElement.h:
134         * html/HTMLTitleElement.cpp:
135         (WebCore::HTMLTitleElement::insertedInto):
136         * html/HTMLTitleElement.h:
137         * html/HTMLTrackElement.cpp:
138         (WebCore::HTMLTrackElement::insertedInto): Added a FIXME since this code is clearly wrong.
139         * html/HTMLTrackElement.h:
140         * svg/SVGElement.cpp:
141         (WebCore::SVGElement::insertedInto):
142         * svg/SVGElement.h:
143         * svg/SVGFEImageElement.cpp:
144         (WebCore::SVGFEImageElement::insertedInto):
145         (WebCore::SVGFEImageElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
146         * svg/SVGFEImageElement.h:
147         * svg/SVGFontFaceElement.cpp:
148         (WebCore::SVGFontFaceElement::insertedInto):
149         * svg/SVGFontFaceElement.h:
150         * svg/SVGFontFaceUriElement.cpp:
151         (WebCore::SVGFontFaceUriElement::insertedInto):
152         * svg/SVGFontFaceUriElement.h:
153         * svg/SVGImageElement.cpp:
154         (WebCore::SVGImageElement::insertedInto):
155         * svg/SVGImageElement.h:
156         * svg/SVGMPathElement.cpp:
157         (WebCore::SVGMPathElement::insertedInto):
158         (WebCore::SVGMPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
159         * svg/SVGMPathElement.h:
160         * svg/SVGPathElement.cpp:
161         (WebCore::SVGPathElement::insertedInto):
162         * svg/SVGPathElement.h:
163         * svg/SVGSVGElement.cpp:
164         (WebCore::SVGSVGElement::insertedInto):
165         * svg/SVGSVGElement.h:
166         * svg/SVGScriptElement.cpp:
167         (WebCore::SVGScriptElement::insertedInto):
168         (WebCore::SVGScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
169         * svg/SVGScriptElement.h:
170         * svg/SVGStyleElement.cpp:
171         (WebCore::SVGStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above description.
172         * svg/SVGStyleElement.h:
173         * svg/SVGTRefElement.cpp:
174         (WebCore::SVGTRefElement::insertedInto):
175         (WebCore::SVGTRefElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
176         * svg/SVGTRefElement.h:
177         * svg/SVGTextPathElement.cpp:
178         (WebCore::SVGTextPathElement::insertedInto):
179         (WebCore::SVGTextPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
180         * svg/SVGTextPathElement.h:
181         * svg/SVGTitleElement.cpp:
182         (WebCore::SVGTitleElement::insertedInto):
183         * svg/SVGTitleElement.h:
184         * svg/SVGUseElement.cpp:
185         (WebCore::SVGUseElement::insertedInto):
186         * svg/SVGUseElement.h:
187         * svg/animation/SVGSMILElement.cpp:
188         (WebCore::SVGSMILElement::insertedInto):
189         (WebCore::SVGSMILElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
190         * svg/animation/SVGSMILElement.h:
191
192 2017-10-18  Eric Carlson  <eric.carlson@apple.com>
193
194         Key events should not update Document.lastHandledUserGestureTimestamp unless key event is handled
195         https://bugs.webkit.org/show_bug.cgi?id=178473
196         <rdar://problem/34869935>
197
198         Reviewed by Brent Fulgham.
199
200         No new tests, updated media/restricted-audio-playback-with-document-gesture.html for this change.
201
202         * page/EventHandler.cpp:
203         (WebCore::EventHandler::keyEvent): Restore the current Document's "lastHandledUserGestureTimestamp"
204         if the key event was not handled.
205
206 2017-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
207
208         Unreviewed, rolling out r223291.
209
210         After further investigation, this removed codepath is
211         something Mail may want to re-adopt. Additionally, the
212         original breaking change was rolled out in r223408, so
213         this test once again passes on ToT.
214
215         Reverted changeset:
216
217         "Remove Editor::simplifyMarkup"
218         https://bugs.webkit.org/show_bug.cgi?id=178271
219         https://trac.webkit.org/changeset/223291
220
221 2017-10-18  Sam Weinig  <sam@webkit.org>
222
223         [Settings] Move remaining simple settings to Settings.in
224         https://bugs.webkit.org/show_bug.cgi?id=177730
225         <rdar://problem/34763346>
226
227         Reviewed by Daniel Bates.
228
229         * Scripts/GenerateSettings/Settings.py:
230         (Setting.__init__):
231         (Setting.__str__):
232         (Setting.getterFunctionName):
233         (parseInput):
234
235             Add support for parsing the 'getter' option.
236
237         * page/Settings.in:
238         
239             Migrate simple settings from SettingsBase to here.
240         
241         * page/SettingsBase.cpp:
242         (WebCore::SettingsBase::SettingsBase):
243         (WebCore::SettingsBase::setJavaEnabled): Deleted.
244         (WebCore::SettingsBase::setJavaEnabledForLocalFiles): Deleted.
245         (WebCore::SettingsBase::setPreferMIMETypeForImages): Deleted.
246         (WebCore::SettingsBase::setForcePendingWebGLPolicy): Deleted.
247         (WebCore::SettingsBase::setNeedsAdobeFrameReloadingQuirk): Deleted.
248         (WebCore::SettingsBase::setFontRenderingMode): Deleted.
249         (WebCore::SettingsBase::fontRenderingMode const): Deleted.
250         (WebCore::SettingsBase::setShowTiledScrollingIndicator): Deleted.
251         (WebCore::SettingsBase::setFontFallbackPrefersPictographs): Deleted.
252         * page/SettingsBase.h:
253         (WebCore::SettingsBase::isJavaEnabled const): Deleted.
254         (WebCore::SettingsBase::isJavaEnabledForLocalFiles const): Deleted.
255         (WebCore::SettingsBase::preferMIMETypeForImages const): Deleted.
256         (WebCore::SettingsBase::needsAcrobatFrameReloadingQuirk const): Deleted.
257         (WebCore::SettingsBase::showTiledScrollingIndicator const): Deleted.
258         (WebCore::SettingsBase::setTouchEventEmulationEnabled): Deleted.
259         (WebCore::SettingsBase::isTouchEventEmulationEnabled const): Deleted.
260         (WebCore::SettingsBase::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
261         (WebCore::SettingsBase::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
262         (WebCore::SettingsBase::fontFallbackPrefersPictographs const): Deleted.
263         (WebCore::SettingsBase::setMediaKeysStorageDirectory): Deleted.
264         (WebCore::SettingsBase::mediaKeysStorageDirectory const): Deleted.
265         (WebCore::SettingsBase::setMediaDeviceIdentifierStorageDirectory): Deleted.
266         (WebCore::SettingsBase::mediaDeviceIdentifierStorageDirectory const): Deleted.
267         (WebCore::SettingsBase::applePayEnabled const): Deleted.
268         (WebCore::SettingsBase::setApplePayEnabled): Deleted.
269         (WebCore::SettingsBase::applePayCapabilityDisclosureAllowed const): Deleted.
270         (WebCore::SettingsBase::setApplePayCapabilityDisclosureAllowed): Deleted.
271         (WebCore::SettingsBase::isForcePendingWebGLPolicy const): Deleted.
272         
273             Remove simple settings.
274
275 2017-10-18  Zalan Bujtas  <zalan@apple.com>
276
277         [FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
278         https://bugs.webkit.org/show_bug.cgi?id=178477
279         <rdar://problem/35056478>
280
281         Reviewed by Simon Fraser.
282
283         No change in functionality.
284
285         * page/FrameView.cpp:
286         (WebCore::FrameView::markRootOrBodyRendererDirty const):
287         (WebCore::FrameView::layout):
288         * page/FrameView.h:
289
290 2017-10-18  Keith Miller  <keith_miller@apple.com>
291
292         Setup WebCore build to start using unified sources.
293         https://bugs.webkit.org/show_bug.cgi?id=178362
294
295         Reviewed by Tim Horton.
296
297         This patch adds all the long tooling needed to start adding
298         unified sources to WebCore. Most of the source list files
299         are empty to start but will be filled over the next few days.
300
301         I started by moving all the non-derived bindings code to
302         unified sources to make sure everything worked correctly.
303
304         * CMakeLists.txt:
305         * Configurations/GenerateUnifiedSources.xcconfig: Added.
306         * Configurations/WebCore.xcconfig:
307         * PlatformMac.cmake:
308         * Sources.txt: Added.
309         * SourcesCocoa.txt: Added.
310         * SourcesIOS.txt: Added.
311         * SourcesMac.txt: Added.
312         * WebCore.xcodeproj/project.pbxproj:
313         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Removed. No one seems to use this...
314
315 2017-10-18  Commit Queue  <commit-queue@webkit.org>
316
317         Unreviewed, rolling out r223321.
318         https://bugs.webkit.org/show_bug.cgi?id=178476
319
320         This protocol change broke some internal builds (Requested by
321         brrian__ on #webkit).
322
323         Reverted changeset:
324
325         "Web Inspector: provide a way to enable/disable event
326         listeners"
327         https://bugs.webkit.org/show_bug.cgi?id=177451
328         https://trac.webkit.org/changeset/223321
329
330 2017-10-18  Sam Weinig  <sam@webkit.org>
331
332         [Settings] Miscellaneous cleanup of the settings generation scripts
333         https://bugs.webkit.org/show_bug.cgi?id=178462
334
335         Reviewed by Daniel Bates.
336
337         - Stop generating and remove now unused SettingsMacros.h
338         - Make functions operating on the python Setting object member functions
339         - Add predicate to determine if a Setting's type is a value type, allowing
340           us to exclude those from using const references.
341
342         * CMakeLists.txt:
343         * DerivedSources.make:
344         * Scripts/GenerateSettings.py:
345         * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py:
346         * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py:
347         * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
348         * Scripts/GenerateSettings/GenerateSettings.py:
349         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
350         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
351         * Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
352         * Scripts/GenerateSettings/Settings.py:
353         * WebCoreMacros.cmake:
354         * WebCore.xcodeproj/project.pbxproj:
355
356 2017-10-18  Chris Dumez  <cdumez@apple.com>
357
358         Align ImageData constructor with the specification
359         https://bugs.webkit.org/show_bug.cgi?id=178406
360
361         Reviewed by Youenn Fablet.
362
363         Align ImageData constructor with the specification:
364         - https://html.spec.whatwg.org/multipage/canvas.html#dom-imagedata
365
366         It sometimes throws the wrong exception.
367
368         No new tests, rebaselined existing test.
369
370         * html/ImageData.cpp:
371         (WebCore::ImageData::create):
372         * html/ImageData.h:
373         * html/ImageData.idl:
374
375 2017-10-18  Chris Dumez  <cdumez@apple.com>
376
377         Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
378         https://bugs.webkit.org/show_bug.cgi?id=177876
379         <rdar://problem/34813129>
380
381         Reviewed by Ryosuke Niwa.
382
383         No new tests, updatdd existing test.
384
385         * dom/Document.h:
386         * testing/Internals.cpp:
387         (WebCore::Internals::hasServiceWorkerRegisteredForOrigin):
388         * testing/Internals.h:
389         * testing/Internals.idl:
390         * workers/service/ServiceWorkerProvider.h:
391         * workers/service/context/SWContextManager.cpp:
392         (WebCore::SWContextManager::startServiceWorkerContext):
393         * workers/service/server/SWClientConnection.h:
394         * workers/service/server/SWServer.cpp:
395         (WebCore::SWServer::Connection::scriptContextStarted):
396         (WebCore::SWServer::scriptContextStarted):
397         * workers/service/server/SWServer.h:
398         * workers/service/server/SWServerRegistration.cpp:
399         (WebCore::SWServerRegistration::scriptContextFailedToStart):
400         (WebCore::SWServerRegistration::scriptContextStarted):
401         * workers/service/server/SWServerRegistration.h:
402
403 2017-10-18  Sam Weinig  <sam@webkit.org>
404
405         [Settings] Replace macros in Settings.h/cpp with generated code
406         https://bugs.webkit.org/show_bug.cgi?id=178419
407
408         Reviewed by Antti Koivisto.
409
410         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
411         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
412
413             Rather than use macros in the generated Settings class, generate the code the macros
414             would expand to.
415
416 2017-10-18  Zalan Bujtas  <zalan@apple.com>
417
418         [FrameView::layout cleanup] Move frame flattening layout logic to a separate function
419         https://bugs.webkit.org/show_bug.cgi?id=178425
420         <rdar://problem/35045836>
421
422         Reviewed by Antti Koivisto.
423
424         No change in functionality.
425
426         * page/FrameView.cpp:
427         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
428         (WebCore::FrameView::layout):
429         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
430         * page/FrameView.h:
431
432 2017-10-18  Antti Koivisto  <antti@apple.com>
433
434         Resolve ::before and ::after pseudo elements during style resolution
435         https://bugs.webkit.org/show_bug.cgi?id=178339
436
437         Reviewed by Ryosuke Niwa.
438
439         They are currently resolved during render tree building which creates problems with display:contents and animations.
440
441         * dom/PseudoElement.cpp:
442         (WebCore::PseudoElement::PseudoElement):
443
444             Call InspectorInstrumentation from constructor.
445
446         * style/RenderTreeUpdater.cpp:
447         (WebCore::RenderTreeUpdater::Parent::Parent):
448         (WebCore::RenderTreeUpdater::updateRenderTree):
449         (WebCore::RenderTreeUpdater::pushParent):
450
451             Push the full update to the parent stack.
452
453         (WebCore::RenderTreeUpdater::popParent):
454         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
455         (WebCore::RenderTreeUpdater::updateAfterDescendants):
456         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
457         * style/RenderTreeUpdater.h:
458         * style/RenderTreeUpdaterGeneratedContent.cpp:
459         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
460
461             No need to resolve pseudo style, we have it already.
462
463         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
464         (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
465         (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
466         * style/RenderTreeUpdaterGeneratedContent.h:
467         * style/StyleTreeResolver.cpp:
468         (WebCore::Style::TreeResolver::resolveElement):
469         (WebCore::Style::TreeResolver::resolvePseudoStyle):
470
471             Resolve pseudos.
472
473         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
474
475             Make a private member function.
476
477         (WebCore::Style::TreeResolver::resolveComposedTree):
478         * style/StyleTreeResolver.h:
479         * style/StyleUpdate.cpp:
480         (WebCore::Style::Update::elementUpdates const):
481         (WebCore::Style::Update::elementUpdates):
482
483             Bundle the style update for an element and the associated before/after pseudos.
484
485         (WebCore::Style::Update::elementStyle const):
486         (WebCore::Style::Update::elementStyle):
487         (WebCore::Style::Update::addElement):
488         (WebCore::Style::Update::elementUpdate const): Deleted.
489         (WebCore::Style::Update::elementUpdate): Deleted.
490         * style/StyleUpdate.h:
491
492 2017-10-18  Ms2ger  <Ms2ger@igalia.com>
493
494         Update the signatures of texSubImage3D.
495         https://bugs.webkit.org/show_bug.cgi?id=178435
496
497         Reviewed by Sam Weinig.
498
499         Update the signatures of texSubImage3D.
500
501         No new tests: not much point in adding tests now; this method doesn't
502         do anything anyway.
503
504         * html/canvas/WebGL2RenderingContext.cpp:
505         (WebCore::WebGL2RenderingContext::texSubImage3D):
506         * html/canvas/WebGL2RenderingContext.h:
507         * html/canvas/WebGL2RenderingContext.idl:
508
509 2017-10-18  Fujii Hironori  <Hironori.Fujii@sony.com>
510
511         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
512         https://bugs.webkit.org/show_bug.cgi?id=175106
513
514         Reviewed by Yusuke Suzuki.
515
516         No new tests because there is no behavior change.
517
518         * css/CSSFontFaceSet.cpp:
519         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Call get() method of LazyNeverDestroyed.
520         * dom/make_names.pl: Use LazyNeverDestroyed for font names.
521
522 2017-10-18  Zan Dobersek  <zdobersek@igalia.com>
523
524         [MSE] Move SourceBuffer's pending append data into the platform implementations
525         https://bugs.webkit.org/show_bug.cgi?id=178003
526
527         Reviewed by Jer Noble.
528
529         In SourceBuffer::appendBufferTimerFired(), we can use move semantics to
530         pass the pending append data into the platform layer, where it can then
531         be used more efficiently.
532
533         Resources in the m_pendingAppendData member are moved into the append()
534         call on the SourceBufferPrivate object. The m_pendingAppendData is still
535         cleared out manually in case the underlying implementation doesn't clear
536         it out through a move operation. The SourceBufferPrivate interface is
537         updated to accept a Vector rvalue reference as the only parameter of the
538         append() method.
539
540         For the GStreamer implementation, signature of the append() method in
541         MediaSourceClientGStreamerMSE class is also updated. The implementation
542         now moves the Vector resources over to a on-heap Vector object that is
543         then wrapped into a GstBuffer object by using the
544         gst_buffer_new_wrapped_full() API and specifying the custom deleter.
545
546         The AVFoundation implementation of SourceBufferPrivate is only updated
547         to reflect the changes in the interface. The Vector data that is passed
548         in is still copied into the NSData allocation.
549
550         MockSourceBufferPrivate is also updated, with the append data still
551         being copied into the m_inputBuffer Vector.
552
553         No new tests -- no change in behavior.
554
555         * Modules/mediasource/SourceBuffer.cpp:
556         (WebCore::SourceBuffer::appendBufferTimerFired):
557         * platform/graphics/SourceBufferPrivate.h:
558         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
559         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
560         (WebCore::SourceBufferPrivateAVFObjC::append):
561         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
562         (WebCore::MediaSourceClientGStreamerMSE::append):
563         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
564         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
565         (WebCore::SourceBufferPrivateGStreamer::append):
566         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
567         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
568         (WebCore::MockSourceBufferPrivate::append):
569         * platform/mock/mediasource/MockSourceBufferPrivate.h:
570
571 2017-10-17  Zalan Bujtas  <zalan@apple.com>
572
573         [FrameView::layout cleanup] Remove redundant body->renderer()->setChildNeedsLayout() call
574         https://bugs.webkit.org/show_bug.cgi?id=178414
575         <rdar://problem/35040876>
576
577         Reviewed by Simon Fraser.
578
579         Since m_size always equals to layoutSize() at this point, we never call setChildNeedsLayout() on the body's renderer.
580         However a few lines below, when we adjust the frame size and check if oldSize != m_size, we actually
581         dirty the body's renderer.
582
583         Covered by existing tests.
584
585         * page/FrameView.cpp:
586         (WebCore::FrameView::layout):
587
588 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
589
590         [Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
591         https://bugs.webkit.org/show_bug.cgi?id=177345
592         <rdar://problem/32975942>
593
594         Reviewed by Jon Lee.
595
596         This bug has a fairly insideous cause. In particular, the system font fallback path follows
597         system conventions, which are not the same as the CSS fallback path. For example, the Chinese
598         fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
599         assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
600         However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
601         Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
602         and expected, and we shouldn't synthesize bold in this situation.
603
604         Test: fast/text/system-ui-chinese-bold-fallback.html
605
606         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
607         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
608
609 2017-10-17  Chelsea Pugh  <cpugh@apple.com>
610
611         [iOS] Don't turn fields yellow after filling credentials
612         https://bugs.webkit.org/show_bug.cgi?id=178411
613
614         Reviewed by Wenson Hsieh.
615
616         * editing/ios/AutofillElements.cpp:
617         (WebCore::AutofillElements::autofill): We don't want to turn fields yellow when filling the user name
618         and password. Remove the code that was causing that to happen.
619
620 2017-10-16  Andy Estes  <aestes@apple.com>
621
622         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
623         https://bugs.webkit.org/show_bug.cgi?id=178191
624         <rdar://problem/34906367>
625
626         Reviewed by Tim Horton.
627
628         Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
629
630         * Modules/applepay/ApplePayError.idl:
631         * Modules/applepay/ApplePayPaymentContact.h:
632         * Modules/applepay/ApplePayPaymentContact.idl:
633         * Modules/applepay/ApplePaySessionPaymentRequest.h:
634         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
635         (WebCore::subLocality):
636         (WebCore::setSubLocality):
637         (WebCore::subAdministrativeArea):
638         (WebCore::setSubAdministrativeArea):
639         (WebCore::convert):
640
641 2017-10-17  Commit Queue  <commit-queue@webkit.org>
642
643         Unreviewed, rolling out r223500.
644         https://bugs.webkit.org/show_bug.cgi?id=178408
645
646         Introduced a crash in CSSAnimationController::updateAnimations
647         (Requested by rniwa on #webkit).
648
649         Reverted changeset:
650
651         "Resolve ::before and ::after pseudo elements during style
652         resolution"
653         https://bugs.webkit.org/show_bug.cgi?id=178339
654         https://trac.webkit.org/changeset/223500
655
656 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
657
658         Delete button doesn't fully delete certain emoji
659         https://bugs.webkit.org/show_bug.cgi?id=178096
660         <rdar://problem/34785106>
661
662         Reviewed by Simon Fraser.
663
664         System infrastructure for handling emoji changes every year. Instead of having
665         custom code to specifically walk over codepoints, we should delegate to the
666         system handling.
667
668         Tests: editing/deleting/delete-emoji.html
669                editing/deleting/delete-emoji-1.html
670                editing/deleting/delete-emoji-2.html
671                editing/deleting/delete-emoji-3.html
672                editing/deleting/delete-emoji-4.html
673                editing/deleting/delete-emoji-5.html
674                editing/deleting/delete-emoji-6.html
675                editing/deleting/delete-emoji-7.html
676                editing/deleting/delete-emoji-8.html
677                editing/deleting/delete-emoji-9.html
678
679         * rendering/RenderText.cpp:
680         (WebCore::RenderText::previousOffset const):
681         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
682         (WebCore::RenderText::nextOffset const):
683         (WebCore::isHangulLVT): Deleted.
684         (WebCore::isMark): Deleted.
685         (WebCore::isRegionalIndicator): Deleted.
686         (WebCore::isInArmenianToLimbuRange): Deleted.
687
688 2017-10-17  Youenn Fablet  <youenn@apple.com>
689
690         Add preliminary support for fetch event
691         https://bugs.webkit.org/show_bug.cgi?id=178171
692
693         Unreviewed.
694
695         * workers/service/FetchEvent.cpp:
696         (WebCore::FetchEvent::promiseIsSettled): build fix by removing unnecessary captured this at the moment.
697
698 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
699
700         [CSS Font Loading] Fonts are erroneously invisible when the policy says they should be visible
701         https://bugs.webkit.org/show_bug.cgi?id=178238
702
703         Reviewed by Simon Fraser.
704
705         When implementing font-display, I added testing infrastructure (so we don't have to wait for
706         3 second timeouts to occur). This testing infrastructure covered up a real bug where the wrong
707         font would be reported to CSSFontAccessor. This patch reverts the erroneous testing
708         infrastructure and replaces it with a real fix to the problem. The replacement fix is covered
709         by the same tests that I wrote when implementing the feature.
710
711         Covered by existing tests.
712
713         * css/CSSFontFace.cpp:
714         (WebCore::CSSFontFace::pump):
715         (WebCore::visibility):
716         (WebCore::CSSFontFace::font):
717
718 2017-10-16  Sam Weinig  <sam@webkit.org>
719
720         [Settings] Generate Settings.h/cpp
721         https://bugs.webkit.org/show_bug.cgi?id=178361
722
723         Reviewed by Dean Jackson.
724
725         This change generates Settings.h and Settings.cpp exactly as they are,
726         using SettingsMacros.h and everything. In follow up changes, the use of
727         SettingsMacros.h will be removed.
728
729         * CMakeLists.txt:
730         * DerivedSources.make:
731         * Scripts/GenerateSettings.py:
732         * Scripts/GenerateSettings/GenerateSettings.py:
733         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
734         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
735         * WebCore.xcodeproj/project.pbxproj:
736         * WebCoreMacros.cmake:
737         * page/Settings.cpp: Removed.
738         * page/Settings.h: Removed.
739
740 2017-10-17  Ms2ger  <Ms2ger@igalia.com>
741
742         Create bindings for WebGL2's versions of texSubImage2D.
743         https://bugs.webkit.org/show_bug.cgi?id=178382
744
745         Reviewed by Ryosuke Niwa.
746
747         Create bindings for WebGL2's versions of texSubImage2D.
748
749         No new tests: not much point in adding tests now; this method doesn't
750         do anything anyway.
751
752         * html/canvas/WebGL2RenderingContext.cpp:
753         (WebCore::WebGL2RenderingContext::texSubImage2D):
754         * html/canvas/WebGL2RenderingContext.h:
755         * html/canvas/WebGL2RenderingContext.idl:
756         * html/canvas/WebGLRenderingContext.idl:
757         * html/canvas/WebGLRenderingContextBase.idl:
758
759 2017-10-17  Zalan Bujtas  <zalan@apple.com>
760
761         [FrameView::layout cleanup] Subtree should read subtreeLayout.
762         https://bugs.webkit.org/show_bug.cgi?id=178401
763
764         Reviewed by Simon Fraser.
765
766         Rename some variables to improve readability.
767
768         No change in functionality.
769
770         * page/FrameView.cpp:
771         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
772         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
773         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
774         (WebCore::FrameView::reset):
775         (WebCore::FrameView::willDestroyRenderTree):
776         (WebCore::FrameView::didDestroyRenderTree):
777         (WebCore::FrameView::calculateScrollbarModesForLayout):
778         (WebCore::FrameView::layout):
779         (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
780         (WebCore::FrameView::scheduleRelayout):
781         (WebCore::FrameView::scheduleRelayoutOfSubtree):
782         (WebCore::FrameView::needsLayout const):
783         (WebCore::FrameView::autoSizeIfEnabled):
784         * page/FrameView.h:
785
786 2017-10-16  Dean Jackson  <dino@apple.com>
787
788         WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
789         https://bugs.webkit.org/show_bug.cgi?id=178223
790         <rdar://problem/34597567>
791
792         Reviewed by Antoine Quint.
793
794         Remove the limit of 4k on the width/height of the renderbuffer.
795
796         Test: fast/canvas/webgl/large-drawing-buffer-resize.html
797
798         * html/canvas/WebGLRenderingContextBase.cpp:
799         (WebCore::WebGLRenderingContextBase::reshape):
800
801 2017-10-17  John Wilander  <wilander@apple.com>
802
803         Add and remove cookie partition accordingly in intermediary redirect requests
804         https://bugs.webkit.org/show_bug.cgi?id=178369
805         <rdar://problem/34467603>
806
807         Reviewed by Brent Fulgham.
808
809         Tests: http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html
810                http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html
811
812         * loader/ResourceLoadObserver.h:
813             Now exposes notifyObserver() so that it can be triggered
814             by the TestRunner.
815             Removed unimplemented ResourceLoadObserver::setShouldThrottleObserverNotifications().
816
817 2017-10-17  Jer Noble  <jer.noble@apple.com>
818
819         Corrupted image after looping movie-backed <img>.
820         https://bugs.webkit.org/show_bug.cgi?id=178398
821
822         Reviewed by Eric Carlson.
823
824         Use the decode-order sample cursor rather than the destination sample cursor when generating
825         the CMSampleBuffer to decode.
826
827         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
828         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
829
830 2017-10-17  Ryan Haddad  <ryanhaddad@apple.com>
831
832         Unreviewed, rolling out r223459.
833
834         This change introduced LayoutTest failures.
835
836         Reverted changeset:
837
838         "WebGL clamps drawingBufferWidth to 4096 pixels on a 5120
839         monitor/canvas"
840         https://bugs.webkit.org/show_bug.cgi?id=178223
841         https://trac.webkit.org/changeset/223459
842
843 2017-10-17  Youenn Fablet  <youenn@apple.com>
844
845         Add preliminary support for fetch event
846         https://bugs.webkit.org/show_bug.cgi?id=178171
847
848         Reviewed by Chris Dumez.
849
850         Test: http/wpt/service-workers/fetchEvent.https.html
851               http/wpt/service-workers/extendableEvent.https.html
852
853         Adding support for ExtendableEvent and FetchEvent as per 
854         https://w3c.github.io/ServiceWorker/v1/#extendableevent-interface and
855         https://w3c.github.io/ServiceWorker/v1/#fetchevent-interface.
856
857         Both events need to handle promises as method parameters.
858         Beefing up DOMPromise for that purpose by exposing status, result and being able to call then.
859         Adding a new DOMPromise create method that would be the base for https://heycam.github.io/webidl/#es-promise
860         which might be implemented in the binding generator as a follow-up.
861
862         This patch makes them exposed on Window for test purposes until they can be fully tested on ServiceWorker environment.
863         It is also adding two internal methods for the same reason. These should be removed once events can be tested in its environment.
864
865         * CMakeLists.txt:
866         * DerivedSources.make:
867         * Modules/fetch/FetchResponse.idl:
868         * WebCore.xcodeproj/project.pbxproj:
869         * bindings/js/JSDOMPromise.cpp: Added.
870         (WebCore::callFunction):
871         (WebCore::DOMPromise::create):
872         (WebCore::DOMPromise::whenSettled):
873         (WebCore::DOMPromise::result const):
874         (WebCore::DOMPromise::status const):
875         * bindings/js/JSDOMPromise.h:
876         * bindings/js/WebCoreBuiltinNames.h:
877         * dom/EventNames.in:
878         * testing/Internals.cpp:
879         (WebCore::Internals::waitFetchEventToFinish):
880         (WebCore::Internals::waitExtendableEventToFinish):
881         * testing/Internals.h:
882         * testing/Internals.idl:
883         * workers/service/ExtendableEvent.cpp: Added.
884         (WebCore::ExtendableEvent::ExtendableEvent):
885         (WebCore::ExtendableEvent::waitUntil):
886         (WebCore::ExtendableEvent::addPendingPromise):
887         * workers/service/ExtendableEvent.h:
888         (WebCore::ExtendableEvent::onFinishedWaiting):
889         (WebCore::ExtendableEvent::promiseSettled):
890         * workers/service/ExtendableEvent.idl: Added.
891         * workers/service/ExtendableEventInit.h: Added.
892         * workers/service/ExtendableEventInit.idl: Added.
893         * workers/service/FetchEvent.cpp: Added.
894         (WebCore::FetchEvent::FetchEvent):
895         (WebCore::FetchEvent::respondWith):
896         (WebCore::FetchEvent::onResponse):
897         (WebCore::FetchEvent::respondWithError):
898         (WebCore::FetchEvent::processResponse):
899         (WebCore::FetchEvent::promiseSettled):
900         * workers/service/FetchEvent.h:
901         * workers/service/FetchEvent.idl:
902
903 2017-10-17  Jer Noble  <jer.noble@apple.com>
904
905         Leak of one AVSampleCursor inside ImageDecoderAVFObjC::createFrameImageAtIndex()
906         https://bugs.webkit.org/show_bug.cgi?id=178397
907
908         Reviewed by Eric Carlson.
909
910         Explicitly wrap the return value of -copy in a RetainPtr.
911
912         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
913         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
914
915 2017-10-17  Youenn Fablet  <youenn@apple.com>
916
917         Cache API implementation should be able to compute storage size for WebKit client applications.
918         https://bugs.webkit.org/show_bug.cgi?id=178350
919
920         Reviewed by Chris Dumez.
921
922         * page/SecurityOriginData.h:
923         (WebCore::SecurityOriginData::equals const):
924
925 2017-10-17  Daniel Bates  <dabates@apple.com>
926
927         ASSERTION FAILED: m_truncation != cFullTruncation in InlineTextBox::clampedOffset()
928         https://bugs.webkit.org/show_bug.cgi?id=178322
929
930         Reviewed by Darin Adler.
931
932         It is acceptable for InlineTextBox::clampedOffset() to be called for a fully truncated box,
933         say a person clicks on the ellipsis in a truncated text run. Restore the behavior prior to
934         r223259 and return the clamped offset.
935
936         Test: fast/text/click-ellipsis-assertion-failure.html
937
938         * rendering/InlineTextBox.cpp:
939         (WebCore::InlineTextBox::clampedOffset const):
940
941 2017-10-17  Daniel Bates  <dabates@apple.com>
942
943         REGRESSION (r222670 and r222732): RTL truncated text may not be drawn
944         https://bugs.webkit.org/show_bug.cgi?id=178278
945         <rdar://problem/34982818>
946
947         Reviewed by Darin Adler.
948
949         Revert r222732 and partially revert r222670. The underlying font rendering machinery implements
950         text truncation by taking a TextRun object that represents all of the text in the line fragment
951         and a subrange of the glyphs to render from this fragment. Only the glyphs in this subrange are
952         drawn and they are drawn in the same position they would be in had the entire line fragment been
953         drawn. Following r222670 InlineTextBox applies the truncation to the TextRun in InlineTextBox::text().
954         Together with r222732, which assumed that the number of glyphs to draw is equal to the length of
955         the TextRun, a truncated text run would be drawn at the wrong position on screen and could give
956         the impression that the text is not drawn. Instead InlineTextBox::text() should always return
957         the text for the entire line fragment without considering truncation and when calling TextPainter::paint()
958         we need to pass the truncated length of the line fragment.
959
960         Test: fast/text/ellipsis-text-rtl.html
961
962         * rendering/InlineTextBox.cpp:
963         (WebCore::InlineTextBox::paint): Compute the truncated length (number of glyphs) and pass this
964         to TextPainter::paint()
965         (WebCore::InlineTextBox::text const): Do not apply truncation to the text run. Truncation is
966         implemented by telling the underlying font rendering machinery to paint the subrange of the
967         text run that represents the non-truncated (visible) text.
968         * rendering/InlineTextBox.h:
969         * rendering/SimpleLineLayoutFunctions.cpp:
970         (WebCore::SimpleLineLayout::paintFlow): Pass the entire length of the text run as we did prior
971         to r222732.
972         * rendering/TextPainter.cpp:
973         (WebCore::TextPainter::paint): Take a length that represents the number of glyphs to draw from
974         the text run as we use to take prior to r222732.
975         * rendering/TextPainter.h:
976
977 2017-10-17  Zalan Bujtas  <zalan@apple.com>
978
979         [FrameView::layout cleanup] Move text auto sizing logic to a separate function
980         https://bugs.webkit.org/show_bug.cgi?id=178391
981         <rdar://problem/35030264>
982
983         Reviewed by Antti Koivisto.
984
985         No change in functionality.
986
987         * page/FrameView.cpp:
988         (WebCore::applyTextSizingIfNeeded):
989         (WebCore::FrameView::layout):
990
991 2017-10-17  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
992
993         [Curl] Forward declaration "class Cookie;" in CookieJarCurl.h should be "struct Cookie;"
994         https://bugs.webkit.org/show_bug.cgi?id=178378
995
996         Reviewed by Per Arne Vollan.
997
998         No new tests. No change in behaviors.
999
1000         * platform/network/curl/CookieJarCurl.h:
1001
1002 2017-10-17  Zalan Bujtas  <zalan@apple.com>
1003
1004         [FrameView::layout cleanup] Merge InPreLayout blocks
1005         https://bugs.webkit.org/show_bug.cgi?id=178373
1006
1007         Reviewed by Antti Koivisto.
1008
1009         Remove redundant comment and scoping.
1010
1011         No change in functionality.
1012
1013         * page/FrameView.cpp:
1014         (WebCore::FrameView::layout):
1015
1016 2017-10-17  Antti Koivisto  <antti@apple.com>
1017
1018         Text nodes with display:contents parent should render as if they were wrapped in an unstyled <span>
1019         https://bugs.webkit.org/show_bug.cgi?id=178332
1020
1021         Reviewed by Ryosuke Niwa.
1022
1023         According to https://github.com/w3c/csswg-drafts/issues/1118
1024
1025             <div style="display:contents;color:green">text</div>
1026
1027         must result in green text even though div doesn't generate a box.
1028
1029         This patch implements the behavior by wrapping text renderers with display:contents parent element
1030         in an anonymous inline box that receives its style by inheriting from the parent element.
1031
1032         * dom/Document.cpp:
1033         (WebCore::Document::updateTextRenderer):
1034         * rendering/RenderElement.cpp:
1035         (WebCore::RenderElement::computeFirstLineStyle const):
1036
1037             Synthesize the first line style in display:contents parent case.
1038
1039         * rendering/RenderObject.cpp:
1040         (WebCore::findDestroyRootIncludingAnonymous):
1041
1042             Factor into a function.
1043
1044         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
1045
1046             Get rid of the anonymous wrapper if it exists.
1047
1048         * rendering/RenderText.cpp:
1049         (WebCore::inlineWrapperForDisplayContentsMap):
1050         (WebCore::RenderText::RenderText):
1051         (WebCore::RenderText::willBeDestroyed):
1052         (WebCore::RenderText::inlineWrapperForDisplayContents):
1053         (WebCore::RenderText::setInlineWrapperForDisplayContents):
1054
1055             Add a weak member (implemented as a rare data map) for holding the wrapper pointer.
1056
1057         (WebCore::RenderText::findByDisplayContentsInlineWrapperCandidate):
1058
1059             Helper to get the text renderer for a wrapper.
1060
1061         * rendering/RenderText.h:
1062         * style/RenderTreeUpdater.cpp:
1063         (WebCore::createTextRenderer):
1064         (WebCore::RenderTreeUpdater::updateTextRenderer):
1065
1066             Create the wrapper if needed.
1067
1068         * style/StyleTreeResolver.cpp:
1069         (WebCore::Style::TreeResolver::resolveComposedTree):
1070
1071             Compute the wrapper style by inheriting from the display:contents parent.
1072
1073         * style/StyleUpdate.h:
1074         (WebCore::Style::TextUpdate::TextUpdate):
1075
1076 2017-10-17  Alicia Boya García  <aboya@igalia.com>
1077
1078         [MSE][GStreamer] Insert parser elements in AppendPipeline when demuxing opus or Vorbis
1079         https://bugs.webkit.org/show_bug.cgi?id=178076
1080
1081         Reviewed by Xabier Rodriguez-Calvar.
1082
1083         YouTube does not include durations in the WebM container for files
1084         containing Opus audio, so we need to read them from the contained
1085         stream. Fortunately, GStreamer has an element to do that: opusparse.
1086
1087         The same thing happens with Vorbis contained in WebM files from the
1088         W3C tests, which should also be fixed by the GStreamer element
1089         vorbisparse.
1090
1091         This patch adds an opusparse or vorbisparse element to the
1092         AppendPipeline at the sinkpad of the demuxer when either is found.
1093
1094         Tests: updated expectations.
1095
1096         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1097         (WebCore::AppendPipeline::appsinkNewSample):
1098         (WebCore::createOptionalParserForFormat):
1099         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1100         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
1101         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1102         * platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp:
1103         (WebCore::GStreamerMediaSample::GStreamerMediaSample):
1104         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1105         (WebCore::PlaybackPipeline::attachTrack):
1106
1107 2017-10-17  Ms2ger  <Ms2ger@igalia.com>
1108
1109         Add WebGL2 texImage3D overloads.
1110         https://bugs.webkit.org/show_bug.cgi?id=178119
1111
1112         Reviewed by Ryosuke Niwa.
1113
1114         No new tests: not much point in adding tests now; this method doesn't
1115         do anything anyway.
1116
1117         * html/canvas/WebGL2RenderingContext.cpp:
1118         (WebCore::WebGL2RenderingContext::texImage3D):
1119         * html/canvas/WebGL2RenderingContext.h:
1120         * html/canvas/WebGL2RenderingContext.idl:
1121
1122 2017-10-17  Antti Koivisto  <antti@apple.com>
1123
1124         Resolve ::before and ::after pseudo elements during style resolution
1125         https://bugs.webkit.org/show_bug.cgi?id=178339
1126
1127         Reviewed by Ryosuke Niwa.
1128
1129         They are currently resolved during render tree building which creates problems with display:contents and animations.
1130
1131         * dom/PseudoElement.cpp:
1132         (WebCore::PseudoElement::PseudoElement):
1133
1134             Call InspectorInstrumentation from constructor.
1135
1136         * style/RenderTreeUpdater.cpp:
1137         (WebCore::RenderTreeUpdater::Parent::Parent):
1138         (WebCore::RenderTreeUpdater::updateRenderTree):
1139         (WebCore::RenderTreeUpdater::pushParent):
1140
1141             Push the full update to the parent stack.
1142
1143         (WebCore::RenderTreeUpdater::popParent):
1144         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
1145         (WebCore::RenderTreeUpdater::updateAfterDescendants):
1146         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
1147         * style/RenderTreeUpdater.h:
1148         * style/RenderTreeUpdaterGeneratedContent.cpp:
1149         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1150
1151             No need to resolve pseudo style, we have it already.
1152
1153         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
1154         (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
1155         (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
1156         * style/RenderTreeUpdaterGeneratedContent.h:
1157         * style/StyleTreeResolver.cpp:
1158         (WebCore::Style::TreeResolver::resolveElement):
1159         (WebCore::Style::TreeResolver::resolvePseudoStyle):
1160
1161             Resolve pseudos.
1162
1163         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1164
1165             Make a private member function.
1166
1167         (WebCore::Style::TreeResolver::resolveComposedTree):
1168         * style/StyleTreeResolver.h:
1169         * style/StyleUpdate.cpp:
1170         (WebCore::Style::Update::elementUpdates const):
1171         (WebCore::Style::Update::elementUpdates):
1172
1173             Bundle the style update for an element and the associated before/after pseudos.
1174
1175         (WebCore::Style::Update::elementStyle const):
1176         (WebCore::Style::Update::elementStyle):
1177         (WebCore::Style::Update::addElement):
1178         (WebCore::Style::Update::elementUpdate const): Deleted.
1179         (WebCore::Style::Update::elementUpdate): Deleted.
1180         * style/StyleUpdate.h:
1181
1182 2017-10-17  Keith Miller  <keith_miller@apple.com>
1183
1184         Change WebCore sources to work with unified source builds
1185         https://bugs.webkit.org/show_bug.cgi?id=178229
1186
1187         Rubber stamped by Tim Horton.
1188
1189         This patch does the following:
1190
1191         1) Move all “using namespace <name>;” into the WebCore namespace
1192         (They used to go in the global namespace) and change to "using
1193         WebCore::<name>;” in .mm files.
1194
1195         2) Move a bunch of the soft linking library/framework macros out
1196         of the .mm files since those caused name collision problems.
1197
1198         3) Fix minor other naming collisions.
1199
1200         The problem with 1 in a unified source world is generic names
1201         often collide with system header names. For example, WebCore has a
1202         Rect class and that collided with a system header type elsewhere.
1203
1204         This patch shouldn't change behavior so no new tests.
1205
1206         * Configurations/FeatureDefines.xcconfig:
1207         * Modules/cache/CacheStorageConnection.cpp:
1208         * Modules/cache/DOMCache.cpp:
1209         * Modules/cache/DOMCacheStorage.cpp:
1210         * Modules/cache/WorkerCacheStorageConnection.cpp:
1211         * Modules/encryptedmedia/InitDataRegistry.cpp:
1212         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
1213         * Modules/indexeddb/IDBCursor.cpp:
1214         * Modules/indexeddb/IDBFactory.cpp:
1215         * Modules/indexeddb/IDBIndex.cpp:
1216         * Modules/indexeddb/IDBKeyRange.cpp:
1217         * Modules/indexeddb/IDBObjectStore.cpp:
1218         * Modules/indexeddb/IDBRequest.cpp:
1219         * Modules/indexeddb/IDBTransaction.cpp:
1220         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1221         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1222         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1223         * Modules/mediasource/MediaSource.cpp:
1224         (WebCore::MediaSource::setReadyState):
1225         (WebCore::toString): Deleted.
1226         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1227         * Modules/plugins/QuickTimePluginReplacement.mm:
1228         (WebCore::jsValueWithAVMetadataItemInContext):
1229         * Modules/webdriver/NavigatorWebDriver.cpp:
1230         * PlatformAppleWin.cmake:
1231         * PlatformMac.cmake:
1232         * WebCore.xcodeproj/project.pbxproj:
1233         * accessibility/ios/AccessibilityObjectIOS.mm:
1234         (-[WAKView accessibilityIsIgnored]): Deleted.
1235         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
1236         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1237         (-[WAKView accessibilityIsIgnored]):
1238         * accessibility/win/AXObjectCacheWin.cpp:
1239         * bindings/js/CommonVM.cpp:
1240         * bindings/js/DOMWrapperWorld.cpp:
1241         * bindings/js/GCController.cpp:
1242         * bindings/js/IDBBindingUtilities.cpp:
1243         * bindings/js/JSAudioTrackCustom.cpp:
1244         * bindings/js/JSAudioTrackListCustom.cpp:
1245         * bindings/js/JSBlobCustom.cpp:
1246         * bindings/js/JSCSSRuleCustom.cpp:
1247         * bindings/js/JSCSSRuleListCustom.cpp:
1248         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1249         * bindings/js/JSCallbackData.cpp:
1250         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1251         * bindings/js/JSCustomElementInterface.cpp:
1252         * bindings/js/JSCustomElementRegistryCustom.cpp:
1253         * bindings/js/JSCustomEventCustom.cpp:
1254         * bindings/js/JSDOMBindingSecurity.cpp:
1255         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
1256         * bindings/js/JSDOMConstructorBase.cpp:
1257         * bindings/js/JSDOMConstructorWithDocument.cpp:
1258         * bindings/js/JSDOMConvertDate.cpp:
1259         * bindings/js/JSDOMConvertNumbers.cpp:
1260         * bindings/js/JSDOMConvertStrings.cpp:
1261         * bindings/js/JSDOMConvertWebGL.cpp:
1262         * bindings/js/JSDOMExceptionHandling.cpp:
1263         * bindings/js/JSDOMGlobalObject.cpp:
1264         * bindings/js/JSDOMGlobalObjectTask.cpp:
1265         * bindings/js/JSDOMGuardedObject.cpp:
1266         * bindings/js/JSDOMPromiseDeferred.cpp:
1267         * bindings/js/JSDOMQuadCustom.cpp:
1268         * bindings/js/JSDOMWindowBase.cpp:
1269         * bindings/js/JSDOMWindowCustom.cpp:
1270         * bindings/js/JSDOMWindowProxy.cpp:
1271         * bindings/js/JSDOMWrapper.cpp:
1272         * bindings/js/JSDOMWrapperCache.cpp:
1273         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
1274         * bindings/js/JSDocumentCustom.cpp:
1275         * bindings/js/JSDocumentFragmentCustom.cpp:
1276         * bindings/js/JSElementCustom.cpp:
1277         * bindings/js/JSErrorHandler.cpp:
1278         * bindings/js/JSEventCustom.cpp:
1279         * bindings/js/JSEventListener.cpp:
1280         * bindings/js/JSEventTargetCustom.cpp:
1281         * bindings/js/JSFileSystemEntryCustom.cpp:
1282         * bindings/js/JSHTMLCollectionCustom.cpp:
1283         * bindings/js/JSHTMLDocumentCustom.cpp:
1284         * bindings/js/JSHTMLTemplateElementCustom.cpp:
1285         * bindings/js/JSHistoryCustom.cpp:
1286         * bindings/js/JSIDBCursorCustom.cpp:
1287         * bindings/js/JSIDBCursorWithValueCustom.cpp:
1288         * bindings/js/JSIDBIndexCustom.cpp:
1289         * bindings/js/JSIDBObjectStoreCustom.cpp:
1290         * bindings/js/JSIDBTransactionCustom.cpp:
1291         * bindings/js/JSImageDataCustom.cpp:
1292         * bindings/js/JSLazyEventListener.cpp:
1293         * bindings/js/JSLocationCustom.cpp:
1294         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
1295         * bindings/js/JSMessageEventCustom.cpp:
1296         * bindings/js/JSMessagePortCustom.cpp:
1297         * bindings/js/JSMutationObserverCustom.cpp:
1298         * bindings/js/JSNodeCustom.cpp:
1299         * bindings/js/JSNodeListCustom.cpp:
1300         * bindings/js/JSPerformanceEntryCustom.cpp:
1301         * bindings/js/JSPluginElementFunctions.cpp:
1302         * bindings/js/JSPopStateEventCustom.cpp:
1303         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1304         * bindings/js/JSReadableStreamSourceCustom.cpp:
1305         * bindings/js/JSSVGPathSegCustom.cpp:
1306         * bindings/js/JSTextTrackCueCustom.cpp:
1307         * bindings/js/JSTextTrackCustom.cpp:
1308         * bindings/js/JSTextTrackListCustom.cpp:
1309         * bindings/js/JSTrackCustom.cpp:
1310         * bindings/js/JSVideoTrackCustom.cpp:
1311         * bindings/js/JSVideoTrackListCustom.cpp:
1312         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
1313         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1314         * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
1315         * bindings/js/JSWebGPURenderingContextCustom.cpp:
1316         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1317         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1318         * bindings/js/JSXMLHttpRequestCustom.cpp:
1319         * bindings/js/JSXPathNSResolverCustom.cpp:
1320         * bindings/js/ReadableStream.cpp:
1321         (WebCore::ReadableStream::pipeTo):
1322         (WebCore::ReadableStream::tee):
1323         (WebCore::checkReadableStream):
1324         (WebCore::callFunction): Deleted.
1325         * bindings/js/ScheduledAction.cpp:
1326         * bindings/js/ScriptCachedFrameData.cpp:
1327         * bindings/js/ScriptController.cpp:
1328         * bindings/js/SerializedScriptValue.cpp:
1329         * bindings/js/StructuredClone.cpp:
1330         * bindings/js/WebCoreJSClientData.cpp:
1331         * bindings/js/WorkerScriptController.cpp:
1332         * bindings/scripts/CodeGeneratorJS.pm:
1333         (GenerateEnumerationImplementation):
1334         (GenerateImplementation):
1335         (GenerateDictionaryImplementation):
1336         (GenerateCallbackFunctionImplementation):
1337         (GenerateCallbackInterfaceImplementation):
1338         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1339         * bindings/scripts/test/JS/JSMapLike.cpp:
1340         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1341         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1342         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1343         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1344         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1345         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1346         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
1347         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
1348         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
1349         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1350         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1351         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1352         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1353         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1354         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1355         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1356         * bindings/scripts/test/JS/JSTestException.cpp:
1357         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1358         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1359         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1360         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1361         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1362         * bindings/scripts/test/JS/JSTestInterface.cpp:
1363         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1364         * bindings/scripts/test/JS/JSTestIterable.cpp:
1365         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1366         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1367         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1368         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1369         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1370         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1371         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1372         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1373         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1374         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1375         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1376         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1377         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1378         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1379         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1380         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1381         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1382         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1383         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1384         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1385         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1386         * bindings/scripts/test/JS/JSTestNode.cpp:
1387         * bindings/scripts/test/JS/JSTestObj.cpp:
1388         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1389         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1390         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1391         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1392         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1393         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1394         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1395         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1396         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1397         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1398         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1399         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
1400         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1401         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1402         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1403         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1404         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1405         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1406         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1407         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1408         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
1409         * bridge/IdentifierRep.cpp:
1410         * bridge/NP_jsobject.cpp:
1411         (ObjectMap::get): Deleted.
1412         (ObjectMap::add): Deleted.
1413         (ObjectMap::remove): Deleted.
1414         (objectMap): Deleted.
1415         (ObjectMap::RootObjectInvalidationCallback::operator()): Deleted.
1416         (getListFromVariantArgs): Deleted.
1417         (jsAllocate): Deleted.
1418         (jsDeallocate): Deleted.
1419         (_NPN_CreateNoScriptObject): Deleted.
1420         (_NPN_InvokeDefault): Deleted.
1421         (_NPN_Invoke): Deleted.
1422         (_NPN_Evaluate): Deleted.
1423         (_NPN_GetProperty): Deleted.
1424         (_NPN_SetProperty): Deleted.
1425         (_NPN_RemoveProperty): Deleted.
1426         (_NPN_HasProperty): Deleted.
1427         (_NPN_HasMethod): Deleted.
1428         (_NPN_SetException): Deleted.
1429         (_NPN_Enumerate): Deleted.
1430         (_NPN_Construct): Deleted.
1431         * bridge/NP_jsobject.h:
1432         * contentextensions/ContentExtensionParser.cpp:
1433         * crypto/SubtleCrypto.cpp:
1434         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1435         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
1436         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
1437         (WebCore::CryptoAlgorithmAES_CBC::importKey):
1438         (WebCore::CryptoAlgorithmAES_CBC::exportKey):
1439         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
1440         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
1441         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
1442         (WebCore::CryptoAlgorithmAES_CFB::importKey):
1443         (WebCore::CryptoAlgorithmAES_CFB::exportKey):
1444         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
1445         (WebCore::parametersAreValid):
1446         (WebCore::CryptoAlgorithmAES_CTR::importKey):
1447         (WebCore::CryptoAlgorithmAES_CTR::exportKey):
1448         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
1449         (WebCore::tagLengthIsValid):
1450         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
1451         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
1452         (WebCore::CryptoAlgorithmAES_GCM::importKey):
1453         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
1454         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1455         (WebCore::CryptoAlgorithmAES_KW::importKey):
1456         (WebCore::CryptoAlgorithmAES_KW::exportKey):
1457         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1458         (WebCore::CryptoAlgorithmHMAC::importKey):
1459         (WebCore::CryptoAlgorithmHMAC::exportKey):
1460         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1461         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1462         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
1463         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1464         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1465         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
1466         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
1467         (WebCore::CryptoAlgorithmRSA_PSS::importKey):
1468         (WebCore::CryptoAlgorithmRSA_PSS::exportKey):
1469         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
1470         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
1471         (WebCore::commonCryptoHMACAlgorithm): Deleted.
1472         * css/CSSBasicShapes.cpp:
1473         * css/CSSPrimitiveValue.cpp:
1474         * css/parser/CSSParser.cpp:
1475         * css/parser/CSSPropertyParser.cpp:
1476         * css/parser/CSSPropertyParserHelpers.cpp:
1477         (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues):
1478         (WebCore::CSSPropertyParserHelpers::consumePosition):
1479         (WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair): Deleted.
1480         * dom/DOMQuad.cpp:
1481         * dom/Document.cpp:
1482         * dom/ErrorEvent.cpp:
1483         * dom/EventListenerMap.cpp:
1484         * dom/EventTarget.cpp:
1485         * dom/PromiseRejectionEvent.cpp:
1486         * dom/RejectedPromiseTracker.cpp:
1487         * dom/ScriptExecutionContext.cpp:
1488         * domjit/JSDocumentDOMJIT.cpp:
1489         * domjit/JSDocumentFragmentDOMJIT.cpp:
1490         * domjit/JSElementDOMJIT.cpp:
1491         * domjit/JSEventDOMJIT.cpp:
1492         * domjit/JSNodeDOMJIT.cpp:
1493         * editing/TextIterator.cpp:
1494         * editing/cocoa/HTMLConverter.mm:
1495         * history/CachedPage.cpp:
1496         * html/HTMLCanvasElement.cpp:
1497         * html/HTMLFontElement.cpp:
1498         * html/HTMLMediaElement.cpp:
1499         * html/HTMLSelectElement.cpp:
1500         * html/TypeAhead.cpp:
1501         * html/parser/HTMLSrcsetParser.cpp:
1502         (WebCore::tokenizeDescriptors):
1503         * html/parser/HTMLTokenizer.cpp:
1504         * html/parser/ParsingUtilities.h:
1505         (WebCore::isNotASCIISpace):
1506         * html/parser/XSSAuditorDelegate.cpp:
1507         * html/track/DataCue.cpp:
1508         * inspector/CommandLineAPIHost.cpp:
1509         * inspector/CommandLineAPIModule.cpp:
1510         * inspector/InspectorApplicationCacheAgent.cpp:
1511         * inspector/InspectorCSSAgent.cpp:
1512         * inspector/InspectorCanvas.cpp:
1513         * inspector/InspectorCanvasAgent.cpp:
1514         * inspector/InspectorClient.cpp:
1515         * inspector/InspectorController.cpp:
1516         * inspector/InspectorDOMAgent.cpp:
1517         * inspector/InspectorDOMDebuggerAgent.cpp:
1518         * inspector/InspectorDOMStorageAgent.cpp:
1519         * inspector/InspectorDatabaseAgent.cpp:
1520         * inspector/InspectorDatabaseResource.cpp:
1521         * inspector/InspectorFrontendClientLocal.cpp:
1522         * inspector/InspectorFrontendHost.cpp:
1523         * inspector/InspectorIndexedDBAgent.cpp:
1524         * inspector/InspectorInstrumentation.cpp:
1525         * inspector/InspectorLayerTreeAgent.cpp:
1526         * inspector/InspectorMemoryAgent.cpp:
1527         * inspector/InspectorNetworkAgent.cpp:
1528         * inspector/InspectorOverlay.cpp:
1529         * inspector/InspectorPageAgent.cpp:
1530         * inspector/InspectorShaderProgram.cpp:
1531         * inspector/InspectorStyleSheet.cpp:
1532         * inspector/InspectorTimelineAgent.cpp:
1533         * inspector/InspectorWorkerAgent.cpp:
1534         * inspector/InstrumentingAgents.cpp:
1535         * inspector/NetworkResourcesData.cpp:
1536         * inspector/PageConsoleAgent.cpp:
1537         * inspector/PageDebuggerAgent.cpp:
1538         * inspector/PageHeapAgent.cpp:
1539         * inspector/PageRuntimeAgent.cpp:
1540         * inspector/PageScriptDebugServer.cpp:
1541         * inspector/TimelineRecordFactory.cpp:
1542         * inspector/WebConsoleAgent.cpp:
1543         * inspector/WebDebuggerAgent.cpp:
1544         * inspector/WebHeapAgent.cpp:
1545         * inspector/WebInjectedScriptHost.cpp:
1546         * inspector/WebInjectedScriptManager.cpp:
1547         * inspector/WorkerConsoleAgent.cpp:
1548         * inspector/WorkerDebuggerAgent.cpp:
1549         * inspector/WorkerInspectorController.cpp:
1550         * inspector/WorkerRuntimeAgent.cpp:
1551         * inspector/WorkerScriptDebugServer.cpp:
1552         * loader/FTPDirectoryParser.cpp:
1553         * loader/TextResourceDecoder.cpp:
1554         * loader/cache/CachedResource.cpp:
1555         * loader/cache/CachedResourceLoader.cpp:
1556         * page/ContextMenuController.cpp:
1557         * page/DOMWindow.cpp:
1558         * page/Navigator.cpp:
1559         * page/PageConsoleClient.cpp:
1560         * page/PageDebuggable.cpp:
1561         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1562         * page/csp/ContentSecurityPolicy.cpp:
1563         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1564         (WebCore::isNotASCIISpace): Deleted.
1565         * page/csp/ContentSecurityPolicyMediaListDirective.cpp:
1566         (WebCore::isNotASCIISpace): Deleted.
1567         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1568         * page/scrolling/ios/ScrollingTreeIOS.h:
1569         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1570         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
1571         (WebCore::operator*): Deleted.
1572         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
1573         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
1574         (WebCore::operator*): Deleted.
1575         * platform/Length.cpp:
1576         * platform/URL.cpp:
1577         (WebCore::isSchemeFirstChar):
1578         (WebCore::isSchemeChar):
1579         (WebCore::isBadChar):
1580         (WebCore::isTabNewline):
1581         * platform/audio/WebAudioBufferList.cpp:
1582         (WebCore::WebAudioBufferList::WebAudioBufferList):
1583         * platform/audio/mac/AudioSampleDataSource.mm:
1584         (WebCore::AudioSampleDataSource::pushSamples):
1585         * platform/cf/CoreMediaSoftLink.cpp: Removed.
1586         * platform/cf/CoreMediaSoftLink.h: Removed.
1587         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1588         * platform/graphics/FloatPolygon.cpp:
1589         (WebCore::areCollinearPoints):
1590         (WebCore::FloatPolygon::FloatPolygon):
1591         (WebCore::VertexPair::intersection const):
1592         (WebCore::determinant): Deleted.
1593         * platform/graphics/FontCache.cpp:
1594         * platform/graphics/FontCascade.cpp:
1595         * platform/graphics/GraphicsContext3DPrivate.cpp:
1596         * platform/graphics/WidthIterator.cpp:
1597         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1598         (WebCore::AudioSourceProviderAVFObjC::process):
1599         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1600         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
1601         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
1602         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
1603         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1604         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
1605         (WebCore::assetTrackMeetsHardwareDecodeRequirements):
1606         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
1607         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1608         (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
1609         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
1610         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
1611         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1612         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
1613         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1614         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1615         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1616         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1617         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1618         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
1619         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1620         * platform/graphics/cairo/ImageBufferCairo.cpp:
1621         * platform/graphics/cg/ImageBufferCG.cpp:
1622         (WebCore::ImageBuffer::ImageBuffer):
1623         (WebCore::releaseImageData): Deleted.
1624         * platform/graphics/cg/ImageBufferDataCG.h:
1625         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1626         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
1627         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1628         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1629         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
1630         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1631         * platform/graphics/opentype/OpenTypeMathData.cpp:
1632         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
1633         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1634         (WebCore::MatrixTransformOperation::blend):
1635         (WebCore::createOperation): Deleted.
1636         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
1637         * platform/graphics/win/FontWin.cpp:
1638         * platform/graphics/win/GraphicsContextCGWin.cpp:
1639         * platform/graphics/win/GraphicsContextCairoWin.cpp:
1640         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1641         * platform/graphics/win/GraphicsContextWin.cpp:
1642         * platform/graphics/win/UniscribeController.cpp:
1643         * platform/image-decoders/ScalableImageDecoder.cpp:
1644         (): Deleted.
1645         * platform/ios/LegacyTileLayer.mm:
1646         (-[LegacyTileHostLayer renderInContext:]):
1647         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1648         * platform/ios/ScrollAnimatorIOS.mm:
1649         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1650         * platform/ios/WebAVPlayerController.mm:
1651         (-[WebAVPlayerController skipBackwardThirtySeconds:]):
1652         (-[WebAVPlayerController gotoEndOfSeekableRanges:]):
1653         (-[WebAVPlayerController canSeekToBeginning]):
1654         (-[WebAVPlayerController canSeekToEnd]):
1655         (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
1656         (-[WebAVPlayerController updateMinMaxTiming]):
1657         * platform/ios/WebEvent.mm:
1658         * platform/ios/WebItemProviderPasteboard.mm:
1659         * platform/ios/wak/WKContentObservation.cpp:
1660         * platform/mac/KeyEventMac.mm:
1661         * platform/mac/PlaybackSessionInterfaceMac.mm:
1662         (WebCore::timeRangesToArray):
1663         * platform/mac/ScrollAnimatorMac.mm:
1664         (macScrollbarTheme): Deleted.
1665         (scrollerImpForScrollbar): Deleted.
1666         * platform/mac/ScrollbarThemeMac.mm:
1667         (WebCore::scrollbarMap):
1668         * platform/mac/VideoFullscreenInterfaceMac.mm:
1669         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
1670         * platform/mac/WebCoreNSURLExtras.mm:
1671         (WebCore::dataForURLComponentType):
1672         * platform/mac/WebPlaybackControlsManager.mm:
1673         * platform/mac/WebVideoFullscreenController.mm:
1674         (SOFT_LINK_CLASS): Deleted.
1675         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1676         * platform/mac/WebWindowAnimation.mm:
1677         (WebWindowAnimationDurationFromDuration): Deleted.
1678         (scaledRect): Deleted.
1679         (squaredDistance): Deleted.
1680         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1681         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1682         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1683         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1684         (WebCore::AVVideoCaptureSource::applyFrameRate):
1685         (WebCore::AVVideoCaptureSource::processNewFrame):
1686         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1687         * platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
1688         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1689         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1690         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1691         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1692         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
1693         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
1694         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
1695         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1696         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1697         * platform/network/HTTPParsers.cpp:
1698         * platform/text/LocaleICU.cpp:
1699         * platform/text/TextCodecLatin1.cpp:
1700         * platform/text/TextCodecUTF8.cpp:
1701         * platform/text/TextEncodingRegistry.cpp:
1702         * platform/text/win/LocaleWin.cpp:
1703         * platform/win/BString.cpp:
1704         * platform/win/KeyEventWin.cpp:
1705         * platform/win/ScrollbarThemeWin.cpp:
1706         * rendering/BidiRun.cpp:
1707         * rendering/FloatingObjects.cpp:
1708         * rendering/RenderBlock.cpp:
1709         * rendering/RenderListMarker.cpp:
1710         * rendering/RenderQuote.cpp:
1711         * rendering/RenderText.cpp:
1712         * rendering/RenderThemeWin.cpp:
1713         * testing/Internals.cpp:
1714         * testing/js/WebCoreTestSupport.cpp:
1715         * workers/WorkerConsoleClient.cpp:
1716         * workers/WorkerGlobalScope.cpp:
1717         * workers/WorkerInspectorProxy.cpp:
1718         * xml/SoftLinkLibxslt.cpp: Added.
1719         * xml/SoftLinkLibxslt.h: Added.
1720         * xml/XPathGrammar.cpp:
1721         * xml/XPathParser.cpp:
1722         * xml/XSLStyleSheetLibxslt.cpp:
1723         * xml/XSLTExtensions.cpp:
1724         * xml/XSLTProcessorLibxslt.cpp:
1725         * xml/XSLTUnicodeSort.cpp:
1726         (xsltTransformErrorTrampoline):
1727         (WebCore::xsltUnicodeSortFunction):
1728         * xml/parser/XMLDocumentParser.cpp:
1729         (WebCore::XMLDocumentParser::updateLeafTextNode):
1730         (WebCore::toString): Deleted.
1731
1732 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1733
1734         Allow reading data and blob URLs via DataTransfer when the pasteboard contains files
1735         https://bugs.webkit.org/show_bug.cgi?id=178377
1736
1737         Reviewed by Ryosuke Niwa.
1738
1739         Adds data and blob URLs, alongside http(s), as URL protocols safe to expose to bindings.
1740
1741         Test: editing/pasteboard/drag-drop-href-as-url.html
1742
1743         * platform/Pasteboard.cpp:
1744         (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):
1745
1746 2017-10-16  Ryosuke Niwa  <rniwa@webkit.org>
1747
1748         Strip away event handlers and JavaScript URLs when copying
1749         https://bugs.webkit.org/show_bug.cgi?id=178375
1750
1751         Reviewed by Wenson Hsieh.
1752
1753         Don't serialize event handlers and URLs with javascript protocol when serializing HTML
1754         since they're not safe to be pasted elsewhere.
1755
1756         Test: editing/pasteboard/copying-html-strips-javascript-url-and-event-handler.html
1757
1758         * dom/Element.cpp:
1759         (WebCore::Element::isEventHandlerAttribute const):
1760         (WebCore::isEventHandlerAttribute): Deleted.
1761         * dom/Element.h:
1762         * editing/markup.cpp:
1763         (WebCore::StyledMarkupAccumulator::appendElement):
1764
1765 2017-10-16  Dean Jackson  <dino@apple.com>
1766
1767         WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
1768         https://bugs.webkit.org/show_bug.cgi?id=178223
1769         <rdar://problem/34597567>
1770
1771         Reviewed by Antoine Quint.
1772
1773         Remove the limit of 4k on the width/height of the renderbuffer.
1774
1775         Test: fast/canvas/webgl/large-drawing-buffer-resize.html
1776
1777         * html/canvas/WebGLRenderingContextBase.cpp:
1778         (WebCore::WebGLRenderingContextBase::reshape):
1779
1780 2017-10-16  Ryosuke Niwa  <rniwa@webkit.org>
1781
1782         Assert that Node::insertedInto doesn't fire an event
1783         https://bugs.webkit.org/show_bug.cgi?id=178376
1784         <rdar://problem/35022857>
1785
1786         Reviewed by Daniel Bates.
1787
1788         Fixed the assertion in notifyChildNodeInserted since this function MUST NOT dispatch an event,
1789         and moved a bunch of event-dispatching code from Node::insertedInto into Node::finishedInsertingSubtree.
1790
1791         No new tests since the existing tests cover the behavioral change.
1792
1793         * dom/ContainerNodeAlgorithms.cpp:
1794         (WebCore::notifyChildNodeInserted): Fixed the assertion.
1795         * dom/ProcessingInstruction.cpp:
1796         (WebCore::ProcessingInstruction::insertedInto):
1797         (WebCore::ProcessingInstruction::finishedInsertingSubtree): Extracted from insertedInto since
1798         checkStyleSheet can dispatch an event.
1799         * dom/ProcessingInstruction.h:
1800         * html/HTMLBodyElement.cpp:
1801         (WebCore::HTMLBodyElement::insertedInto):
1802         (WebCore::HTMLBodyElement::finishedInsertingSubtree): Extracted from insertedInto since
1803         setIntegralAttribute could dispatch DOMAttrModified synchronously.
1804         * html/HTMLBodyElement.h:
1805
1806 2017-10-16  Chris Dumez  <cdumez@apple.com>
1807
1808         ServiceWorkerRegistration should subclass RefCounted<>
1809         https://bugs.webkit.org/show_bug.cgi?id=178374
1810
1811         Reviewed by Ryosuke Niwa.
1812
1813         ServiceWorkerRegistration should subclass RefCounted<> or we end up with an infinite recursion
1814         when constructing such object. This is because ServiceWorkerRegistration subclasses
1815         EventTargetWithInlineData which implements ref() / deref() by calling refEventTarget() /
1816         derefEventTarget(). refEventTarget() / derefEventTarget() are implemented in
1817         ServiceWorkerRegistration so that they call ref() / deref() (which ends up being EventTarget's
1818         methods).
1819
1820         * workers/service/ServiceWorkerRegistration.h:
1821
1822 2017-10-16  Jer Noble  <jer.noble@apple.com>
1823
1824         ImageDecoderAVFObjC fails to create more CMSampleBuffers after creating about 32MB worth.
1825         https://bugs.webkit.org/show_bug.cgi?id=178360
1826
1827         Reviewed by Eric Carlson.
1828
1829         AVSampleBufferGenerator has a constrained memory pool of about 32MB in size. Once
1830         CMSampleBuffers representing about 32MB of memory are allocated, no more can be created
1831         until previously created ones are released. So rather than (only) creating the sample
1832         buffers up front in readSampleMetadata(), also create them dynamically, if missing, in
1833         createFrameImageAtIndex(...) and release them in storeSampleBuffer(...) after they have been
1834         decoded.
1835
1836         Drive-by fix: the expected content length was never actually set by the owner of ImageDecoderAVFObjC.
1837         Now that the expected content length is available, we don't have to wait until the data is complete
1838         to respond to requests.
1839
1840         * platform/graphics/ImageSource.cpp:
1841         (WebCore::ImageSource::ensureDecoderAvailable):
1842         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1843         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1844         (SOFT_LINK_POINTER_OPTIONAL):
1845         (-[WebCoreSharedBufferResourceLoaderDelegate canFulfillRequest:]):
1846         (-[WebCoreSharedBufferResourceLoaderDelegate fulfillRequest:]):
1847         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
1848         (WebCore::imageDecoderAssetOptions):
1849         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
1850         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
1851         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
1852         (WebCore::ImageDecoderAVFObjC::setExpectedContentSize):
1853
1854 2017-10-12  Matt Rajca  <mrajca@apple.com>
1855
1856         Add API support for quirk that lets an arbitrary click allow auto-play.
1857         https://bugs.webkit.org/show_bug.cgi?id=178227
1858
1859         Reviewed by Alex Christensen.
1860
1861         Added API test.
1862         
1863         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
1864         an arbitrary click allow auto-play via website policies.
1865
1866         * html/MediaElementSession.cpp:
1867         (WebCore::needsArbitraryUserGestureAutoplayQuirk):
1868         * loader/DocumentLoader.h:
1869
1870 2017-10-16  Chris Dumez  <cdumez@apple.com>
1871
1872         DOMQuad.p1 / p2 / p3 / p4 should behave as [SameObject]
1873         https://bugs.webkit.org/show_bug.cgi?id=178366
1874
1875         Reviewed by Youenn Fablet.
1876
1877         DOMQuad.p1 / p2 / p3 / p4 should behave as [SameObject]. We attempted to do so using JSDOMQuad::visitAdditionalChildren()
1878         but the code did not work because we failed to generate a "isReachableFromOpaqueRoots()" function for JSDOMPoint.
1879
1880         Test: fast/css/DOMQuad-points-SameObject.html
1881
1882         * dom/DOMPoint.idl:
1883
1884 2017-10-16  Andy Estes  <aestes@apple.com>
1885
1886         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
1887         https://bugs.webkit.org/show_bug.cgi?id=178191
1888         <rdar://problem/34906367>
1889
1890         Reviewed by Tim Horton.
1891
1892         Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
1893
1894         * Modules/applepay/ApplePayError.idl:
1895         * Modules/applepay/ApplePayPaymentContact.h:
1896         * Modules/applepay/ApplePayPaymentContact.idl:
1897         * Modules/applepay/ApplePaySessionPaymentRequest.h:
1898         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1899         (WebCore::subLocality):
1900         (WebCore::setSubLocality):
1901         (WebCore::subAdministrativeArea):
1902         (WebCore::setSubAdministrativeArea):
1903         (WebCore::convert):
1904
1905 2017-10-16  Alex Christensen  <achristensen@webkit.org>
1906
1907         Allow modern decoding of URLs
1908         https://bugs.webkit.org/show_bug.cgi?id=178265
1909
1910         Reviewed by Chris Dumez.
1911
1912         * platform/URL.h:
1913         (WebCore::URL::decode):
1914
1915 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
1916
1917         Unreviewed, rolling out r223425.
1918
1919         This change broke internal builds.
1920
1921         Reverted changeset:
1922
1923         "Remove unnecessary include from Document.h"
1924         https://bugs.webkit.org/show_bug.cgi?id=178247
1925         https://trac.webkit.org/changeset/223425
1926
1927 2017-10-16  Maureen Daum  <mdaum@apple.com>
1928
1929         If an origin doesn't have databases in the Databases table we should still remove its information from disk in DatabaseTracker::deleteOrigin()
1930         https://bugs.webkit.org/show_bug.cgi?id=178281
1931         <rdar://problem/34576132>
1932
1933         Reviewed by Brent Fulgham.
1934
1935         New test:
1936         DatabaseTracker.DeleteOriginWithMissingEntryInDatabasesTable
1937
1938         * Modules/webdatabase/DatabaseTracker.cpp:
1939         (WebCore::DatabaseTracker::deleteOrigin):
1940         If databaseNames is empty, don't bail early. Instead, delete everything in the directory
1941         containing the databases for this origin. This condition indicates that we previously
1942         tried to remove the origin but didn't get all of the way through the deletion process.
1943         Because we have lost track of the databases for this origin, we can assume that no
1944         other process is accessing them. This means it should be safe to delete them outright.
1945
1946 2017-10-16  Youenn Fablet  <youenn@apple.com>
1947
1948         [FETCH] Remove Request.type getter
1949         https://bugs.webkit.org/show_bug.cgi?id=177798
1950
1951         Reviewed by Chris Dumez.
1952
1953         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-type-attribute-historical.html
1954                imported/w3c/web-platform-tests/fetch/api/request/url-encoding.html
1955
1956         Removing FetchRequest type getter.
1957         Merging Type and Destination as per https://fetch.spec.whatwg.org/#concept-request-destination.
1958         Setting destination of request within CachedResourceLoader as this will be useful to Service Workers.
1959
1960         * Modules/fetch/FetchRequest.h:
1961         * Modules/fetch/FetchRequest.idl:
1962         * loader/FetchOptions.h:
1963         (WebCore::FetchOptions::isolatedCopy const):
1964         (WebCore::FetchOptions::FetchOptions):
1965         (WebCore::FetchOptions::encode const):
1966         (WebCore::FetchOptions::decode):
1967         * loader/ThreadableLoader.cpp:
1968         (WebCore::ThreadableLoaderOptions::isolatedCopy const):
1969         * loader/cache/CachedResourceLoader.cpp:
1970         (WebCore::CachedResourceLoader::requestImage):
1971         (WebCore::CachedResourceLoader::requestFont):
1972         (WebCore::CachedResourceLoader::requestTextTrack):
1973         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
1974         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1975         (WebCore::CachedResourceLoader::requestScript):
1976         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
1977         (WebCore::CachedResourceLoader::requestMedia):
1978         (WebCore::CachedResourceLoader::requestIcon):
1979         (WebCore::CachedResourceLoader::requestRawResource):
1980         (WebCore::CachedResourceLoader::requestBeaconResource):
1981         (WebCore::CachedResourceLoader::requestMainResource):
1982         * loader/cache/CachedResourceRequest.cpp:
1983         (WebCore::CachedResourceRequest::setDestinationIfNotSet):
1984         * loader/cache/CachedResourceRequest.h:
1985
1986 2017-10-15  Ryosuke Niwa  <rniwa@webkit.org>
1987
1988         Cannot access images included in the content pasted from Microsoft Word
1989         https://bugs.webkit.org/show_bug.cgi?id=124391
1990         <rdar://problem/26862741>
1991
1992         Reviewed by Antti Koivisto.
1993
1994         The bug is caused by the fact Microsoft Word generates HTML content which references an image using file URL.
1995         Because the websites don't have access to arbtirary file URLs, this prevents editors such as TinyMCE to save
1996         those images.
1997
1998         This patch fixes the problem by converting file URLs for images and all other subresources in the web archive
1999         generated by Microsoft Word by blob URLs like r222839 for RTF/RTFD and r222119 for images.
2000
2001         To avoid revealing privacy sensitive information such as the absolute local file path to the user's home directory
2002         Microsoft Word and other applications in the system includes in the web archive placed in the system pasteboard,
2003         this patch also introduces the mechanism to sanitize when the HTML content is read by DataTransfer's getData.
2004
2005         This patch also introduces the sanitization for when writing HTML into the pasteboard since other applications
2006         in the syste which is capable to processing web archives are not necessarily equipped to pretect itself and the
2007         rest of the system from potentially dangerous JavaScript included in the web archive placed in the system pasteboard.
2008
2009         Finally, this patch expands the list of clipboard types that are exposed as "text/html" to the Web platform by
2010         adding the capability to convert RTF, RTFD, and web archive into HTML markup by introducing WebContentMarkupReader,
2011         a new subclass of PasteboardWebContentReader which creates a HTML markup instead of a document fragment. Most of
2012         the sanitization process happens in this new class, and will be expanded to WebContentReader to make pasting safer.
2013
2014         Tests: editing/pasteboard/data-transfer-get-data-on-pasting-html-uses-blob-url.html
2015                editing/pasteboard/data-transfer-set-data-sanitizes-html-when-copying-in-null-origin.html
2016                editing/pasteboard/data-transfer-set-data-sanitizes-html-when-copying.html
2017                editing/pasteboard/data-transfer-set-data-sanitlize-html-when-dragging-in-null-origin.html
2018                http/tests/security/clipboard/copy-paste-html-across-origin-sanitizes-html.html
2019                CopyHTML.Sanitizes
2020                DataInteractionTests.DataTransferSanitizeHTML
2021                PasteRTF.ExposesHTMLTypeInDataTransfer
2022                PasteRTFD.ExposesHTMLTypeInDataTransfer
2023                PasteRTFD.ImageElementUsesBlobURLInHTML
2024                PasteWebArchive.ExposesHTMLTypeInDataTransfer
2025
2026         * dom/DataTransfer.cpp:
2027         (WebCore::originIdentifierForDocument): Moved to Document::originIdentifierForPasteboard.
2028         (WebCore::DataTransfer::createForCopyAndPaste):
2029         (WebCore::DataTransfer::getDataForItem const): Use WebContentMarkupReader read HTMl content so that we can read
2030         web arhive, RTF, and RTFD as text/html.
2031         (WebCore::DataTransfer::getData const):
2032         (WebCore::DataTransfer::setData):
2033         (WebCore::DataTransfer::setDataFromItemList): Sanitize the HTML before placing into the system pasteboard.
2034         (WebCore::DataTransfer::createForDragStartEvent):
2035         (WebCore::DataTransfer::createForDrop):
2036         (WebCore::DataTransfer::createForUpdatingDropTarget):
2037         * dom/DataTransfer.h:
2038         * dom/DataTransfer.idl:
2039         * dom/DataTransferItem.cpp:
2040         (WebCore::DataTransferItem::getAsString const):
2041         * dom/Document.cpp:
2042         (WebCore::Document::originIdentifierForPasteboard): Renamed from uniqueIdentifier. Moved the code to use the origin
2043         string and then falling back to the UUID here from originIdentifierForDocument in DataTransfer.cpp.
2044         * dom/Document.h:
2045         * editing/WebContentReader.cpp:
2046         (WebCore::WebContentMarkupReader::shouldSanitize const): Added.
2047         * editing/WebContentReader.h:
2048         (WebCore::WebContentMarkupReader): Added.
2049         (WebCore::WebContentMarkupReader::WebContentMarkupReader):
2050         * editing/cocoa/WebContentReaderCocoa.mm:
2051         (WebCore::createFragmentFromWebArchive): Extracted out of WebContentReader::readWebArchive to share code.
2052         (WebCore::WebContentReader::readWebArchive):
2053         (WebCore::WebContentMarkupReader::readWebArchive): Added. Reads the web archive, replace all subresource URLs by
2054         blob URLs, and re-generate the markup using our copy & paste code. The last step is requied to strip away any privacy
2055         sensitive information as well as potentially dangerous JavaScript code.
2056         (WebCore::stripMicrosoftPrefix): Extracted out of WebContentReader::readHTML to share code.
2057         (WebCore::WebContentReader::readHTML):
2058         (WebCore::WebContentMarkupReader::readHTML): Added. Only sanitize the markup when it comes from a different origin.
2059         (WebCore::WebContentReader::readRTFD): Added a nullity check for frame.document().
2060         (WebCore::WebContentMarkupReader::readRTFD): Added.
2061         (WebCore::WebContentMarkupReader::readRTF): Added.
2062         * editing/markup.h:
2063         * editing/markup.cpp:
2064         (WebCore::createPageForSanitizingWebContent): Added.
2065         (WebCore::sanitizeMarkup): Added. This function "pastes" the markup into a new isolated document then reserializes
2066         using our serialization code for copy. It strips away all invisible information such as comments, and strips away
2067         event handlers and script elements to remove potentially dangerous scripts.
2068         * platform/Pasteboard.h:
2069         * platform/ios/PasteboardIOS.mm:
2070         (WebCore::Pasteboard::readPasteboardWebContentDataForType): Now that this code can be called by DataTransfer, added
2071         the checks for the change count to make sure we stop letting web content read if the pasteboard had been changed by
2072         some other applications. To do this, turned this function into a member of Pasteboard. Also changed the return type
2073         to an enum with tri-state to exist the loop early in the call sites.
2074         (WebCore::Pasteboard::read):
2075         (WebCore::Pasteboard::readRespectingUTIFidelities):
2076         * platform/ios/PlatformPasteboardIOS.mm:
2077         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Treat RTF, RTFD, and web archive as HTML.
2078         * platform/mac/PasteboardMac.mm:
2079         (WebCore::Pasteboard::read): Add the change count checks now that this code can be called by DataTransfer.
2080         * platform/mac/PlatformPasteboardMac.mm:
2081         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Treat RTF, RTFD, and web archive as HTML.
2082
2083 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
2084
2085         Unreviewed attempt to fix the Windows debug build.
2086
2087         * Modules/webdatabase/DatabaseTracker.cpp:
2088         (WebCore::DatabaseTracker::deleteOrigin):
2089
2090 2017-10-16  Chris Dumez  <cdumez@apple.com>
2091
2092         Log using differential privacy domains where the WebContent process crashes
2093         https://bugs.webkit.org/show_bug.cgi?id=178346
2094         <rdar://problem/33293830>
2095
2096         Reviewed by Alex Christensen.
2097
2098         Add new diagnostic logging key for domain causing crashes.
2099
2100         * page/DiagnosticLoggingKeys.cpp:
2101         (WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
2102         * page/DiagnosticLoggingKeys.h:
2103
2104 2017-10-16  Sam Weinig  <sam@webkit.org>
2105
2106         [Settings] Remove all custom code from Settings.h/cpp
2107         https://bugs.webkit.org/show_bug.cgi?id=178330
2108
2109         Reviewed by Simon Fraser.
2110
2111         Removes the two remaining functions out of Settings paving the way
2112         for the file to be generated.
2113         
2114         - pageDestroyed was moved down into SettingsBase.
2115         - effectiveFrameFlattening was moved to FrameView (to reduce the need
2116           for additional includes, the FrameFlattening enum was converted to
2117           an enum class to allow it to be forward declared).
2118           
2119         Also moves default values into SettingsDefaultValues.h
2120
2121         * WebCore.xcodeproj/project.pbxproj:
2122         
2123             Add new files.
2124         
2125         * page/FrameView.cpp:
2126         * page/FrameView.h:
2127
2128             Move effectiveFrameFlattening function here from Settings.
2129
2130         * page/Settings.cpp:
2131         * page/Settings.h:
2132
2133             Move effectiveFrameFlattening, pageDestroyed and default values out.
2134
2135         * page/Settings.in:
2136         
2137             Update for turning FrameFlattening into an enum class.
2138         
2139         * page/SettingsBase.h:
2140
2141             Turn FrameFlattening into an enum class and move pageDestroyed here.
2142
2143         * page/SettingsDefaultValues.h: Added.
2144
2145             Move all the default values from Settings here.
2146
2147         * rendering/RenderFrameSet.cpp:
2148         * rendering/RenderIFrame.cpp:
2149         * rendering/RenderView.cpp:
2150
2151             Get effectiveFrameFlattening from the FrameView.
2152
2153         * testing/InternalSettings.cpp:
2154         * testing/InternalSettings.h:
2155         
2156             Update now that FrameFlattening is an enum class.
2157
2158 2017-10-16  Maureen Daum  <mdaum@apple.com>
2159
2160         If we fail to delete any database file, don't remove its information from the tracker database
2161         <rdar://problem/34576132> and https://bugs.webkit.org/show_bug.cgi?id=178251
2162
2163         Reviewed by Brady Eidson.
2164
2165         New tests:
2166         DatabaseTracker.DeleteDatabase
2167         DatabaseTracker.DeleteDatabaseWhenDatabaseDoesNotExist
2168         DatabaseTracker.DeleteOrigin
2169         DatabaseTracker.DeleteOriginWhenDeletingADatabaseFails
2170         DatabaseTracker.DeleteOriginWhenDatabaseDoesNotExist
2171
2172         * Modules/webdatabase/DatabaseTracker.cpp:
2173         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
2174         If the database doesn't exist, we previously deleted it but failed to remove the
2175         information from the tracker database. We still want to delete all of the information
2176         associated with this database from the tracker database, so add it to databaseNamesToDelete.
2177         (WebCore::DatabaseTracker::deleteOrigin):
2178         If a database doesn't exist, don't try to delete it. We don't need to, but more
2179         importantly, deleteDatabaseFile() will fail if the database doesn't exist, which
2180         will cause us to incorrectly think we failed to remove database information from disk.
2181         If we actually fail to delete any database file, return before we remove the origin
2182         information from the tracker database so we don't lose track of the database.
2183         (WebCore::DatabaseTracker::deleteDatabase):
2184         If a database doesn't exist, don't try to delete it. We don't need to, but also it
2185         will cause us to incorrectly think that we were unable to delete a database, so we
2186         would bail before we remove the database information from the tracker database. We
2187         want to remove the database information from the tracker database because the database
2188         doesn't exist.
2189         * Modules/webdatabase/DatabaseTracker.h:
2190         Expose fullPathForDatabase() for use by tests.
2191         * platform/Logging.h:
2192         Add a logging channel.
2193
2194 2017-10-16  Alex Christensen  <achristensen@webkit.org>
2195
2196         Remove unnecessary include from Document.h
2197         https://bugs.webkit.org/show_bug.cgi?id=178247
2198
2199         Reviewed by Darin Adler.
2200
2201         * dom/Document.cpp:
2202         (WebCore::Document::hasTouchEventHandlers const):
2203         (WebCore::Document::touchEventTargetsContain const):
2204         * dom/Document.h:
2205         (WebCore::Document::hasTouchEventHandlers const): Deleted.
2206         (WebCore::Document::touchEventTargetsContain const): Deleted.
2207
2208 2017-10-16  Alex Christensen  <achristensen@webkit.org>
2209
2210         Fix iOS build after r223422
2211         https://bugs.webkit.org/show_bug.cgi?id=178251
2212
2213         * Modules/webdatabase/DatabaseManager.h:
2214
2215 2017-10-16  Maureen Daum  <mdaum@apple.com>
2216
2217         We should wrap the removal of information from the tracker database in a transaction in DatabaseTracker::deleteOrigin()
2218         https://bugs.webkit.org/show_bug.cgi?id=178274
2219         <rdar://problem/34576132>
2220
2221         Reviewed by Tim Horton.
2222
2223         * Modules/webdatabase/DatabaseTracker.cpp:
2224         (WebCore::DatabaseTracker::deleteOrigin):
2225         Wrap the removal of information from the tracker database in a transaction so that
2226         we don't end up in a case where only one of the tables contains information about
2227         an origin.
2228         If anything goes wrong when we're modifying the tracker database, rollback the transaction
2229         before bailing.
2230
2231 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
2232
2233         Unreviewed, rolling out r223419.
2234
2235         This change broke the Windows build.
2236
2237         Reverted changeset:
2238
2239         "If we fail to delete any database file, don't remove its
2240         information from the tracker database"
2241         https://bugs.webkit.org/show_bug.cgi?id=178251
2242         https://trac.webkit.org/changeset/223419
2243
2244 2017-10-16  Maureen Daum  <mdaum@apple.com>
2245
2246         If we fail to delete any database file, don't remove its information from the tracker database
2247         <rdar://problem/34576132> and https://bugs.webkit.org/show_bug.cgi?id=178251
2248
2249         Reviewed by Brady Eidson.
2250
2251         New tests:
2252         DatabaseTracker.DeleteDatabase
2253         DatabaseTracker.DeleteDatabaseWhenDatabaseDoesNotExist
2254         DatabaseTracker.DeleteOrigin
2255         DatabaseTracker.DeleteOriginWhenDeletingADatabaseFails
2256         DatabaseTracker.DeleteOriginWhenDatabaseDoesNotExist
2257
2258         * Modules/webdatabase/DatabaseTracker.cpp:
2259         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
2260         If the database doesn't exist, we previously deleted it but failed to remove the
2261         information from the tracker database. We still want to delete all of the information
2262         associated with this database from the tracker database, so add it to databaseNamesToDelete.
2263         (WebCore::DatabaseTracker::deleteOrigin):
2264         If a database doesn't exist, don't try to delete it. We don't need to, but more
2265         importantly, deleteDatabaseFile() will fail if the database doesn't exist, which
2266         will cause us to incorrectly think we failed to remove database information from disk.
2267         If we actually fail to delete any database file, return before we remove the origin
2268         information from the tracker database so we don't lose track of the database.
2269         (WebCore::DatabaseTracker::deleteDatabase):
2270         If a database doesn't exist, don't try to delete it. We don't need to, but also it
2271         will cause us to incorrectly think that we were unable to delete a database, so we
2272         would bail before we remove the database information from the tracker database. We
2273         want to remove the database information from the tracker database because the database
2274         doesn't exist.
2275         * Modules/webdatabase/DatabaseTracker.h:
2276         Expose fullPathForDatabase() for use by tests.
2277         * platform/Logging.h:
2278         Add a logging channel.
2279
2280 2017-10-16  Brent Fulgham  <bfulgham@apple.com>
2281
2282         REGRESSION(223307): ASSERTION in WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution
2283         https://bugs.webkit.org/show_bug.cgi?id=178342
2284         <rdar://problem/35008505>
2285
2286         Reviewed by Chris Dumez.
2287
2288         In r223307 I mistakenly used 'topDocument->topDocument()' because of a copy/paste error. I should have just used
2289         'topDocument'.
2290
2291         Tests: CommandBackForwardTestWKWebView in TestWebKitAPI.
2292
2293         * loader/ResourceLoadObserver.cpp:
2294         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): We might enter this routine at a time
2295         where there is no page. If so, we should return early and not log credit.
2296         * page/EventHandler.cpp:
2297         (WebCore::EventHandler::keyEvent): Correct the argument passed to the log function.
2298
2299 2017-10-15  Filip Pizlo  <fpizlo@apple.com>
2300
2301         Make some asserts into release asserts
2302         https://bugs.webkit.org/show_bug.cgi?id=178324
2303
2304         Reviewed by Saam Barati.
2305
2306         No new tests because no change in behavior.
2307         
2308         This introduces some release asserts. Perf testing shows that it's neutral. So, we get some extra
2309         safety without losing any perf.
2310
2311         * dom/ContainerNodeAlgorithms.cpp:
2312         (WebCore::notifyChildNodeInserted):
2313         * dom/Document.cpp:
2314         (WebCore::Document::adoptNode):
2315         (WebCore::Document::frameDestroyed):
2316         (WebCore::Document::attachToCachedFrame):
2317         (WebCore::Document::detachFromCachedFrame):
2318         (WebCore::Document::prepareForDestruction):
2319         (WebCore::Document::dispatchWindowEvent):
2320         (WebCore::Document::dispatchWindowLoadEvent):
2321         (WebCore::Document::applyQuickLookSandbox):
2322         * dom/DocumentOrderedMap.cpp:
2323         (WebCore::DocumentOrderedMap::add):
2324         (WebCore::DocumentOrderedMap::remove):
2325         (WebCore::DocumentOrderedMap::get const):
2326         (WebCore:: const):
2327         * dom/Node.cpp:
2328         (WebCore::Node::~Node):
2329         (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope):
2330         (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall):
2331         (WebCore::moveNodeToNewDocument):
2332         (WebCore::moveShadowTreeToNewDocument):
2333         (WebCore::Node::moveTreeToNewScope):
2334         (WebCore::Node::didMoveToNewDocument):
2335         (WebCore::Node::dispatchSubtreeModifiedEvent):
2336         (WebCore::Node::dispatchDOMActivateEvent):
2337
2338 2017-10-16  Alejandro G. Castro  <alex@igalia.com>
2339
2340         Make RealtimeIncomingAudioSources and RealtimeOutgoingAudioSources port agnostic
2341         https://bugs.webkit.org/show_bug.cgi?id=177928
2342
2343         Reviewed by Youenn Fablet.
2344
2345         Refactor the RealtimeIncomingAudioSource and RealtimeOutgoingAudioSource classes,
2346         move the mac specific code to a different class. This way we can use them from
2347         other ports.
2348
2349         No new tests, we are not adding new functionality just refactoring.
2350
2351         * CMakeLists.txt:
2352         * WebCore.xcodeproj/project.pbxproj:
2353         * platform/mediastream/RealtimeIncomingAudioSource.cpp: Copied from Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h. Just the port agnostic parts.
2354         * platform/mediastream/RealtimeIncomingAudioSource.h: Copied from Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h. Ditto.
2355         * platform/mediastream/RealtimeOutgoingAudioSource.cpp: Copied from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp. Ditto.
2356         * platform/mediastream/RealtimeOutgoingAudioSource.h: Copied from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h. Ditto.
2357         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp: Added, it adds Cocoa code parts from original Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp.
2358         (WebCore::RealtimeIncomingAudioSource::create): Moved this function from the RealtimeOutgoingAudioSource.cpp file to avoid including the Cocoa file there.
2359         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h: Added Cocoa code from original Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h.
2360         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp: Added Cocoa code from original Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp.
2361         (WebCore::RealtimeOutgoingAudioSource::create): Moved this function from the RealtimeOutgoingAudioSource.cpp file to avoid including the Cocoa file there.
2362         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h: Added Cocoa code from the original Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h.
2363
2364 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2365
2366         Unreviewed, fix the tvOS build after r223340.
2367
2368         Add a new #define in PlatformPasteboardIOS.mm for item provider support, and guard usages of
2369         WebItemProviderPasteboard using it.
2370
2371         * platform/ios/PlatformPasteboardIOS.mm:
2372         (WebCore::pasteboardMayContainFilePaths):
2373         (WebCore::PlatformPasteboard::readURL):
2374
2375 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
2376
2377         Unreviewed, rolling out r223271.
2378
2379         This change introduced LayoutTest failures on WK1.
2380
2381         Reverted changeset:
2382
2383         "Use asynchronous ResourceHandleClient calls for WebKit1"
2384         https://bugs.webkit.org/show_bug.cgi?id=160677
2385         https://trac.webkit.org/changeset/223271
2386
2387 2017-10-16  Alejandro G. Castro  <alex@igalia.com>
2388
2389         Make RealtimeIncomingVideoSources and RealtimeOutgoingVideoSources port agnostic
2390         https://bugs.webkit.org/show_bug.cgi?id=177869
2391
2392         Reviewed by Youenn Fablet.
2393
2394         Refactor the RealtimeIncomingVideoSource and RealtimeOutgoingVideoSource classes,
2395         move the cocoa specific code to a different class. This way we can use them from
2396         other ports.
2397
2398         No new functionality, just a refactor.
2399
2400         * CMakeLists.txt:
2401         * WebCore.xcodeproj/project.pbxproj:
2402         * platform/mediastream/RealtimeIncomingVideoSource.cpp: Moved from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h. Just the port agnostic parts.
2403         * platform/mediastream/RealtimeIncomingVideoSource.h: Moved from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h. DItto
2404         * platform/mediastream/RealtimeOutgoingVideoSource.cpp: Moved from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp. Ditto
2405         * platform/mediastream/RealtimeOutgoingVideoSource.h: Moved from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h. Ditto
2406         * platform/mediastream/mac/RealtimeIncomingVideoSourceMac.cpp: Added, it adds the Cocoa specific parts from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.cpp.
2407         (WebCore::RealtimeIncomingVideoSource::create): Moved this function from the base class, it allows avoiding the include.
2408         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: Added, cocoa dependent code from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h.
2409         (WebCore::RealtimeOutgoingVideoSource::create): Moved this funtion from the base class, now we can use the Cocoa create without including it in the base class.
2410         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Added, cocoa dependent code.
2411         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: Added, cocoa dependent code.
2412
2413 2017-10-16  Manuel Rego Casasnovas  <rego@igalia.com>
2414
2415         Don't use intrinsic width if our container's width is zero
2416         https://bugs.webkit.org/show_bug.cgi?id=178073
2417
2418         Reviewed by Sergio Villar Senin.
2419
2420         Based on Blink r173212 by <robhogan@gmail.com>.
2421         https://chromium.googlesource.com/chromium/src/+/1592e8a1e8e56dfa6e5d709c50b129ae659c2fad
2422
2423         Since at least r798 we use a replaced element's intrinsic width
2424         if its containing block has a width of zero. As a result our rendering
2425         of width100percent-image.html has disagreed with all other browsers
2426         and we display replaced elements when they should be invisible.
2427
2428         Test: fast/replaced/container-width-zero.html
2429
2430         * rendering/RenderBox.cpp:
2431         (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
2432         If our container has zero width then let our width be zero too.
2433
2434 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2435
2436         On ToT, event.dataTransfer.getData("text/uri-list") returns an empty string when dragging an image
2437         https://bugs.webkit.org/show_bug.cgi?id=178301
2438         <rdar://problem/34990050>
2439
2440         Reviewed by Darin Adler.
2441
2442         After r222656, we consider images on the pasteboard to be files. This causes DataTransfer.getData to return the
2443         empty string for all types, which brings back https://bugs.webkit.org/show_bug.cgi?id=170637. To allow pages to
2444         access the URL part of a dragged image, we exempt "text/uri-list" from our heurstics to hide pasteboard data
2445         which may contain files, and return the URL as long as its protocol is either HTTP or HTTPS.
2446
2447         Tweaked an existing layout test to cover this scenario, as well as the scenario in which the dragged image links
2448         to a file URL (in which case we should avoid exposing the data).
2449
2450         Test: editing/pasteboard/drag-drop-href-as-url.html
2451               DataInteractionTests.DataTransferGetDataWhenDroppingImageWithHTTPURL
2452
2453         * dom/DataTransfer.cpp:
2454         (WebCore::DataTransfer::getDataForItem const):
2455
2456         When the pasteboard contains files, allow data for "text/uri-list" to be returned, as long as the URL string has
2457         a white-listed protocol (currently, this is just http and https).
2458
2459         (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
2460         (WebCore::DataTransfer::setData):
2461         (WebCore::DataTransfer::types const):
2462
2463         When the pasteboard contains files, allow "text/uri-list" to be added, alongside the "Files" type, if it would
2464         have been exposed in the list of safe DOM types.
2465
2466         * dom/DataTransfer.h:
2467         * platform/Pasteboard.cpp:
2468         (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):
2469
2470         Add a new helper method to determine whether it is safe to expose an URL string as "text/uri-list" to bindings,
2471         if the pasteboard contains files. While this currently checks whether or not the URL is in the HTTP family, we
2472         may want to consider tweaking this to blacklist the "file" protocol instead, and allow all other valid URLs by
2473         default.
2474
2475         * platform/Pasteboard.h:
2476         * platform/PlatformPasteboard.h:
2477         * platform/ios/PlatformPasteboardIOS.mm:
2478         (WebCore::pasteboardMayContainFilePaths):
2479         (WebCore::PlatformPasteboard::stringForType const):
2480
2481         Mark stringForType as const, and also teach stringForType to return the null string for the platform URL type if
2482         the pasteboard might contain file paths.
2483
2484         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
2485
2486         Before coercing a platform type to "text/uri-list" when building the list of DOM-safe types, check that the
2487         stringForType is not the empty string, in which case we don't expose the type to the DOM at all. This ensures
2488         that in cases where the URL might reveal a file path, we don't advertise "text/uri-list" as a type. We adopt a
2489         similar strategy on iOS.
2490
2491         (WebCore::PlatformPasteboard::stringForType): Deleted.
2492         * platform/mac/PlatformPasteboardMac.mm:
2493         (WebCore::pasteboardMayContainFilePaths):
2494         (WebCore::PlatformPasteboard::stringForType const):
2495         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
2496         (WebCore::PlatformPasteboard::stringForType): Deleted.
2497
2498 2017-10-16  Frederic Wang  <fwang@igalia.com>
2499
2500         Use auto/nullptr in scrolling code
2501         https://bugs.webkit.org/show_bug.cgi?id=178306
2502
2503         Reviewed by Carlos Garcia Campos.
2504
2505         This patch modifies the scrolling code to use the auto keyword when
2506         possible. It also replaces '0' with 'nullptr' for the return value of
2507         ScrollingStateTree::stateNodeForID.
2508
2509         No new tests, behavior unchanged.
2510
2511         * page/scrolling/AsyncScrollingCoordinator.cpp:
2512         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2513         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
2514         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2515         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
2516         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2517         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2518         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
2519         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
2520         (WebCore::AsyncScrollingCoordinator::updateNodeLayer):
2521         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
2522         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
2523         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition):
2524         (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
2525         * page/scrolling/ScrollingCoordinator.cpp:
2526         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
2527         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
2528         (WebCore::ScrollingCoordinator::scrollLayerForFrameView):
2529         (WebCore::ScrollingCoordinator::headerLayerForFrameView):
2530         (WebCore::ScrollingCoordinator::footerLayerForFrameView):
2531         (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
2532         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
2533         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
2534         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
2535         (WebCore::ScrollingCoordinator::handleWheelEventPhase):
2536         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects const):
2537         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames):
2538         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText const):
2539         * page/scrolling/ScrollingStateFixedNode.cpp:
2540         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
2541         * page/scrolling/ScrollingStateStickyNode.cpp:
2542         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
2543         * page/scrolling/ScrollingStateTree.cpp:
2544         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
2545         (WebCore::ScrollingStateTree::attachNode):
2546         (WebCore::ScrollingStateTree::detachNode):
2547         (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
2548         (WebCore::ScrollingStateTree::stateNodeForID const):
2549         * page/scrolling/ScrollingTree.cpp:
2550         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2551         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
2552         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
2553         (WebCore::ScrollingTree::commitTreeState):
2554         (WebCore::ScrollingTree::updateTreeFromStateNode):
2555         * page/scrolling/ScrollingTreeNode.cpp:
2556         (WebCore::ScrollingTreeNode::enclosingFrameNode const):
2557         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2558         (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
2559         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer):
2560         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
2561         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
2562         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
2563
2564 2017-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2565
2566         A lot of "Can't stat WebCore/animation: No such file or directory" since r223328
2567         https://bugs.webkit.org/show_bug.cgi?id=178326
2568
2569         Unreviewed build fix
2570
2571         The directory WebCore/animation was removed in r223328.
2572
2573         No new tests because there is no behavior change.
2574
2575         * CMakeLists.txt: Removed animation from
2576         WebCore_INCLUDE_DIRECTORIES and WebCore_IDL_INCLUDES.
2577         * DerivedSources.make: Removed animation from VPATH and IDL_INCLUDES
2578
2579 2017-10-16  Frederic Wang  <fwang@igalia.com>
2580
2581         Replace some ScrollingTreeNode::nodeType() calls with is*Node()
2582         https://bugs.webkit.org/show_bug.cgi?id=178259
2583
2584         Reviewed by Darin Adler.
2585
2586         No new tests, behavior unchanged.
2587
2588         * page/scrolling/AsyncScrollingCoordinator.cpp:
2589         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
2590         * page/scrolling/ScrollingStateNode.h:
2591         (WebCore::ScrollingStateNode::isScrollingNode const):
2592         * page/scrolling/ScrollingTree.cpp:
2593         (WebCore::ScrollingTree::updateTreeFromStateNode):
2594         * page/scrolling/ScrollingTreeNode.cpp:
2595         (WebCore::ScrollingTreeNode::enclosingFrameNode const):
2596         * page/scrolling/ScrollingTreeNode.h:
2597         (WebCore::ScrollingTreeNode::isScrollingNode const):
2598
2599 2017-10-16  Tomas Popela  <tpopela@redhat.com>
2600
2601         DataTransfer.cpp triggers -Wunused-but-set-variable
2602         https://bugs.webkit.org/show_bug.cgi?id=178209
2603
2604         Reviewed by Wenson Hsieh.
2605
2606         Use the ASSERT_UNUSED to silence it.
2607
2608         * dom/DataTransfer.cpp:
2609         (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
2610
2611 2017-10-15  Sam Weinig  <sam@webkit.org>
2612
2613         [Settings] Split non-macro generated parts of Settings into SettingsBase base class
2614         https://bugs.webkit.org/show_bug.cgi?id=178321
2615
2616         Reviewed by Darin Adler.
2617
2618         Working towards getting generated Settings working again, but in smaller patches, split
2619         non-generated part off into SettingsBase as a first step.
2620         
2621         One function, effectiveFrameFlattening(), needs to remain in Settings for now, as it directly
2622         references a macro generated function, frameFlattening().
2623
2624         * CMakeLists.txt:
2625         * WebCore.xcodeproj/project.pbxproj:
2626         * page/Page.h:
2627         * page/Settings.cpp:
2628         * page/Settings.h:
2629         * page/SettingsBase.h: Copied from Source/WebCore/page/Settings.h.
2630         * page/cocoa/SettingsBaseCocoa.mm: Copied from Source/WebCore/page/cocoa/SettingsCocoa.mm.
2631         * page/cocoa/SettingsCocoa.mm: Removed.
2632
2633 2017-10-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2634
2635         [JSC] Perform module specifier validation at parsing time
2636         https://bugs.webkit.org/show_bug.cgi?id=178256
2637
2638         Reviewed by Darin Adler.
2639
2640         No behavior change in the current implementation.
2641
2642         * bindings/js/JSDOMWindowBase.cpp:
2643         (WebCore::JSDOMWindowBase::moduleLoaderResolve):
2644         * bindings/js/JSDOMWindowBase.h:
2645         * bindings/js/ScriptModuleLoader.cpp:
2646         (WebCore::ScriptModuleLoader::resolve):
2647         * bindings/js/ScriptModuleLoader.h:
2648
2649 2017-10-15  Chris Dumez  <cdumez@apple.com>
2650
2651         DOMTokenList shouldn't add empty attributes
2652         https://bugs.webkit.org/show_bug.cgi?id=178280
2653         <rdar://problem/34987431>
2654
2655         Reviewed by Ryosuke Niwa.
2656
2657         Follow-up to r223306, reverse the check conditions to avoid attribute
2658         lookup when possible. Also use m_tokens instead of tokens() to avoid
2659         unnecessary branch.
2660
2661         * html/DOMTokenList.cpp:
2662         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
2663
2664 2017-10-15  Darin Adler  <darin@apple.com>
2665
2666         UTF-8 decoding produces one replacement character per byte; Encoding standard requires one replacement character per illegal sequence instead
2667         https://bugs.webkit.org/show_bug.cgi?id=178207
2668
2669         Reviewed by Sam Weinig.
2670
2671         * platform/text/TextCodecUTF8.cpp:
2672         (WebCore::TextCodecUTF8::create): Deleted. Use a lambda instead.
2673         (WebCore::TextCodecUTF8::registerCodecs): Use a lambda.
2674         (WebCore::nonASCIISequenceLength): Changed to return 0 instead of 2 for the range 80-C1 since
2675         none of those are valid sequence leading characters.
2676         (WebCore::decodeNonASCIISequence): Changed the length argument to be in/out so the caller
2677         knows how much of the sequence we decoded for failure cases. Simplified the length 2 section.
2678         (WebCore::TextCodecUTF8::handleError): Deleted.
2679         (WebCore::TextCodecUTF8::handlePartialSequence): Changed this into a pair of plain functions
2680         rather than two template function specializations since the two functions are rather different.
2681         For the one-byte version, got rid of the unused arguments. For the two-byte version, got rid
2682         of the ignored return value, stopped using the handleError function since each error case
2683         needs to be handled differently. In each error case consume the entire incorrect sequence
2684         instead of just one byte.
2685         (WebCore::TextCodecUTF8::decode): Updated for the above change, and changed the non-partial
2686         incorrect sequence to consume the entire incorrect sequence instead of just one byte. Also
2687         use WTF prefixes explicitly so we don't  have to do "using namespace".
2688         (WebCore::TextCodecUTF8::encode): Got rid of unneeded type punning, and added some inline
2689         capacity to save one memory allocation when encoding shorter strings.
2690
2691         * platform/text/TextCodecUTF8.h: Use pragma once. Intialize m_partialSequenceSize where it
2692         is defined and let the compiler generate the constructor. Updated for the changes above.
2693
2694         * platform/text/TextEncoding.h: Export a constructor now used by a unit test.
2695         * platform/text/TextEncodingRegistry.h: Export newTextCodec, now used by a unit test.
2696
2697 2017-10-14  Antoine Quint  <graouts@apple.com>
2698
2699         Remove all Web Animations code
2700         https://bugs.webkit.org/show_bug.cgi?id=178273
2701
2702         Reviewed by Sam Weinig.
2703
2704         We remove all existing code related to Web Animations which does not include any functionality,
2705         only stubs. This leaves the build and runtime flags, we'll start a complete implementation from
2706         scratch.
2707
2708         * CMakeLists.txt:
2709         * DerivedSources.make:
2710         * WebCore.xcodeproj/project.pbxproj:
2711         * animation/Animatable.idl: Removed.
2712         * animation/AnimationEffect.cpp: Removed.
2713         * animation/AnimationEffect.h: Removed.
2714         * animation/AnimationEffect.idl: Removed.
2715         * animation/AnimationTimeline.cpp: Removed.
2716         * animation/AnimationTimeline.h: Removed.
2717         * animation/AnimationTimeline.idl: Removed.
2718         * animation/DocumentAnimation.cpp: Removed.
2719         * animation/DocumentAnimation.h: Removed.
2720         * animation/DocumentAnimation.idl: Removed.
2721         * animation/DocumentTimeline.cpp: Removed.
2722         * animation/DocumentTimeline.h: Removed.
2723         * animation/DocumentTimeline.idl: Removed.
2724         * animation/KeyframeEffect.cpp: Removed.
2725         * animation/KeyframeEffect.h: Removed.
2726         * animation/KeyframeEffect.idl: Removed.
2727         * animation/WebAnimation.cpp: Removed.
2728         * animation/WebAnimation.h: Removed.
2729         * animation/WebAnimation.idl: Removed.
2730         * bindings/js/JSAnimationTimelineCustom.cpp: Removed.
2731         * bindings/js/JSBindingsAllInOne.cpp:
2732         * bindings/js/WebCoreBuiltinNames.h:
2733         * dom/Element.cpp:
2734         (WebCore::Element::getAnimations): Deleted.
2735         * dom/Element.h:
2736         * dom/Element.idl:
2737
2738 2017-10-14  Devin Rousso  <webkit@devinrousso.com>
2739
2740         Web Inspector: provide a way to enable/disable event listeners
2741         https://bugs.webkit.org/show_bug.cgi?id=177451
2742
2743         Reviewed by Joseph Pecoraro.
2744
2745         Test: inspector/dom/setEventListenerDisabled.html
2746
2747         * dom/EventTarget.cpp:
2748         (WebCore::EventTarget::fireEventListeners):
2749         Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
2750         callback will not be called.
2751
2752         * inspector/InspectorDOMAgent.h:
2753         * inspector/InspectorDOMAgent.cpp:
2754         (WebCore::InspectorDOMAgent::discardBindings):
2755         (WebCore::InspectorDOMAgent::getEventListenersForNode):
2756         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
2757         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2758         (WebCore::InspectorDOMAgent::willRemoveEventListener):
2759         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
2760         Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
2761         identifying event listeners so they can be referenced from the frontend. We only add items
2762         to this mapping when `getEventListenersForNode` is called, as that is when EventListener
2763         data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
2764         for each EventListener until it is needed. Items are removed whenever an event listener is
2765         removed or when the document changes.
2766
2767         * inspector/InspectorInstrumentation.h:
2768         (WebCore::InspectorInstrumentation::isEventListenerDisabled):
2769         * inspector/InspectorInstrumentation.cpp:
2770         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
2771         (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
2772         Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
2773         actually exists. If not, don't dispatch an event to the frontend as nothing will change.
2774
2775 2017-10-14  Sam Weinig  <sam@webkit.org>
2776
2777         Remove HashCountedSet's copyToVector functions
2778         https://bugs.webkit.org/show_bug.cgi?id=178215
2779
2780         Reviewed by Daniel Bates.
2781
2782         * page/DeviceController.cpp:
2783         (WebCore::DeviceController::dispatchDeviceEvent):
2784         (WebCore::DeviceController::fireDeviceEvent):
2785         
2786             Replace use of HashCountedSet's copyToVector functions with copyToVector(hashCountedSet.values()).
2787
2788 2017-10-13  Jer Noble  <jer.noble@apple.com>
2789
2790         Performance: Skip texture upload if source image and destination texture haven't changed
2791         https://bugs.webkit.org/show_bug.cgi?id=178254
2792         <rdar://problem/34968181>
2793
2794         Reviewed by Dean Jackson.
2795
2796         Update GraphicsContext3D to track which texture is bound to which texture unit, and also to
2797         track when those bound textures have their backing stores modified. This new "seed" value
2798         will be used to determine whether a given texture which has previously had image data
2799         uploaded to it needs to be re-updated.
2800
2801         In VideoTextureCopierCV, track whether the texture's seed changed, whether the IOSurface is
2802         the same,  whether the IOSurface's seed has changed, and whether the "flipY" parameter
2803         changed since the last time the copier was asked to upload to the texture.
2804
2805         * platform/graphics/GraphicsContext3D.h:
2806         (WebCore::GraphicsContext3D::textureSeed):
2807         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture):
2808         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture):
2809         (WebCore::GraphicsContext3D::GraphicsContext3DState::setBoundTexture):
2810         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2811         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
2812         * platform/graphics/cv/VideoTextureCopierCV.h:
2813         (WebCore::VideoTextureCopierCV::lastTextureSeed):
2814         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2815         (WebCore::GraphicsContext3D::prepareTexture):
2816         (WebCore::GraphicsContext3D::bindTexture):
2817         (WebCore::GraphicsContext3D::texStorage2D):
2818         (WebCore::GraphicsContext3D::texStorage3D):
2819         (WebCore::GraphicsContext3D::framebufferTexture2D):
2820         (WebCore::GraphicsContext3D::texSubImage2D):
2821         (WebCore::GraphicsContext3D::compressedTexImage2D):
2822         (WebCore::GraphicsContext3D::compressedTexSubImage2D):
2823         (WebCore::GraphicsContext3D::createTexture):
2824         (WebCore::GraphicsContext3D::deleteTexture):
2825         (WebCore::GraphicsContext3D::texImage2DDirect):
2826
2827 2017-10-13  Per Arne Vollan  <pvollan@apple.com>
2828
2829         [Win] When built with VS2017, MiniBrowser crashes on startup.
2830         https://bugs.webkit.org/show_bug.cgi?id=175209
2831
2832         Reviewed by Daniel Bates.
2833
2834         Generated StaticStringImpl objects are not initialized compile-time with VS2017.
2835         When compiling with VS2017, the global, static, StaticStringImpl objects needs to
2836         be defined with the constexpr specifier, in order for the objects to be initialized
2837         at compile time. Since the StaticStringImpl objects will be const then, we need to
2838         be able to create an AtomicString object from a const StaticStringImpl object. 
2839         This constructor has been added to the AtomicString class.
2840
2841         No new tests, covered by existing tests. 
2842
2843         * bindings/scripts/StaticString.pm:
2844         (GenerateStrings):
2845         (GenerateStringAsserts):
2846         * dom/QualifiedName.cpp:
2847         (WebCore::createQualifiedName):
2848         * dom/QualifiedName.h:
2849         * dom/make_names.pl:
2850         (printDefinitions):
2851
2852 2017-10-13  Brent Fulgham  <bfulgham@apple.com>
2853
2854         Protect FrameView during style calculations
2855         https://bugs.webkit.org/show_bug.cgi?id=178300
2856         <rdar://problem/34869329>
2857
2858         Reviewed by Ryosuke Niwa.
2859
2860         Protect the FrameView during layout and style updates in case arbitrary script
2861         is run that might clear it.
2862
2863         Test: fast/html/marquee-reparent-check.html
2864
2865         * page/FrameView.cpp:
2866         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2867
2868 2017-10-13  Per Arne Vollan  <pvollan@apple.com>
2869
2870         Crash under ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData
2871         https://bugs.webkit.org/show_bug.cgi?id=178279
2872
2873         Reviewed by Alex Christensen.
2874
2875         Check if the connection is valid before calling ResourceHandleClient::didSendData.
2876
2877         No new tests, covered by existing tests.
2878
2879         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2880         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
2881
2882 2017-10-13  Brent Fulgham  <bfulgham@apple.com>
2883
2884         CMD+R / CMD+Q keyboard shortcuts are treated as user interaction with page
2885         https://bugs.webkit.org/show_bug.cgi?id=178183
2886         <rdar://problem/33327730>
2887
2888         Reviewed by Ryosuke Niwa.
2889
2890         Key events are granted user interaction credit (in terms of updating the last time of user
2891         interaction), even if the key event was not handled. Instead, we should defer granting
2892         access until the key event has been handled.
2893         
2894         Add a new default constructor argument to UserGestureIndicator to be used when handling key
2895         events, so we can delay a decision about whether to grant ResourceLoadStatistics
2896         'hasHadUserInteraction' until we confirm that the event was handled by the page.
2897
2898         This change does not affect other aspects of user interaction.
2899
2900         Tests: fast/events
2901                http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html
2902                http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html
2903
2904         * dom/UserGestureIndicator.cpp:
2905         (WebCore::UserGestureIndicator::UserGestureIndicator): Add check based on constructor argument.
2906         Also: Drive by fix to avoid calling 'currentToken' when not on the main thread.
2907         * dom/UserGestureIndicator.h:
2908         * page/EventHandler.cpp:
2909         (WebCore::EventHandler::keyEvent): If the key event was handled, grant user interaction credit
2910         for ResourceLoadStatistics processing.
2911         (WebCore::EventHandler::internalKeyEvent): Use the new UserGestureIndicator constructor argument.
2912
2913 2017-10-13  Chris Dumez  <cdumez@apple.com>
2914
2915         DOMTokenList shouldn't add empty attributes
2916         https://bugs.webkit.org/show_bug.cgi?id=178280
2917
2918         Reviewed by Ryosuke Niwa.
2919
2920         DOMTokenList shouldn't add empty attributes after:
2921         - https://github.com/whatwg/dom/pull/488
2922
2923         Firefox and Chrome follow the latest spec.
2924
2925         No new tests, updating existing test.
2926
2927         * html/DOMTokenList.cpp:
2928         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
2929         Implement the first step of https://dom.spec.whatwg.org/#concept-dtl-update
2930
2931 2017-10-13  Jer Noble  <jer.noble@apple.com>
2932
2933         Unreviewed build fix; wrap more functions in USE(IOSURFACE) so that
2934         they do not generate "unused function" errors.
2935
2936         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2937
2938 2017-10-13  Jer Noble  <jer.noble@apple.com>
2939
2940         One last unreviewed build fix; since the IOSurface APIs don't exist at
2941         all on the simulator, just wrap the entirety of the implementation of
2942         copyImageToPlatformTexture() in a #if USE(IOSURFACE) check.
2943
2944         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2945         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
2946
2947 2017-10-13  Jer Noble  <jer.noble@apple.com>
2948
2949         Unreviewed build fix for the previous build fix; use the right PAL path for IOSurfaceSPI.h.
2950
2951         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2952
2953 2017-10-13  Jer Noble  <jer.noble@apple.com>
2954
2955         Unreviewed build fix; add definitions for IOSurface methods missing on some platforms.
2956
2957         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2958
2959 2017-10-13  Alex Christensen  <achristensen@webkit.org>
2960
2961         Remove Editor::simplifyMarkup
2962         https://bugs.webkit.org/show_bug.cgi?id=178271
2963
2964         Reviewed by Wenson Hsieh.
2965
2966         An API test became flaky, and it turns out this isn't used anywhere, so let's remove it!
2967         It was used in Mountain Lion, Mavericks, and Yosemite, but not since then.
2968         See <rdar://problem/10726177>
2969
2970         * editing/Editor.cpp:
2971         (WebCore::Editor::simplifyMarkup): Deleted.
2972         * editing/Editor.h:
2973
2974 2017-10-13  Jer Noble  <jer.noble@apple.com>
2975
2976         Unreviewed build fix; forward declare the type of IOSurfaceRef.
2977
2978         * platform/cocoa/CoreVideoSoftLink.cpp:
2979         * platform/cocoa/CoreVideoSoftLink.h:
2980
2981 2017-10-13  Jer Noble  <jer.noble@apple.com>
2982
2983         Unreviewed build fix; add soft link macros for newly called CoreVideo methods.
2984
2985         * platform/cocoa/CoreVideoSoftLink.cpp:
2986         * platform/cocoa/CoreVideoSoftLink.h:
2987
2988 2017-10-13  Jer Noble  <jer.noble@apple.com>
2989
2990         Unreviewed build fix; add UNUSED_PARAM macros.
2991
2992         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2993         (WebCore::GraphicsContext3D::texImageIOSurface2D):
2994
2995 2017-10-13  Jer Noble  <jer.noble@apple.com>
2996
2997         Performance: do pixel conformance and texturing in a single step.
2998         https://bugs.webkit.org/show_bug.cgi?id=178219
2999         <rdar://problem/34937237>
3000
3001         Reviewed by Dean Jackson.
3002
3003         No new tests; performance improvements should have no behavior change.
3004
3005         Rather than asking the VTDecompressionSession to conform the output CVPixelBuffer into a
3006         pixel format compatible with OpenGL (& ES), don't constrain the output at all, and only do a
3007         conformance step if the output is not already compatible with OpenGL. This eliminates one
3008         copy (in hardware) operation.
3009
3010         Move the TextureCacheCV object into VideoTextureCopierCV; it will be conditionally used to
3011         create the texture if the pixel buffer is compatible.
3012
3013         Refactor copyVideoTextureToPlatformTexture(CVOpenGLTextureRef) in VideoTextureCopierCV. The
3014         new entry point, copyImageToPlatformTexture(), will attempt to use the texture cache first,
3015         and call a new common copyVideoTextureToPlatformTexture(Platform3DObject) with the result.
3016
3017         The new copyImageToPlatformTexture() will pull planar YUV frames into two textures, and combine
3018         the two with a color transfer function when drawing to the output texture.
3019
3020         * platform/graphics/GraphicsContext3D.h:
3021         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3022         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture):
3023         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3024         (WebCore::GraphicsContext3D::texImageIOSurface2D):
3025         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
3026         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
3027         * platform/graphics/cv/TextureCacheCV.h:
3028         * platform/graphics/cv/TextureCacheCV.mm:
3029         (WebCore::TextureCacheCV::textureFromImage):
3030         * platform/graphics/cv/VideoTextureCopierCV.cpp:
3031         (WebCore::pixelRangeFromPixelFormat):
3032         (WebCore::transferFunctionFromString):
3033         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
3034         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
3035         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
3036         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
3037         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
3038         * platform/graphics/cv/VideoTextureCopierCV.h:
3039
3040 2017-10-13  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3041
3042         [Readable Streams API] Align queue with spec for ReadableStreamDefaultController
3043         https://bugs.webkit.org/show_bug.cgi?id=178082
3044
3045         Reviewed by Xabier Rodriguez-Calvar.
3046
3047         Implemented new queue behavior for dequeueValue (used by ReadableStreamDefaultController),
3048         which fixes rounding errors (as described in https://github.com/whatwg/streams/pull/661).
3049         Also aligned ReadableByteStreamController queue so that both queues are implemented in
3050         the same way.
3051
3052         No new tests (covered by existing tests, especially WPT tests that now pass).
3053
3054         * Modules/streams/ReadableByteStreamInternals.js:
3055         (privateInitializeReadableByteStreamController): Aligned queue with RSDC.
3056         (readableByteStreamControllerCancel): Aligned queue with RSDC.
3057         (readableByteStreamControllerError): Aligned queue with RSDC.
3058         (readableByteStreamControllerClose): Aligned queue with RSDC.
3059         (readableByteStreamControllerHandleQueueDrain): Aligned queue with RSDC.
3060         (readableByteStreamControllerPull): Aligned queue with RSDC.
3061         (readableByteStreamControllerEnqueue): Aligned queue with RSDC.
3062         (readableByteStreamControllerEnqueueChunk): Aligned queue with RSDC.
3063         (readableByteStreamControllerProcessPullDescriptors): Aligned queue with RSDC.
3064         (readableByteStreamControllerFillDescriptorFromQueue): Aligned queue with RSDC.
3065         (readableByteStreamControllerPullInto): Aligned queue with RSDC.
3066         * Modules/streams/StreamInternals.js:
3067         (dequeueValue): Updated to match spec.
3068         * bindings/js/WebCoreBuiltinNames.h: Removed now useless "totalQueuedBytes".
3069
3070 2017-10-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3071
3072         "text/html" data is not exposed when dragging and dropping across origins
3073         https://bugs.webkit.org/show_bug.cgi?id=178253
3074         <rdar://problem/34971203>
3075
3076         Reviewed by Ryosuke Niwa.
3077
3078         Minor tweak to DataTransfer::setDataFromItemList to allow "text/html" written from bindings to transfer across
3079         origins without requiring a sanitized representation. Currently, sanitizedData is null, which limits "text/html"
3080         to being treated as custom data, inaccessible across origins. We should instead treat markup supplied via
3081         bindings the same way as we do "text/plain" supplied via bindings.
3082
3083         Modified Tests: editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html
3084                         editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html
3085
3086         * dom/DataTransfer.cpp:
3087         (WebCore::DataTransfer::setDataFromItemList):
3088
3089 2017-10-12  Brady Eidson  <beidson@apple.com>
3090
3091         SW "Hello world".
3092         https://bugs.webkit.org/show_bug.cgi?id=178187
3093
3094         Reviewed by Andy Estes.
3095
3096         No new tests (Covered by changes to existing tests).
3097
3098         With this patch, SW scripts are actually compiled and run inside a ServiceWorkerGlobalScope environment
3099         in the SW context process.
3100
3101         * WebCore.xcodeproj/project.pbxproj:
3102
3103         * bindings/js/WorkerScriptController.cpp:
3104         (WebCore::WorkerScriptController::initScript):
3105
3106         * dom/EventTargetFactory.in:
3107
3108         * workers/WorkerGlobalScope.h:
3109         (WebCore::WorkerGlobalScope::isServiceWorkerGlobalScope const):
3110
3111         * workers/service/ServiceWorkerContextData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
3112         (WebCore::ServiceWorkerContextData::isolatedCopy const):
3113         * workers/service/ServiceWorkerContextData.h:
3114         (WebCore::ServiceWorkerContextData::encode const):
3115         (WebCore::ServiceWorkerContextData::decode):
3116
3117         * workers/service/ServiceWorkerGlobalScope.cpp:
3118         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
3119         (WebCore::ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope):
3120         (WebCore::ServiceWorkerGlobalScope::registration):
3121         (WebCore::ServiceWorkerGlobalScope::eventTargetInterface const):
3122         * workers/service/ServiceWorkerGlobalScope.h:
3123         (WebCore::ServiceWorkerGlobalScope::create):
3124         (WebCore::ServiceWorkerGlobalScope::serverConnectionIdentifier const):
3125
3126         * workers/service/context/SWContextManager.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
3127         (WebCore::SWContextManager::singleton):
3128         (WebCore::SWContextManager::SWContextManager):
3129         (WebCore::SWContextManager::startServiceWorkerContext):
3130         * workers/service/context/SWContextManager.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
3131
3132         * workers/service/context/ServiceWorkerThread.cpp: Added.
3133         (WebCore::ServiceWorkerThreadProxy::sharedDummyProxy):
3134         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
3135         (WebCore::m_workerObjectProxy):
3136         (WebCore::ServiceWorkerThread::~ServiceWorkerThread):
3137         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
3138         (WebCore::ServiceWorkerThread::runEventLoop):
3139         * workers/service/context/ServiceWorkerThread.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
3140         (WebCore::ServiceWorkerThread::create):
3141         (WebCore::ServiceWorkerThread::workerObjectProxy const):
3142
3143         * workers/service/server/SWServer.cpp:
3144         (WebCore::SWServer::createWorker):
3145
3146 2017-10-12  Alex Christensen  <achristensen@webkit.org>
3147
3148         Use asynchronous ResourceHandleClient calls for WebKit1
3149         https://bugs.webkit.org/show_bug.cgi?id=160677
3150
3151         Reviewed by Brady Eidson.
3152
3153         Covered by existing tests.
3154
3155         * PlatformAppleWin.cmake:
3156         * PlatformMac.cmake:
3157         * WebCore.xcodeproj/project.pbxproj:
3158         * loader/ResourceLoader.cpp:
3159         (WebCore::ResourceLoader::willSendRequestAsync):
3160         (WebCore::ResourceLoader::didReceiveResponseAsync):
3161         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
3162         * loader/ResourceLoader.h:
3163         * loader/appcache/ApplicationCacheGroup.cpp:
3164         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
3165         (WebCore::ApplicationCacheGroup::willSendRequestAsync):
3166         (WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
3167         (WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
3168         * loader/appcache/ApplicationCacheGroup.h:
3169         * platform/network/BlobResourceHandle.cpp:
3170         (WebCore::BlobResourceHandle::continueDidReceiveResponse):
3171         (WebCore::BlobResourceHandle::getSizeForNext):
3172         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
3173         (WebCore::BlobResourceHandle::notifyResponseOnError):
3174         * platform/network/PingHandle.h:
3175         * platform/network/ResourceHandle.cpp:
3176         (WebCore::ResourceHandle::didReceiveResponse):
3177         (WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
3178         * platform/network/ResourceHandle.h:
3179         * platform/network/ResourceHandleClient.cpp:
3180         (WebCore::ResourceHandleClient::~ResourceHandleClient):
3181         (WebCore::ResourceHandleClient::willSendRequest): Deleted.
3182         (WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
3183         (WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
3184         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
3185         * platform/network/ResourceHandleClient.h:
3186         (WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
3187         (WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
3188         (WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
3189         (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
3190         * platform/network/ResourceHandleInternal.h:
3191         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3192         * platform/network/SynchronousLoaderClient.cpp:
3193         (WebCore::SynchronousLoaderClient::willSendRequestAsync):
3194         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
3195         (WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
3196         (WebCore::SynchronousLoaderClient::didFinishLoading):
3197         (WebCore::SynchronousLoaderClient::didFail):
3198         (WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
3199         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
3200         (WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
3201         * platform/network/SynchronousLoaderClient.h:
3202         * platform/network/cf/ResourceHandleCFNet.cpp:
3203         (WebCore::ResourceHandle::createCFURLConnection):
3204         (WebCore::ResourceHandle::start):
3205         (WebCore::ResourceHandle::willSendRequest):
3206         (WebCore::ResourceHandle::shouldUseCredentialStorage):
3207         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
3208         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
3209         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3210         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
3211         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
3212         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
3213         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3214         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
3215         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
3216         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
3217         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
3218         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
3219         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
3220         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
3221         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
3222         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
3223         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
3224         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
3225         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
3226         * platform/network/mac/ResourceHandleMac.mm:
3227         (WebCore::ResourceHandle::start):
3228         (WebCore::ResourceHandle::schedule):
3229         (WebCore::ResourceHandle::makeDelegate):
3230         (WebCore::ResourceHandle::delegate):
3231         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
3232         (WebCore::ResourceHandle::willSendRequest):
3233         (WebCore::ResourceHandle::continueWillSendRequest):
3234         (WebCore::ResourceHandle::continueDidReceiveResponse):
3235         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
3236         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
3237         (WebCore::ResourceHandle::continueWillCacheResponse):
3238         (WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
3239         * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
3240         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
3241         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
3242         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3243         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
3244         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
3245         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
3246         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3247         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
3248         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
3249         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
3250         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
3251
3252 2017-10-12  Chris Dumez  <cdumez@apple.com>
3253
3254         [Mac] Add support for MouseEvent.buttons
3255         https://bugs.webkit.org/show_bug.cgi?id=178214
3256
3257         Reviewed by Ryosuke Niwa.
3258
3259         Add support for MouseEvent.buttons on Mac as per:
3260         - https://www.w3.org/TR/uievents/#ref-for-dom-mouseevent-buttons-1
3261
3262         This is supported by Firefox and Chrome already.
3263
3264         No new tests, rebaselined existing test.
3265
3266         * dom/Element.cpp:
3267         (WebCore::Element::dispatchMouseEvent):
3268         * dom/MouseEvent.cpp:
3269         (WebCore::MouseEvent::create):
3270         (WebCore::MouseEvent::MouseEvent):
3271         * dom/MouseEvent.h:
3272         (WebCore::MouseEvent::buttons const):
3273         * dom/MouseEvent.idl:
3274         * dom/MouseEventInit.h:
3275         * dom/MouseEventInit.idl:
3276         * dom/SimulatedClick.cpp:
3277         * dom/WheelEvent.cpp:
3278         * page/EventHandler.cpp:
3279         (WebCore::EventHandler::dispatchDragEvent):
3280         * platform/PlatformMouseEvent.h:
3281         (WebCore::PlatformMouseEvent::buttons const):
3282         * platform/mac/PlatformEventFactoryMac.mm:
3283         (WebCore::currentlyPressedMouseButtons):
3284         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
3285
3286 2017-10-12  David Kilzer  <ddkilzer@apple.com>
3287
3288         [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
3289         <https://webkit.org/b/178226>
3290
3291         Reviewed by Chris Fleizach.
3292
3293         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3294         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
3295         - Remove unused lambda variable 'self'.
3296
3297 2017-10-12  Daniel Bates  <dabates@apple.com>
3298
3299         Mark more InlineBox member functions as const
3300         https://bugs.webkit.org/show_bug.cgi?id=178217
3301
3302         Reviewed by Andy Estes.
3303
3304         * rendering/InlineBox.cpp:
3305         (WebCore::InlineBox::locationIncludingFlipping const): Mark as const. Also fix some style
3306         nits while I am here.
3307         (WebCore::InlineBox::flipForWritingMode const): Mark as const.
3308         (WebCore::InlineBox::locationIncludingFlipping): Deleted.
3309         (WebCore::InlineBox::flipForWritingMode): Deleted.
3310         * rendering/InlineBox.h:
3311
3312 2017-10-12  Daniel Bates  <dabates@apple.com>
3313
3314         Teach InlineTextBox::clampOffset() about combined text and hyphenation
3315         https://bugs.webkit.org/show_bug.cgi?id=178032
3316
3317         Reviewed by Zalan Bujtas.
3318
3319         Treat combined text and the last character of a word halve plus hyphen as single units.
3320
3321         With regards to combined text, ideally we would allow arbitrary selection inside combined
3322         text. Currently we do not support selection of combined text. To simplify the process of
3323         adding support for selecting combined text we treat combined text as a single unit. Once
3324         we are confident that we correctly implemented such support we can re-evaluate allowing
3325         arbitrary selection of combined text.
3326
3327         With regards to treating the last character of a word halve plus hyphen as a single unit.
3328         This patch extends the targeted fix made for document markers in r223013 to all code that
3329         makes use of clamped offsets as a result the selection rect for inline boxes more accurately
3330         reflect the rectangle(s) that make up the painted selection. This is a step towards reconciling
3331         the difference between the computation of the rectangle that represents an arbitrary
3332         selection and the code that paints the active selection as part of <https://bugs.webkit.org/show_bug.cgi?id=138913>.
3333
3334         * rendering/InlineTextBox.cpp:
3335         (WebCore::InlineTextBox::localSelectionRect const): Compute text run, including combined text
3336         or hyphens due to line wrapping now that specified start and end positions are clamped with
3337         respect to combined text and hyphens (computed earlier in this function). Only measure the
3338         text represented by the selection if the start position > 0 or the end position is not equal
3339         to the length of the run.
3340         (WebCore::InlineTextBox::paint): Remove unnecessary code to fix up the selection start and
3341         end positions based on the truncation offset as this is done by clampedOffset(), called by
3342         selectionStartEnd().
3343         (WebCore::InlineTextBox::clampedOffset const): Modified to adjust the clamped offset with
3344         respect to truncation as well as treat combined text or a trailing word halve plus hyphen
3345         as single units. Assert that we are not fully truncated because it does not make sense to
3346         be computing the clamped offset in such a situation since nothing should be painted.
3347         (WebCore::InlineTextBox::selectionStartEnd const): Modified to compute the end of an inside
3348         selection using clampedOffset() to account for truncation, combined text or a hyphen. We
3349         already are using clampedOffset() when computing the start and end position for all other
3350         selection states.
3351         (WebCore::InlineTextBox::paintSelection): Compute text run, including combined text
3352         or hyphens due to line wrapping now that specified start and end positions are clamped with
3353         respect to combined text and hyphens (computed earlier in this function). Remove unnecessary
3354         code to adjust selection end point with respect to truncation, combined text, or an added
3355         hyphen now that selectionStartEnd() takes care of this (via clampedOffset()).
3356         (WebCore::InlineTextBox::paintTextSubrangeBackground): Compute text run, including combined
3357         text or hyphens due to line wrapping now that specified start and end positions are clamped
3358         with respect to combined text and hyphens (computed earlier in this function).
3359         (WebCore::InlineTextBox::paintDocumentMarker): Compute text run, including combined text now
3360         that specified start and end positions are clamped with respect to combined text (computed earlier in this function).
3361         Also remove unnecessary code to adjust end offset of the marker with respect to truncation
3362         and length of the text run as clampedOffset() now does this for us.
3363
3364 2017-10-11  Simon Fraser  <simon.fraser@apple.com>
3365
3366         Don't assert if mix-blend-mode is set to a non-separable blend mode on a composited layer
3367         https://bugs.webkit.org/show_bug.cgi?id=178196
3368         rdar://problem/34942337
3369
3370         Reviewed by Dan Bates.
3371
3372         Core Animation doesn't support non-separable blend modes (hue, saturation, color, luminosity)
3373         on layers, but don't assert if we try to use them.
3374
3375         Test: compositing/filters/blend-mode-saturation.html
3376
3377         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
3378         (PlatformCAFilters::setBlendingFiltersOnLayer):
3379
3380 2017-10-12  John Wilander  <wilander@apple.com>
3381
3382         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
3383         https://bugs.webkit.org/show_bug.cgi?id=175257
3384         <rdar://problem/33359866>
3385
3386         Reviewed by Brent Fulgham.
3387
3388         This patch was joint work between Michael Specter and John Wilander.
3389
3390         Tests: http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
3391                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
3392                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
3393                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
3394                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
<