[Web Animations] Add animations to the timeline
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-22  Antoine Quint  <graouts@apple.com>
2
3         [Web Animations] Add animations to the timeline
4         https://bugs.webkit.org/show_bug.cgi?id=178643
5
6         Reviewed by Dean Jackson.
7
8         If a timeline is provided as a parameter to the Animation constructor,
9         add it to the timeline, and remove it when the object is destroyed.
10
11         We also start the basic mechanism to dump the contents of a timeline
12         as text for testing purposes, currently only logging the number of
13         animations in a timeline and just logging the class name for animation
14         themselves.
15
16         Test: webanimations/animation-creation-addition.html
17
18         * animation/AnimationTimeline.cpp:
19         (WebCore::AnimationTimeline::description):
20         * animation/AnimationTimeline.h:
21         * animation/AnimationTimeline.idl:
22         * animation/WebAnimation.cpp:
23         (WebCore::WebAnimation::create):
24         (WebCore::WebAnimation::~WebAnimation):
25         (WebCore::WebAnimation::description):
26         * animation/WebAnimation.h:
27         * testing/Internals.cpp:
28         (WebCore::Internals::timelineDescription):
29         * testing/Internals.h:
30         * testing/Internals.idl:
31
32 2017-10-21  Zalan Bujtas  <zalan@apple.com>
33
34         [FrameView::layout cleanup] Drop allowSubtree parameter
35         https://bugs.webkit.org/show_bug.cgi?id=178623
36         <rdar://problem/35111012>
37
38         Reviewed by Sam Weinig.
39
40         This flag is only set through ::forceLayout(). Let's just convert the subtree layout
41         to full layout right before calling ::layout().
42
43         No change in functionality.
44
45         * page/FrameView.cpp:
46         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
47         (WebCore::FrameView::layout):
48         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
49         (WebCore::FrameView::forceLayout):
50         * page/FrameView.h:
51
52 2017-10-21  Joseph Pecoraro  <pecoraro@apple.com>
53
54         Web Inspector: Remove unused Console.setMonitoringXHREnabled
55         https://bugs.webkit.org/show_bug.cgi?id=178617
56
57         Reviewed by Sam Weinig.
58
59         * inspector/InspectorInstrumentation.cpp:
60         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
61         * inspector/InspectorInstrumentation.h:
62         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
63         * inspector/WebConsoleAgent.cpp:
64         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
65         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
66         * inspector/WebConsoleAgent.h:
67         Remove XHR monitoring code.
68
69         * xml/XMLHttpRequest.h:
70         * xml/XMLHttpRequest.cpp:
71         (WebCore::XMLHttpRequest::send):
72         (WebCore::XMLHttpRequest::didFinishLoading):
73         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
74         * xml/XMLHttpRequest.idl:
75         Remove now unused state on XHR and ExecState requirement for send().
76
77 2017-10-21  Dean Jackson  <dino@apple.com>
78
79         createImageBitmap with basic HTMLImageElement
80         https://bugs.webkit.org/show_bug.cgi?id=178619
81         <rdar://problem/35104118>
82
83         Reviewed by Antoine Quint.
84
85         Implement the basic infrastructure for creating
86         an ImageBitmap from an HTMLImageElement.
87
88         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap.html
89
90         * html/ImageBitmap.cpp:
91         (WebCore::ImageBitmap::createPromise): Create the image buffer
92         and draw the image into its backing store.
93         * html/ImageBitmap.h:
94
95 2017-10-21  Antoine Quint  <graouts@apple.com>
96
97         [Web Animations] Add bindings to unified sources
98         https://bugs.webkit.org/show_bug.cgi?id=178620
99
100         Reviewed by Dean Jackson.
101
102         Removing the Web Animations bindings from the WebCore target and adding them to the unified sources list instead.
103
104         * Sources.txt:
105         * WebCore.xcodeproj/project.pbxproj:
106
107 2017-10-21  Tim Horton  <timothy_horton@apple.com>
108
109         Fix the Mac CMake build
110
111         * PlatformMac.cmake:
112
113 2017-10-21  Antti Koivisto  <antti@apple.com>
114
115         Support ::before/::after pseudo elements with display:contents
116         https://bugs.webkit.org/show_bug.cgi?id=178584
117
118         Reviewed by Ryosuke Niwa.
119
120         This is cases like
121
122         ::before { display:contents; content:'foo' }
123
124         * css/StyleResolver.cpp:
125         (WebCore::StyleResolver::adjustDisplayContentsStyle): Added.
126
127             Allow display:contents on pseudo elements.
128             Factor into function.
129
130         (WebCore::StyleResolver::adjustRenderStyle):
131         * dom/PseudoElement.h:
132
133             Add a weak vector of content renderers.
134
135         * style/RenderTreePosition.h:
136         (WebCore::RenderTreePosition::moveToLastChild):
137
138             Add a way to set a valid render tree position without a node.
139
140         * style/RenderTreeUpdaterGeneratedContent.cpp:
141         (WebCore::createContentRenderers):
142
143             Take RenderTreePosition.
144
145         (WebCore::updateStyleForContentRenderers):
146
147             Update based on the content renderer vector instead of doing a tree walk.
148
149         (WebCore::removeAndDestroyContentRenderers):
150
151             Helper for destroying content renderers.
152
153         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
154
155             In the normal case create a render tree position for the pseudo element renderer and
156             use RenderTreePosition::moveToLastChild to make it a valid position. (The existing
157             RenderTreePosition interface didn't have way to move to positions in anonymous boxes)
158
159             In the case of a non box generating display:contents pseudo element, use the current
160             render tree position instead.
161
162             Ensure that pseudo element renderers are destroyed before creating the new ones since in
163             display:contents case they are not descendants of the pseudo renderer and don't get cleared
164             automatically.
165
166 2017-10-20  Zalan Bujtas  <zalan@apple.com>
167
168         [FrameView::layout cleanup] Use SetForScope to ensure layout state correctness
169         https://bugs.webkit.org/show_bug.cgi?id=178604
170         <rdar://problem/35101890>
171
172         Reviewed by Simon Fraser.
173
174         SetForScope guarantees state correctness even with nested layouts. This is a lot less
175         error prone than resetting the state value after each potential recursive call.
176
177         Covered by existing tests.
178
179         * page/FrameView.cpp:
180         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): This layout state does
181         not look too useful.
182         (WebCore::FrameView::layout):
183         * page/FrameView.h: While performPostLayoutTasks() is somewhat special since it can either be sync or async,
184         so painting should be allowed in both cases.
185
186 2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
187
188         SVGPathElement should cache the built-up Path of its non animating pathByteStream()
189         https://bugs.webkit.org/show_bug.cgi?id=178248
190
191         Reviewed by Simon Fraser.
192
193         Instead of creating a Path object from the non animating pathByteStream()
194         every time we need to updatePathFromPathElement(), the Path object can be
195         cached once it is created and used for later calls.
196
197         * html/canvas/Path2D.h: buildPathFromString() now returns a Path.
198
199         * platform/graphics/Path.h:
200         * platform/graphics/cairo/PathCairo.cpp:
201         (WebCore::Path::Path):
202         (WebCore::Path::operator=):
203         * platform/graphics/cg/PathCG.cpp:
204         (WebCore::Path::Path):
205         (WebCore::Path::operator=):
206         * platform/graphics/win/PathDirect2D.cpp:
207         (WebCore::Path::Path):
208         (WebCore::Path::operator=):
209         Define the move constructor and the move assignment operator for the the
210         Path class so a statement like "Path path = buildPathFromString()" won't 
211         go through the copy constructor and the copy assignment operator.
212
213         * rendering/style/BasicShapes.cpp:
214         (WebCore::SVGPathTranslatedByteStream::path const):
215         * rendering/svg/RenderSVGResourceClipper.cpp:
216         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
217         * rendering/svg/RenderSVGShape.cpp:
218         (WebCore::RenderSVGShape::updateShapeFromElement):
219         * rendering/svg/RenderSVGTextPath.cpp:
220         (WebCore::RenderSVGTextPath::layoutPath const):
221         * rendering/svg/SVGPathData.cpp:
222         (WebCore::pathFromCircleElement):
223         (WebCore::pathFromEllipseElement):
224         (WebCore::pathFromLineElement):
225         (WebCore::pathFromPathElement):
226         (WebCore::pathFromPolygonElement):
227         (WebCore::pathFromPolylineElement):
228         (WebCore::pathFromRectElement):
229         (WebCore::pathFromGraphicsElement):
230         (WebCore::updatePathFromCircleElement): Deleted.
231         (WebCore::updatePathFromEllipseElement): Deleted.
232         (WebCore::updatePathFromLineElement): Deleted.
233         (WebCore::updatePathFromPathElement): Deleted.
234         (WebCore::updatePathFromPolygonElement): Deleted.
235         (WebCore::updatePathFromPolylineElement): Deleted.
236         (WebCore::updatePathFromRectElement): Deleted.
237         (WebCore::updatePathFromGraphicsElement): Deleted.
238         * rendering/svg/SVGPathData.h:
239         * svg/SVGAnimateMotionElement.cpp:
240         (WebCore::SVGAnimateMotionElement::parseAttribute):
241         (WebCore::SVGAnimateMotionElement::updateAnimationPath):
242         * svg/SVGGraphicsElement.cpp:
243         (WebCore::SVGGraphicsElement::toClipPath):
244         * svg/SVGGraphicsElement.h:
245         Rename updatePathFromElement() to pathFromGraphicsElement().
246
247         * svg/SVGPathElement.cpp:
248         (WebCore::SVGPathElement::parseAttribute): Clear the cache when
249         m_pathByteStream changes.
250         (WebCore::SVGPathElement::pathForByteStream const): Caches the m_cachedPath
251         if it is null.
252         (WebCore::SVGPathElement::pathSegListChanged): Clear the cache when
253         m_pathByteStream changes.
254
255         * svg/SVGPathElement.h:
256         * svg/SVGPathUtilities.cpp:
257         (WebCore::buildPathFromString):
258         (WebCore::buildPathFromByteStream):
259         * svg/SVGPathUtilities.h:
260         Make thes buildPathFromString() and buildPathFromByteStream() return Paths.
261
262         * svg/SVGUseElement.cpp:
263         (WebCore::SVGUseElement::toClipPath):
264         * svg/SVGUseElement.h:
265         Make these toClipPath() return Path.
266
267 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
268
269         Rename insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor
270         https://bugs.webkit.org/show_bug.cgi?id=178605
271
272         Reviewed by Andy Estes.
273
274         Renamed insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor respectively
275         to make it clear that these functions can be called even when node's immediate parent didn't change.
276
277         * dom/ContainerNodeAlgorithms.cpp:
278         (WebCore::notifyNodeInsertedIntoDocument):
279         (WebCore::notifyNodeInsertedIntoTree):
280         (WebCore::notifyNodeRemovedFromDocument):
281         (WebCore::notifyNodeRemovedFromTree):
282         (WebCore::notifyChildNodeRemoved):
283         * dom/ContainerNodeAlgorithms.h:
284         * dom/Element.cpp:
285         (WebCore::Element::insertedIntoAncestor): Renamed from insertedInto.
286         (WebCore::Element::removedFromAncestor): Renamed from removedFrom.
287         * dom/Element.h:
288         * dom/Node.cpp:
289         (WebCore::Node::insertedIntoAncestor): 
290         (WebCore::Node::removedFromAncestor):
291         (WebCore::Node::removedFrom): Deleted.
292         * dom/Node.h:
293         * dom/ProcessingInstruction.cpp:
294         (WebCore::ProcessingInstruction::insertedIntoAncestor): Renamed from insertedInto.
295         (WebCore::ProcessingInstruction::removedFromAncestor): Renamed from removedFrom.
296         * dom/ProcessingInstruction.h:
297         * dom/ScriptElement.h:
298         (WebCore::ScriptElement::insertedIntoAncestor const): Renamed from insertedInto.
299         * dom/ShadowRoot.cpp:
300         (WebCore::ShadowRoot::insertedIntoAncestor): Renamed from insertedInto.
301         (WebCore::ShadowRoot::removedFromAncestor): Renamed from removedFrom.
302         * dom/ShadowRoot.h:
303         * html/FormAssociatedElement.cpp:
304         (WebCore::FormAssociatedElement::insertedIntoAncestor): Renamed from insertedInto.
305         (WebCore::FormAssociatedElement::removedFromAncestor): Renamed from removedFrom.
306         * html/FormAssociatedElement.h:
307         * html/HTMLBaseElement.cpp:
308         (WebCore::HTMLBaseElement::insertedIntoAncestor): Renamed from insertedInto.
309         (WebCore::HTMLBaseElement::removedFromAncestor): Renamed from removedFrom.
310         * html/HTMLBaseElement.h:
311         * html/HTMLBodyElement.cpp:
312         (WebCore::HTMLBodyElement::insertedIntoAncestor): Renamed from insertedInto.
313         * html/HTMLBodyElement.h:
314         * html/HTMLFormControlElement.cpp:
315         (WebCore::HTMLFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
316         (WebCore::HTMLFormControlElement::removedFromAncestor): Renamed from removedFrom.
317         * html/HTMLFormControlElement.h:
318         * html/HTMLFormControlElementWithState.cpp:
319         (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Renamed from insertedInto.
320         (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Renamed from removedFrom.
321         * html/HTMLFormControlElementWithState.h:
322         * html/HTMLFormElement.cpp:
323         (WebCore::HTMLFormElement::insertedIntoAncestor): Renamed from insertedInto.
324         (WebCore::HTMLFormElement::removedFromAncestor): Renamed from removedFrom.
325         * html/HTMLFormElement.h:
326         * html/HTMLFrameElementBase.cpp:
327         (WebCore::HTMLFrameElementBase::insertedIntoAncestor): Renamed from insertedInto.
328         * html/HTMLFrameElementBase.h:
329         * html/HTMLFrameSetElement.cpp:
330         (WebCore::HTMLFrameSetElement::insertedIntoAncestor): Renamed from insertedInto.
331         (WebCore::HTMLFrameSetElement::removedFromAncestor): Renamed from removedFrom.
332         * html/HTMLFrameSetElement.h:
333         * html/HTMLImageElement.cpp:
334         (WebCore::HTMLImageElement::insertedIntoAncestor): Renamed from insertedInto.
335         (WebCore::HTMLImageElement::removedFromAncestor): Renamed from removedFrom.
336         * html/HTMLImageElement.h:
337         * html/HTMLInputElement.cpp:
338         (WebCore::HTMLInputElement::insertedIntoAncestor): Renamed from insertedInto.
339         (WebCore::HTMLInputElement::removedFromAncestor): Renamed from removedFrom.
340         * html/HTMLInputElement.h:
341         * html/HTMLLinkElement.cpp:
342         (WebCore::HTMLLinkElement::insertedIntoAncestor): Renamed from insertedInto.
343         (WebCore::HTMLLinkElement::removedFromAncestor): Renamed from removedFrom.
344         * html/HTMLLinkElement.h:
345         * html/HTMLMapElement.cpp:
346         (WebCore::HTMLMapElement::insertedIntoAncestor): Renamed from insertedInto.
347         (WebCore::HTMLMapElement::removedFromAncestor): Renamed from removedFrom.
348         * html/HTMLMapElement.h:
349         * html/HTMLMediaElement.cpp:
350         (WebCore::HTMLMediaElement::insertedIntoAncestor): Renamed from insertedInto.
351         (WebCore::HTMLMediaElement::removedFromAncestor): Renamed from removedFrom.
352         * html/HTMLMediaElement.h:
353         * html/HTMLMetaElement.cpp:
354         (WebCore::HTMLMetaElement::insertedIntoAncestor): Renamed from insertedInto.
355         * html/HTMLMetaElement.h:
356         * html/HTMLObjectElement.cpp:
357         (WebCore::HTMLObjectElement::insertedIntoAncestor): Renamed from insertedInto.
358         (WebCore::HTMLObjectElement::removedFromAncestor): Renamed from removedFrom.
359         * html/HTMLObjectElement.h:
360         * html/HTMLOptionElement.cpp:
361         (WebCore::HTMLOptionElement::insertedIntoAncestor): Renamed from insertedInto.
362         * html/HTMLOptionElement.h:
363         * html/HTMLScriptElement.cpp:
364         (WebCore::HTMLScriptElement::insertedIntoAncestor): Renamed from insertedInto.
365         * html/HTMLScriptElement.h:
366         * html/HTMLSelectElement.cpp:
367         (WebCore::HTMLSelectElement::insertedIntoAncestor): Renamed from insertedInto.
368         * html/HTMLSelectElement.h:
369         * html/HTMLSlotElement.cpp:
370         (WebCore::HTMLSlotElement::insertedIntoAncestor): Renamed from insertedInto.
371         (WebCore::HTMLSlotElement::removedFromAncestor): Renamed from removedFrom.
372         * html/HTMLSlotElement.h:
373         * html/HTMLSourceElement.cpp:
374         (WebCore::HTMLSourceElement::insertedIntoAncestor): Renamed from insertedInto.
375         (WebCore::HTMLSourceElement::removedFromAncestor): Renamed from removedFrom.
376         * html/HTMLSourceElement.h:
377         * html/HTMLStyleElement.cpp:
378         (WebCore::HTMLStyleElement::insertedIntoAncestor): Renamed from insertedInto.
379         (WebCore::HTMLStyleElement::removedFromAncestor): Renamed from removedFrom.
380         * html/HTMLStyleElement.h:
381         * html/HTMLTextFormControlElement.cpp:
382         (WebCore::HTMLTextFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
383         * html/HTMLTextFormControlElement.h:
384         * html/HTMLTitleElement.cpp:
385         (WebCore::HTMLTitleElement::insertedIntoAncestor): Renamed from insertedInto.
386         (WebCore::HTMLTitleElement::removedFromAncestor): Renamed from removedFrom.
387         * html/HTMLTitleElement.h:
388         * html/HTMLTrackElement.cpp:
389         (WebCore::HTMLTrackElement::insertedIntoAncestor): Renamed from insertedInto.
390         (WebCore::HTMLTrackElement::removedFromAncestor): Renamed from removedFrom.
391         * html/HTMLTrackElement.h:
392         * svg/SVGElement.cpp:
393         (WebCore::SVGElement::removedFromAncestor): Renamed from removedFrom.
394         (WebCore::SVGElement::insertedIntoAncestor): Renamed from insertedInto.
395         (WebCore::SVGElement::updateRelativeLengthsInformation):
396         * svg/SVGElement.h:
397         * svg/SVGFEImageElement.cpp:
398         (WebCore::SVGFEImageElement::insertedIntoAncestor): Renamed from insertedInto.
399         (WebCore::SVGFEImageElement::removedFromAncestor): Renamed from removedFrom.
400         * svg/SVGFEImageElement.h:
401         * svg/SVGFontFaceElement.cpp:
402         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Renamed from insertedInto.
403         (WebCore::SVGFontFaceElement::removedFromAncestor): Renamed from removedFrom.
404         * svg/SVGFontFaceElement.h:
405         * svg/SVGFontFaceUriElement.cpp:
406         (WebCore::SVGFontFaceUriElement::insertedIntoAncestor): Renamed from insertedInto.
407         * svg/SVGFontFaceUriElement.h:
408         * svg/SVGImageElement.cpp:
409         (WebCore::SVGImageElement::insertedIntoAncestor): Renamed from insertedInto.
410         * svg/SVGImageElement.h:
411         * svg/SVGMPathElement.cpp:
412         (WebCore::SVGMPathElement::insertedIntoAncestor): Renamed from insertedInto.
413         (WebCore::SVGMPathElement::removedFromAncestor): Renamed from removedFrom.
414         * svg/SVGMPathElement.h:
415         * svg/SVGPathElement.cpp:
416         (WebCore::SVGPathElement::insertedIntoAncestor): Renamed from insertedInto.
417         (WebCore::SVGPathElement::removedFromAncestor): Renamed from removedFrom.
418         * svg/SVGPathElement.h:
419         * svg/SVGSVGElement.cpp:
420         (WebCore::SVGSVGElement::insertedIntoAncestor): Renamed from insertedInto.
421         (WebCore::SVGSVGElement::removedFromAncestor): Renamed from removedFrom.
422         * svg/SVGSVGElement.h:
423         * svg/SVGScriptElement.cpp:
424         (WebCore::SVGScriptElement::insertedIntoAncestor): Renamed from insertedInto.
425         * svg/SVGScriptElement.h:
426         * svg/SVGStyleElement.cpp:
427         (WebCore::SVGStyleElement::insertedIntoAncestor): Renamed from insertedInto.
428         (WebCore::SVGStyleElement::removedFromAncestor): Renamed from removedFrom.
429         * svg/SVGStyleElement.h:
430         * svg/SVGTRefElement.cpp:
431         (WebCore::SVGTRefElement::buildPendingResource):
432         (WebCore::SVGTRefElement::insertedIntoAncestor): Renamed from insertedInto.
433         (WebCore::SVGTRefElement::removedFromAncestor): Renamed from removedFrom.
434         * svg/SVGTRefElement.h:
435         * svg/SVGTextPathElement.cpp:
436         (WebCore::SVGTextPathElement::insertedIntoAncestor): Renamed from insertedInto.
437         (WebCore::SVGTextPathElement::removedFromAncestor): Renamed from removedFrom.
438         * svg/SVGTextPathElement.h:
439         * svg/SVGTitleElement.cpp:
440         (WebCore::SVGTitleElement::insertedIntoAncestor): Renamed from insertedInto.
441         (WebCore::SVGTitleElement::removedFromAncestor): Renamed from removedFrom.
442         * svg/SVGTitleElement.h:
443         * svg/SVGUseElement.cpp:
444         (WebCore::SVGUseElement::insertedIntoAncestor): Renamed from insertedInto.
445         (WebCore::SVGUseElement::removedFromAncestor): Renamed from removedFrom.
446         * svg/SVGUseElement.h:
447         * svg/animation/SVGSMILElement.cpp:
448         (WebCore::SVGSMILElement::insertedIntoAncestor): Renamed from insertedInto.
449         (WebCore::SVGSMILElement::removedFromAncestor): Renamed from removedFrom.
450         * svg/animation/SVGSMILElement.h:
451
452 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
453
454         Fix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
455         https://bugs.webkit.org/show_bug.cgi?id=178607
456
457         Reviewed by Eric Carlson.
458
459         Fixed the conditions in insertedInto and removedFrom of HTMLSourceElement and HTMLTrackElement to be
460         semantically sensisble. Since these elements are only functional when their immediate parents are
461         HTMLMediaElement and HTMLPictureElement, we have to check that its immediate parent changed, not when
462         some of its ancestor had changed by insertion or removal.
463
464         * html/HTMLSourceElement.cpp:
465         (WebCore::HTMLSourceElement::insertedInto):
466         (WebCore::HTMLSourceElement::removedFrom):
467         * html/HTMLTrackElement.cpp:
468         (WebCore::HTMLTrackElement::insertedInto):
469         (WebCore::HTMLTrackElement::removedFrom):
470
471 2017-10-20  Keith Miller  <keith_miller@apple.com>
472
473         Unreviewed, fix windows build.
474
475         * Sources.txt:
476         * WebCore.xcodeproj/project.pbxproj:
477
478 2017-10-20  Daniel Bates  <dabates@apple.com>
479
480         Use "= default" for more default constructors and destructors in WebCore
481         https://bugs.webkit.org/show_bug.cgi?id=178585
482
483         Reviewed by Alex Christensen.
484
485         Also remove some destructors that would be implicitly generated.
486
487         * Modules/applepay/PaymentMerchantSession.h:
488         (WebCore::PaymentMerchantSession::~PaymentMerchantSession): Deleted.
489         * platform/ControlStates.h:
490         (WebCore::ControlStates::~ControlStates): Deleted.
491         * platform/PlatformEvent.h:
492         (WebCore::PlatformEvent::~PlatformEvent): Use default.
493         * platform/PlatformStrategies.h:
494         (WebCore::PlatformStrategies::PlatformStrategies): Ditto.
495         * platform/image-decoders/gif/GIFImageReader.h:
496         (GIFFrameContext::GIFFrameContext):
497         (GIFFrameContext::~GIFFrameContext): Deleted.
498         (GIFImageReader::~GIFImageReader): Deleted.
499         * rendering/RenderBlockFlow.h:
500         (WebCore::RenderBlockFlow::RenderBlockFlowRareData::~RenderBlockFlowRareData): Deleted.
501
502 2017-10-20  Zalan Bujtas  <zalan@apple.com>
503
504         [FrameView::layout cleanup] Scheduling layout should be disabled for FrameView::layout
505         https://bugs.webkit.org/show_bug.cgi?id=178562
506         <rdar://problem/35089015>
507
508         Reviewed by Simon Fraser.
509
510         This patch extends the scope of m_layoutSchedulingEnabled. Now layout scheduling is disabled for the entire FrameView::layout(). 
511         A scheduled layout at the end of FrameView::layout would indicated dirty tree (which is against FrameView::layout's contract).
512
513         Covered by existing tests.
514
515         * page/FrameView.cpp:
516         (WebCore::FrameView::layout):
517
518 2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
519
520         When destroying a resource, register "only" the clients who are losing their resource as having pending resources
521         https://bugs.webkit.org/show_bug.cgi?id=178567
522         <rdar://problem/35064781>
523
524         Reviewed by Simon Fraser.
525
526         SVGResources::resourceDestroyed() will return a bool indicating whether 
527         it had a reference to the destroyed resource or not. If it returns true
528         SVGResourcesCache::resourceDestroyed() will register the client Element
529         as having pending resources.
530
531         * rendering/svg/SVGResources.cpp:
532         (WebCore::paintingResourceFromSVGPaint):
533         (WebCore::SVGResources::removeClientFromCache const):
534         (WebCore::SVGResources::resourceDestroyed):
535         (WebCore::SVGResources::buildSetOfResources):
536         (WebCore::SVGResources::resetClipper):
537         (WebCore::SVGResources::resetFilter):
538         (WebCore::SVGResources::resetMarkerStart):
539         (WebCore::SVGResources::resetMarkerMid):
540         (WebCore::SVGResources::resetMarkerEnd):
541         (WebCore::SVGResources::resetMasker):
542         (WebCore::SVGResources::resetFill):
543         (WebCore::SVGResources::resetStroke):
544         (WebCore::SVGResources::resetLinkedResource):
545         * rendering/svg/SVGResources.h:
546         (WebCore::SVGResources::isEmpty const):
547         (WebCore::SVGResources::ClipperFilterMaskerData::ClipperFilterMaskerData): Deleted.
548         (WebCore::SVGResources::MarkerData::MarkerData): Deleted.
549         (WebCore::SVGResources::FillStrokeData::FillStrokeData): Deleted.
550         * rendering/svg/SVGResourcesCache.cpp:
551         (WebCore::SVGResourcesCache::resourceDestroyed):
552
553 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
554
555         Unify the node removal code in ContainerNode and expand the coverage of NoEventDispatchAssertion
556         https://bugs.webkit.org/show_bug.cgi?id=178568
557
558         Reviewed by Antti Koivisto.
559
560         Consolidated the code to remove a child node in ContainerNode into removeAllChildrenWithScriptAssertion
561         and removeNodeWithScriptAssertion to share code and make the semantics of when it becomes unsafe to run scripts.
562
563         Also renamed getChildNodes to collectChildNodes, and made it return NodeVector instead of taking an out argument.
564
565         No new tests since there should be no behavioral changes.
566
567         * dom/ContainerNode.cpp:
568         (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added.
569         (WebCore::ContainerNode::removeNodeWithScriptAssertion): Added.
570         (WebCore::collectChildrenAndRemoveFromOldParent):
571         (WebCore::ContainerNode::takeAllChildrenFrom): Deployed removeAllChildrenWithScriptAssertion.
572         (WebCore::ContainerNode::notifyChildRemoved): Deleted. Merged into removeNodeWithScriptAssertion.
573         (WebCore::willRemoveChild): Deleted. Ditto.
574         (WebCore::willRemoveChildren): Deleted. Merged into removeAllChildrenWithScriptAssertion.
575         (WebCore::ContainerNode::removeChild): Deployed removeNodeWithScriptAssertion.
576         (WebCore::ContainerNode::parserRemoveChild): Ditto.
577         (WebCore::ContainerNode::replaceAllChildren): Deployed removeAllChildrenWithScriptAssertion. Now removes the node
578         outside executeNodeInsertionWithScriptAssertion but that's okay since executeNodeInsertionWithScriptAssertion
579         doesn't execute any code with a side effect before invoking the callback.
580         (WebCore::ContainerNode::removeChildren):
581         (WebCore::dispatchChildRemovalEvents): Refactored to take Ref<Node>&.
582         * dom/ContainerNode.h:
583         (WebCore::collectChildNodes): Renamed from getChildNodes. Also removed the useless comment about NodeVector's
584         initial size and instead prefer to webkit.org/b/80706 where the number 11 was picked.
585         * editing/ApplyStyleCommand.cpp:
586         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
587         * editing/ReplaceNodeWithSpanCommand.cpp:
588         (WebCore::swapInNodePreservingAttributesAndChildren):
589         * svg/SVGUseElement.cpp:
590         (WebCore::SVGUseElement::clearShadowTree): Added an assertion exception while tearing down the UA shadow tree.
591
592 2017-10-20  Youenn Fablet  <youenn@apple.com>
593
594         ResourceResponse should have a ServiceWorker source
595         https://bugs.webkit.org/show_bug.cgi?id=178593
596
597         Reviewed by Alex Christensen.
598
599         Covered by updated tests.
600
601         Added ResourceResponse::Source::ServiceWorker.
602         Added internals to get FetchResponse source.
603
604         * inspector/InspectorNetworkAgent.cpp:
605         (WebCore::responseSource):
606         * loader/ResourceLoader.cpp:
607         (WebCore::logResourceResponseSource):
608         * page/DiagnosticLoggingKeys.cpp:
609         (WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
610         * page/DiagnosticLoggingKeys.h:
611         * platform/network/ResourceResponseBase.h:
612         * testing/Internals.cpp:
613         (WebCore::responseSourceToString):
614         (WebCore::Internals::fetchResponseSource):
615         * testing/Internals.h:
616         * testing/Internals.idl:
617
618 2017-10-20  Andy Estes  <aestes@apple.com>
619
620         Generated serializers do not properly handle optional interface attributes
621         https://bugs.webkit.org/show_bug.cgi?id=178542
622
623         Reviewed by Sam Weinig.
624
625         * bindings/scripts/CodeGeneratorJS.pm:
626         (GenerateSerializerDefinition):
627         * bindings/scripts/test/JS/JSTestSerialization.cpp:
628         (WebCore::JSTestSerialization::serialize):
629
630 2017-10-20  Antoine Quint  <graouts@apple.com>
631
632         [Web Animations] Provide basic timeline and animation interfaces
633         https://bugs.webkit.org/show_bug.cgi?id=178526
634
635         Reviewed by Dean Jackson.
636
637         We're getting Web Animations work started by implementing a very minimal codebase which provides
638         a DocumentTimeline class which has an instance created for each Document. The parent class,
639         AnimationTimeline, allows for animations to be added and removed, and animations can be created
640         using the Animation class, with an optional timeline as parameter.
641
642         Tests: webanimations/animation-creation-basic.html
643                webanimations/document-timeline.html
644
645         * CMakeLists.txt:
646         * Configurations/FeatureDefines.xcconfig:
647         * DerivedSources.make:
648         * PlatformWin.cmake:
649         * WebCore.xcodeproj/project.pbxproj:
650         * animation/AnimationTimeline.cpp: Added.
651         (WebCore::AnimationTimeline::AnimationTimeline):
652         (WebCore::AnimationTimeline::~AnimationTimeline):
653         (WebCore::AnimationTimeline::addAnimation):
654         (WebCore::AnimationTimeline::removeAnimation):
655         * animation/AnimationTimeline.h: Added.
656         (WebCore::AnimationTimeline::isDocumentTimeline const):
657         (WebCore::AnimationTimeline::classType const):
658         * animation/AnimationTimeline.idl: Added.
659         * animation/DocumentTimeline.cpp: Added.
660         (WebCore::DocumentTimeline::create):
661         (WebCore::DocumentTimeline::DocumentTimeline):
662         * animation/DocumentTimeline.h: Added.
663         * animation/DocumentTimeline.idl: Added.
664         * animation/WebAnimation.cpp: Added.
665         (WebCore::WebAnimation::create):
666         (WebCore::WebAnimation::WebAnimation):
667         (WebCore::WebAnimation::~WebAnimation):
668         * animation/WebAnimation.h: Added.
669         * animation/WebAnimation.idl: Added.
670         * bindings/js/JSAnimationTimelineCustom.cpp: Added.
671         (WebCore::toJSNewlyCreated):
672         (WebCore::toJS):
673         * bindings/js/WebCoreBuiltinNames.h:
674         * dom/Document.cpp:
675         (WebCore::Document::timeline):
676         * dom/Document.h:
677         * dom/Document.idl:
678         * page/RuntimeEnabledFeatures.h:
679         (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const):
680
681 2017-10-20  Commit Queue  <commit-queue@webkit.org>
682
683         Unreviewed, rolling out r223744, r223750, and r223751.
684         https://bugs.webkit.org/show_bug.cgi?id=178594
685
686         These caused consistent failures in test that existed and were
687         added in the patches. (Requested by mlewis13 on #webkit).
688
689         Reverted changesets:
690
691         "[JSC] ScriptFetcher should be notified directly from module
692         pipeline"
693         https://bugs.webkit.org/show_bug.cgi?id=178340
694         https://trac.webkit.org/changeset/223744
695
696         "Unreviewed, fix changed line number in test expect files"
697         https://bugs.webkit.org/show_bug.cgi?id=178340
698         https://trac.webkit.org/changeset/223750
699
700         "Unreviewed, follow up to reflect comments"
701         https://bugs.webkit.org/show_bug.cgi?id=178340
702         https://trac.webkit.org/changeset/223751
703
704 2017-10-20  Zalan Bujtas  <zalan@apple.com>
705
706         [FrameView::layout cleanup] Move can-enter-layout logic to a separate function
707         https://bugs.webkit.org/show_bug.cgi?id=178546
708         <rdar://problem/35083894>
709
710         Reviewed by Antti Koivisto.
711
712         No change in functionality.
713
714         * page/FrameView.cpp:
715         (WebCore::FrameView::canPerformLayout const):
716         (WebCore::FrameView::layout): We already assert on certain reentrancy conditions, loggig the reason
717         does not seem to have high value.
718         * page/FrameView.h:
719
720 2017-10-20  Dean Jackson  <dino@apple.com>
721
722         Add createImageBitmap to Window and Worker
723         https://bugs.webkit.org/show_bug.cgi?id=178573
724         <rdar://problem/35092692>
725
726         Reviewed by Sam Weinig.
727
728         Implement the createImageBitmap functions that are exposed on the Window
729         and Worker objects.
730
731         Covered by the Web Platform Tests.
732
733         * html/ImageBitmap.cpp: Make sure to call suspendIfNeeded since this is
734         an ActiveDOMObject.
735         * html/ImageBitmap.h: Change the order of the classes in the Variant
736         to match the order of definitions in the IDL.
737         * page/DOMWindow.cpp:
738         (WebCore::DOMWindow::createImageBitmap): Call ImageBitmap::createPromise.
739         * page/DOMWindow.h:
740         * page/WindowOrWorkerGlobalScope.idl: Add the createImageBitmap methods.
741         * workers/WorkerGlobalScope.cpp:
742         (WebCore::WorkerGlobalScope::createImageBitmap): Call ImageBitmap::createPromise.
743         * workers/WorkerGlobalScope.h:
744
745 2017-10-20  Joanmarie Diggs  <jdiggs@igalia.com>
746
747         AX: [ATK] Events missing and state incorrect for aria-activedescendant
748         https://bugs.webkit.org/show_bug.cgi?id=178523
749
750         Reviewed by Chris Fleizach.
751
752         When the aria-activedescendant of an element changes, emit object:state-changed:focused.
753         When a focused element has a valid active descendant, do not expose the focused state on
754         the element, but rather on the active descendant. Also expose the focusable state on the
755         active descendant.
756
757         Tests: accessibility/gtk/aria-activedescendant-changed-notification.html
758                accessibility/gtk/aria-activedescendant.html
759
760         * accessibility/AccessibilityObject.cpp:
761         (WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const):
762         (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
763         * accessibility/AccessibilityObject.h:
764         * accessibility/AccessibilityRenderObject.cpp:
765         (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
766         * accessibility/atk/AXObjectCacheAtk.cpp:
767         (WebCore::AXObjectCache::postPlatformNotification):
768         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
769         (setAtkStateSetFromCoreObject):
770
771 2017-10-20  Ms2ger  <Ms2ger@igalia.com>
772
773         Add the MAX_CLIENT_WAIT_TIMEOUT_WEBGL constant to WebGL2RenderingContext.
774         https://bugs.webkit.org/show_bug.cgi?id=178572
775
776         Reviewed by Žan Doberšek.
777
778         Test: fast/canvas/webgl/webgl2/constants.html
779
780         * html/canvas/WebGL2RenderingContext.idl:
781
782 2017-10-20  Miguel Gomez  <magomez@igalia.com>
783
784         [GTK][WPE] Fix review comments on WEBPImageDecoder
785         https://bugs.webkit.org/show_bug.cgi?id=178080
786
787         Reviewed by Said Abou-Hallawa.
788
789         Properly free the demuxer in case of error, improve the code to detect the first
790         required frame to decode, fix the usage of the DecodingStatus and some styling
791         changes.
792
793         Covered by existent tests.
794
795         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
796         (WebCore::webpFrameAtIndex):
797         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
798         (WebCore::WEBPImageDecoder::decode):
799         (WebCore::WEBPImageDecoder::decodeFrame):
800         (WebCore::WEBPImageDecoder::initFrameBuffer):
801         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
802
803 2017-10-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>
804
805         [Curl] Clean up old style code in old curl files.
806         https://bugs.webkit.org/show_bug.cgi?id=178569
807
808         Reviewed by Ryosuke Niwa.
809
810         * platform/network/curl/AuthenticationChallenge.h:
811         * platform/network/curl/CertificateInfo.h:
812         * platform/network/curl/CookieJarCurl.h:
813         * platform/network/curl/CurlCacheEntry.h:
814         * platform/network/curl/CurlCacheManager.cpp:
815         (WebCore::CurlCacheManager::singleton):
816         (WebCore::CurlCacheManager::getInstance): Deleted.
817         * platform/network/curl/CurlCacheManager.h:
818         * platform/network/curl/CurlContext.cpp:
819         (WebCore::CurlContext::singleton):
820         * platform/network/curl/CurlContext.h:
821         (WebCore::CurlContext::singleton): Deleted.
822         * platform/network/curl/CurlJobManager.cpp:
823         (WebCore::CurlJobManager::singleton):
824         * platform/network/curl/CurlJobManager.h:
825         (WebCore::CurlJobManager::singleton): Deleted.
826         * platform/network/curl/CurlRequest.cpp:
827         (WebCore::CurlRequest::setupTransfer):
828         * platform/network/curl/CurlRequest.h:
829         * platform/network/curl/CurlRequestDelegate.h:
830         * platform/network/curl/CurlResponse.h:
831         (WebCore::CurlResponse::isolatedCopy const):
832         * platform/network/curl/CurlSSLHandle.h:
833         * platform/network/curl/CurlSSLVerifier.h:
834         * platform/network/curl/DownloadBundle.h:
835         * platform/network/curl/MultipartHandle.h:
836         * platform/network/curl/ResourceError.h:
837         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
838         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
839         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
840         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
841         (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
842         (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
843         * platform/network/curl/ResourceRequest.h:
844         (WebCore::ResourceRequest::ResourceRequest):
845         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
846         (WebCore::ResourceRequest::cfURLRequest const):
847         (WebCore::ResourceRequest::httpPipeliningEnabled):
848         (WebCore::ResourceRequest::setHTTPPipeliningEnabled):
849         (WebCore::ResourceRequest::doUpdatePlatformRequest):
850         (WebCore::ResourceRequest::doUpdateResourceRequest):
851         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
852         (WebCore::ResourceRequest::doUpdateResourceHTTPBody):
853         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
854         * platform/network/curl/ResourceResponseCurl.cpp:
855         (WebCore::ResourceResponse::isAppendableHeader):
856         (WebCore::ResourceResponse::ResourceResponse):
857
858 2017-10-20  Frederic Wang  <fwang@igalia.com>
859
860         RenderLayerCompositor: Move implementation of simple methods into the header file.
861         https://bugs.webkit.org/show_bug.cgi?id=178514
862
863         Reviewed by Darin Adler.
864
865         No new tests, behavior unchanged.
866
867 2017-10-19  Antti Koivisto  <antti@apple.com>
868
869         Support ::before/::after pseudo elements on elements with display:contents
870         https://bugs.webkit.org/show_bug.cgi?id=178513
871
872         Reviewed by Ryosuke Niwa.
873
874         Add support for
875
876             div { display:contents }
877             div::after { content:'foo' }
878
879         That is support non-box generating elements with generated content.
880
881         * style/RenderTreePosition.cpp:
882         (WebCore::RenderTreePosition::nextSiblingRenderer const):
883
884             Implement full pseudo-inclusive traversal starting from any element (including pseudo)
885             to locate the next rendering sibling. In case of display:content this may need to look
886             into descendants.
887
888         * style/RenderTreeUpdater.cpp:
889         (WebCore::textRendererIsNeeded):
890
891             RenderTreePosition::nextSiblingRenderer can no longer be called with a node that already has a renderer.
892             Maintain the existing behavior.
893
894         * style/RenderTreeUpdaterGeneratedContent.cpp:
895         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
896         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
897
898             Don't require for host to have a renderer.
899
900         * style/RenderTreeUpdaterGeneratedContent.h:
901         * style/StyleTreeResolver.cpp:
902         (WebCore::Style::TreeResolver::resolvePseudoStyle):
903
904 2017-10-20  Keith Miller  <keith_miller@apple.com>
905
906         Move common bindings files to unified sources
907         https://bugs.webkit.org/show_bug.cgi?id=178561
908
909         Rubber-stamped by Ryosuke Niwa.
910
911         This patch moves most of the common bindings files to unified sources.
912
913         Additionally, it adds a change to make_names to unique a struct
914         name that caused name conflicts that I missed when I made the
915         source changes before.
916
917         Lastly, add missing reference to WebCoreJSBuiltins.cpp in CMake build.
918
919         No new behavior no tests.
920
921         * CMakeLists.txt:
922         * Sources.txt:
923         * WebCore.xcodeproj/project.pbxproj:
924         * dom/make_names.pl:
925         (printFactoryCppFile):
926
927 2017-10-20  Saam Barati  <sbarati@apple.com>
928
929         Optimize accesses to how we get the direct prototype
930         https://bugs.webkit.org/show_bug.cgi?id=178548
931
932         Reviewed by Yusuke Suzuki.
933
934         No new tests: no functionality change.
935
936         * bindings/js/JSDOMAbstractOperations.h:
937         (WebCore::isVisibleNamedProperty):
938         (WebCore::accessVisibleNamedProperty):
939         * bindings/js/JSDOMWindowBase.cpp:
940         (WebCore::toJSDOMWindow):
941         * bindings/js/JSDOMWindowProperties.cpp:
942         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
943         * bindings/js/JSPluginElementFunctions.cpp:
944         (WebCore::pluginElementCustomGetOwnPropertySlot):
945         * bindings/js/WorkerScriptController.cpp:
946         (WebCore::WorkerScriptController::initScript):
947         * bindings/scripts/CodeGeneratorJS.pm:
948         (GeneratePut):
949         (GeneratePutByIndex):
950         (GenerateConstructorHelperMethods):
951         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
952         (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
953         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
954         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put):
955         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex):
956         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
957         (WebCore::JSTestNamedAndIndexedSetterThrowingException::put):
958         (WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex):
959         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
960         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put):
961         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex):
962         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
963         (WebCore::JSTestNamedSetterNoIdentifier::put):
964         (WebCore::JSTestNamedSetterNoIdentifier::putByIndex):
965         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
966         (WebCore::JSTestNamedSetterThrowingException::put):
967         (WebCore::JSTestNamedSetterThrowingException::putByIndex):
968         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
969         (WebCore::JSTestNamedSetterWithIdentifier::put):
970         (WebCore::JSTestNamedSetterWithIdentifier::putByIndex):
971         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
972         (WebCore::JSTestNamedSetterWithIndexedGetter::put):
973         (WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex):
974         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
975         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put):
976         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex):
977         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
978         (WebCore::JSTestNamedSetterWithUnforgableProperties::put):
979         (WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex):
980
981 2017-10-20  Yusuke Suzuki  <utatane.tea@gmail.com>
982
983         [JSC] ScriptFetcher should be notified directly from module pipeline
984         https://bugs.webkit.org/show_bug.cgi?id=178340
985
986         Reviewed by Sam Weinig.
987
988         No behavior change.
989
990         * bindings/js/JSMainThreadExecState.h:
991         (WebCore::JSMainThreadExecState::loadModule):
992         * bindings/js/ScriptController.cpp:
993         (WebCore::ScriptController::loadModuleScriptInWorld):
994         (WebCore::jsValueToModuleKey): Deleted.
995         (WebCore::ScriptController::setupModuleScriptHandlers): Deleted.
996         * bindings/js/ScriptController.h:
997         * dom/LoadableModuleScript.cpp:
998         (WebCore::LoadableModuleScript::notifyLoadFailed):
999         * dom/LoadableModuleScript.h:
1000
1001 2017-10-19  Ms2ger  <Ms2ger@igalia.com>
1002
1003         Remove proprietary constants from WebGL2RenderingContext.
1004         https://bugs.webkit.org/show_bug.cgi?id=178511
1005
1006         Reviewed by Ryosuke Niwa.
1007
1008         As far as I can tell, these constants are not in the specification,
1009         and no other browser supports them.
1010
1011         No new tests: just code removal.
1012
1013         * html/canvas/WebGL2RenderingContext.idl:
1014
1015 2017-10-19  Zalan Bujtas  <zalan@apple.com>
1016
1017         [FrameView::layout cleanup] Move style update related logic to a separate function
1018         https://bugs.webkit.org/show_bug.cgi?id=178558
1019         <rdar://problem/35088218>
1020
1021         Reviewed by Simon Fraser.
1022
1023         No change in functionality.
1024
1025         * page/FrameView.cpp:
1026         (WebCore::FrameView::ensureStyleIsUpToDateForLayout):
1027         (WebCore::FrameView::layout):
1028         * page/FrameView.h:
1029
1030 2017-10-19  JF Bastien  <jfbastien@apple.com>
1031
1032         WebAssembly: no VM / JS version of everything but Instance
1033         https://bugs.webkit.org/show_bug.cgi?id=177473
1034
1035         Reviewed by Filip Pizlo, Saam Barati.
1036
1037         * ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
1038         included in JSWebAssemblyModule.h.
1039         * bindings/js/SerializedScriptValue.cpp: Update postMessage code
1040         according to C++ API changes.
1041
1042 2017-10-19  Chris Dumez  <cdumez@apple.com>
1043
1044         SerializedScriptValue passed to postMessage() cannot be null
1045         https://bugs.webkit.org/show_bug.cgi?id=178550
1046
1047         Reviewed by Youenn Fablet.
1048
1049         SerializedScriptValue passed to postMessage() cannot be null. Therefore, we
1050         should use Ref<> type, not RefPtr<>.
1051
1052         * dom/MessagePortChannel.h:
1053         * dom/default/PlatformMessagePortChannel.cpp:
1054         (WebCore::MessagePortChannel::postMessageToRemote):
1055         * workers/WorkerGlobalScopeProxy.h:
1056         * workers/WorkerMessagingProxy.cpp:
1057         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
1058         (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
1059         * workers/WorkerMessagingProxy.h:
1060         * workers/WorkerObjectProxy.h:
1061         * workers/service/context/ServiceWorkerThread.cpp:
1062
1063 2017-10-19  Daniel Bates  <dabates@apple.com>
1064
1065         Use "= default" to denote default constructor or destructor
1066         https://bugs.webkit.org/show_bug.cgi?id=178528
1067
1068         Rubber-stamped by Andy Estes.
1069
1070         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
1071         * Modules/applepay/ApplePayError.cpp:
1072         * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
1073         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
1074         * Modules/applepay/ApplePaySession.cpp:
1075         * Modules/applepay/ApplePaySessionPaymentRequest.cpp:
1076         * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
1077         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
1078         * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
1079         * Modules/applepay/Payment.h:
1080         * Modules/applepay/PaymentCoordinatorClient.h:
1081         * Modules/credentials/BasicCredential.cpp:
1082         * Modules/credentials/FederatedCredential.cpp:
1083         * Modules/credentials/NavigatorCredentials.cpp:
1084         * Modules/credentials/PasswordCredential.cpp:
1085         * Modules/encryptedmedia/CDMClient.h:
1086         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
1087         * Modules/encryptedmedia/legacy/LegacyCDM.h:
1088         * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
1089         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
1090         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
1091         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
1092         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
1093         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
1094         * Modules/entriesapi/DOMFileSystem.cpp:
1095         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
1096         * Modules/entriesapi/FileSystemEntry.cpp:
1097         * Modules/fetch/FetchLoaderClient.h:
1098         * Modules/gamepad/Gamepad.cpp:
1099         * Modules/gamepad/GamepadEvent.h:
1100         * Modules/gamepad/deprecated/Gamepad.cpp:
1101         [ truncated ]
1102
1103 2017-10-19  Sam Weinig  <sam@webkit.org>
1104
1105         [Bindings] Standardize on DOMPromise as the way to store passed in promises
1106         https://bugs.webkit.org/show_bug.cgi?id=178533
1107
1108         Reviewed by Youenn Fablet.
1109
1110         This standardizes on RefPtr<DOMPromise> as the canonical way to store a promise
1111         that has been passed in from JS. This does not change promises that start off in
1112         WebCore and are passed to JS; they remain using DOMPromiseDeferred and DOMPromiseProxy.
1113
1114         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
1115         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
1116         * dom/PromiseRejectionEvent.cpp:
1117         * dom/PromiseRejectionEvent.h:
1118         * dom/RejectedPromiseTracker.cpp:
1119
1120             Use a RefPtr<DOMPromise> rather than a JSPromise* to hold onto the promise.
1121
1122         * bindings/IDLTypes.h:
1123
1124             Use IDLWrapper to get better defaults, since DOMPromise is refcounted.
1125
1126         * bindings/js/JSDOMConvertPromise.h:
1127         (WebCore::Converter<IDLPromise<T>>::convert):
1128
1129             Switch default conversion to return a RefPtr<DOMPromise> rather than a JSPromise*
1130
1131         (WebCore::JSConverter<IDLPromise<T>>::convert):
1132
1133             Add support for converting from a DOMPromise to a JSValue.
1134
1135         * bindings/js/JSDOMPromise.cpp:
1136         * bindings/js/JSDOMPromise.h:
1137         (WebCore::DOMPromise::create): Deleted.
1138
1139             Remove now unused constructor.    
1140
1141         * workers/service/ExtendableEvent.cpp:
1142         (WebCore::ExtendableEvent::waitUntil):
1143         * workers/service/ExtendableEvent.h:
1144         * workers/service/ExtendableEvent.idl:
1145         * workers/service/FetchEvent.cpp:
1146         (WebCore::FetchEvent::respondWith):
1147         (WebCore::FetchEvent::promiseIsSettled):
1148         * workers/service/FetchEvent.h:
1149         * workers/service/FetchEvent.idl:
1150
1151             Address FIXMEs and remove need for passing an ExecState to ExtendableEvent
1152             and FetchEvent by using the new default conversion to DOMPromise.
1153
1154 2017-10-19  Sam Weinig  <sam@webkit.org>
1155
1156         [Settings] Move global settings into their own file
1157         https://bugs.webkit.org/show_bug.cgi?id=178512
1158
1159         Reviewed by Darin Adler.
1160
1161         Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
1162         It's called DeprecatedGlobalSettings to indicate that this is an anti-pattern we would
1163         like to discourage, as WebCore can operate in a process with multiple clients, each of
1164         which should be able to set their own preferences.
1165
1166         * WebCore.xcodeproj/project.pbxproj:
1167         * CMakeLists.txt:
1168
1169             Add new files.
1170         
1171         * page/DeprecatedGlobalSettings.cpp: Copied from Source/WebCore/page/SettingsBase.cpp.
1172         * page/DeprecatedGlobalSettings.h: Copied from Source/WebCore/page/SettingsBase.h.
1173         * page/SettingsBase.cpp:
1174         * page/SettingsBase.h:
1175         
1176             Move all global settings out of SettingsBase and into the new DeprecatedGlobalSettings.
1177         
1178         * Modules/mediastream/UserMediaRequest.cpp:
1179         * bindings/js/CommonVM.cpp:
1180         * css/CSSStyleDeclaration.cpp:
1181         * dom/DataTransfer.cpp:
1182         * dom/DataTransferItemList.cpp:
1183         * editing/Editor.cpp:
1184         * loader/ResourceLoadObserver.cpp:
1185         * page/FrameView.cpp:
1186         * page/PerformanceMonitor.cpp:
1187         * platform/ScrollbarTheme.cpp:
1188         (WebCore::ScrollbarTheme::theme):
1189         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
1190         * platform/graphics/MediaPlayer.cpp:
1191         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1192         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1193         * platform/mac/NSScrollerImpDetails.mm:
1194         * platform/mock/ScrollbarThemeMock.cpp:
1195         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1196         * platform/network/ios/NetworkStateNotifierIOS.mm:
1197         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1198         * platform/win/MainThreadSharedTimerWin.cpp:
1199         * rendering/RenderLayer.cpp:
1200         * rendering/RenderListBox.cpp:
1201         * testing/InternalSettings.cpp:
1202         * testing/Internals.cpp:
1203
1204             Update users of global settings to reference the new class name.
1205
1206 2017-10-19  Youenn Fablet  <youenn@apple.com>
1207
1208         Add preliminary support for ServiceWorker Handle Fetch
1209         https://bugs.webkit.org/show_bug.cgi?id=178475
1210         <rdar://problem/35066424>
1211
1212         Reviewed by Chris Dumez.
1213
1214         Test: http/tests/workers/service/basic-fetch.https.html
1215
1216         Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
1217         A script context is now storing its selected service worker identifier. This should be fully implemented later on.
1218         This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
1219         Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.
1220
1221         * WebCore.xcodeproj/project.pbxproj:
1222         * dom/ScriptExecutionContext.h:
1223         (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
1224         (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
1225         * loader/DocumentThreadableLoader.cpp:
1226         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1227         * loader/FetchOptions.h:
1228         (WebCore::isPotentialNavigationOrSubresourceRequest):
1229         (WebCore::isNonSubresourceRequest):
1230         * loader/ResourceLoaderOptions.h:
1231         * loader/WorkerThreadableLoader.cpp:
1232         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
1233         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1234         * loader/WorkerThreadableLoader.h:
1235         * platform/network/ResourceRequestBase.h:
1236         * platform/network/ResourceResponseBase.h:
1237         * workers/WorkerThread.h:
1238         * workers/service/ServiceWorkerContainer.cpp:
1239         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1240         * workers/service/context/SWContextManager.cpp: Removed.
1241         * workers/service/context/ServiceWorkerThread.h:
1242
1243 2017-10-19  Zalan Bujtas  <zalan@apple.com>
1244
1245         [FrameView::layout cleanup] Move post layout task scheduling logic to a separate function
1246         https://bugs.webkit.org/show_bug.cgi?id=178538
1247         <rdar://problem/35080743>
1248
1249         Reviewed by Simon Fraser.
1250
1251         Move and reorganize post layout task scheduling code.
1252         
1253         Covered by existing tests.
1254
1255         * page/FrameView.cpp:
1256         (WebCore::FrameView::layout):
1257         (WebCore::FrameView::runOrSchedulePostLayoutTasks):
1258         * page/FrameView.h:
1259
1260 2017-10-19  Zalan Bujtas  <zalan@apple.com>
1261
1262         [FrameView::layout cleanup] Move scrollbars setup logic to a separate function
1263         https://bugs.webkit.org/show_bug.cgi?id=178394
1264         <rdar://problem/35031066>
1265
1266         Reviewed by Antti Koivisto.
1267
1268         Decouple scrollbars setup and the unrelated first-layout logic.
1269         FIXME: find out why m_firstLayout depends on the subtree flag (I'd assume we issue full layout the very first time). 
1270
1271         Covered by existing test cases.
1272
1273         * page/FrameView.cpp:
1274         (WebCore::FrameView::adjustScrollbarsForLayout):
1275         (WebCore::FrameView::layout):
1276         * page/FrameView.h:
1277
1278 2017-10-19  Tim Horton  <timothy_horton@apple.com>
1279
1280         Expand r209943 to suppress paste during provisional navigation as well
1281         https://bugs.webkit.org/show_bug.cgi?id=178429
1282         <rdar://problem/33952830>
1283
1284         Reviewed by Dean Jackson.
1285
1286         No new tests; adjusted an existing test to cover this case.
1287
1288         * editing/Editor.cpp:
1289         (WebCore::Editor::canPaste const):
1290         Disable pasting during provisional navigation, like r209943 did for
1291         various other forms of text input.
1292
1293         (WebCore::Editor::shouldInsertText const):
1294         * dom/EventDispatcher.cpp:
1295         (WebCore::shouldSuppressEventDispatchInDOM):
1296         * loader/FrameLoader.cpp:
1297         (WebCore::FrameLoader::shouldSuppressTextInputFromEditing const):
1298         (WebCore::FrameLoader::shouldSuppressKeyboardInput const): Deleted.
1299         * loader/FrameLoader.h:
1300         * page/Settings.in:
1301         Rename the setting to be about editing-related text input, not "keyboard" input.
1302
1303         * editing/EditorCommand.cpp:
1304         (WebCore::allowExecutionWhenDisabled):
1305         (WebCore::doNotAllowExecutionWhenDisabled):
1306         (WebCore::allowExecutionWhenDisabledCopyCut):
1307         (WebCore::allowExecutionWhenDisabledPaste):
1308         (WebCore::createCommandMap):
1309         (WebCore::Editor::Command::allowExecutionWhenDisabled const):
1310         Completely disable execution of paste events when in no-text-input-from-editing mode.
1311         Otherwise, even though canPaste was false and we wouldn't do a default paste action,
1312         we would still dispatch the paste event to the DOM.
1313
1314 2017-10-19  Dean Jackson  <dino@apple.com>
1315
1316         Avoid duplicate multisample resolve before WebGL compositing
1317         https://bugs.webkit.org/show_bug.cgi?id=178537
1318         <rdar://problem/35080724>
1319
1320         Fix iOS build.
1321
1322         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1323         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
1324
1325 2017-10-19  Dean Jackson  <dino@apple.com>
1326
1327         Avoid duplicate multisample resolve before WebGL compositing
1328         https://bugs.webkit.org/show_bug.cgi?id=178537
1329         <rdar://problem/35080724>
1330
1331         Reviewed by Jer Noble.
1332
1333         Both endPaint and prepareTexture were doing the MSAA resolve
1334         into the renderbuffer, and being called on macOS before compositing.
1335         Without that step, endPaint became unnecessary on iOS so I renamed
1336         it presentRenderbuffer.
1337
1338         Covered by existing tests.
1339
1340         * platform/graphics/GraphicsContext3D.h:
1341         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1342         (WebCore::GraphicsContext3D::presentRenderbuffer):
1343         (WebCore::GraphicsContext3D::endPaint): Deleted.
1344         * platform/graphics/cocoa/WebGLLayer.mm:
1345         (-[WebGLLayer display]):
1346
1347 2017-10-19  Andy Estes  <aestes@apple.com>
1348
1349         [Payment Request] Only process shipping options if shipping is requested, and throw an exception on duplicate shipping option IDs
1350         https://bugs.webkit.org/show_bug.cgi?id=178535
1351
1352         Reviewed by Alex Christensen.
1353
1354         Progresses four tests in web-platform-tests/payment-request/payment-request-constructor.https.html.
1355
1356         * Modules/paymentrequest/PaymentRequest.cpp:
1357         (WebCore::PaymentRequest::create):
1358
1359 2017-10-19  Daniel Bates  <dabates@apple.com>
1360
1361         Share logic in InlineTextBox to compute selection rect
1362         https://bugs.webkit.org/show_bug.cgi?id=178232
1363         <rdar://problem/34963452>
1364
1365         Reviewed by Zalan Bujtas.
1366
1367         Currently each paint routine in InlineTextBox duplicates similar code to compute the selection
1368         rect it will paint. This change consolidates all the duplication into localSelectionRectWithClampedPositions()
1369         and writes all of the paint operations, except for paintCompositionUnderline(), in terms of it.
1370         We will write paintCompositionUnderline() in terms of localSelectionRectWithClampedPositions()
1371         in a subsequent patch.
1372
1373         We also write localSelectionRect() in terms of localSelectionRectWithClampedPositions(). Ideally
1374         we would have one way to compute the selection rect. However, localSelectionRect() and paintDocumentMarker()
1375         currently expect the enclosing integral rectangle of the selection rectangle. The function
1376         paintDocumentMarker() needs the enclosing integral rectangle to avoid truncating the dot pattern
1377         drawn under marked words (e.g. a spelling error) on Cocoa platforms. With regards to localSelectionRect()
1378         we should look to have it return the actual selection rectangle. See <https://bugs.webkit.org/show_bug.cgi?id=138913>
1379         for more details.
1380
1381         * rendering/InlineTextBox.cpp:
1382         (WebCore::InlineTextBox::localSelectionRect const): Move logic in common with paintSelection() into
1383         localSelectionRectWithClampedPositions() and modified code to use it.
1384         (WebCore::InlineTextBox::localSelectionRectWithClampedPositions const): Added.
1385         (WebCore::InlineTextBox::paint): Store the local paint offset as a LayoutPoint as it is the canonical
1386         data type for representing an offset when painting. Pass the local paint offset instead of the analagous boxOrigin value.
1387         (WebCore::InlineTextBox::paintSelection): Write in terms of localSelectionRectWithClampedPositions().
1388         (WebCore::InlineTextBox::paintTextSubrangeBackground): Ditto.
1389         (WebCore::InlineTextBox::paintCompositionBackground): Ditto.
1390         (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
1391         (WebCore::InlineTextBox::paintDocumentMarker): Ditto.
1392         (WebCore::InlineTextBox::paintDocumentMarkers): Pass paint offset instead of the analogous boxOrigin value.
1393         * rendering/InlineTextBox.h:
1394
1395 2017-10-19  Daniel Bates  <dabates@apple.com>
1396
1397         Referrer policy should be inherited from creator
1398         https://bugs.webkit.org/show_bug.cgi?id=178403
1399         <rdar://problem/31546136>
1400
1401         Reviewed by Andy Estes.
1402
1403         As per section Browsing contexts of the the HTML standard, <https://html.spec.whatwg.org/multipage/browsers.html>
1404         (17 October 2017), the referrer policy of a document should initially be inherited from its
1405         creator.
1406
1407         Tests: http/tests/security/referrer-policy-nested-subframe.html
1408                http/tests/security/referrer-policy-nested-window-open.html
1409                http/tests/security/referrer-policy-subframe-window-open.html
1410                http/tests/security/referrer-policy-window-open-subframe.html
1411
1412         * dom/Document.cpp:
1413         (WebCore::Document::initSecurityContext): Ask the loader for the effective referrer policy.
1414         * loader/FrameLoader.cpp:
1415         (WebCore::FrameLoader::effectiveReferrerPolicy const): Added. Returns the referrer policy
1416         of the creator document. The creator document is document of the parent frame or the document
1417         of the opener for a subframe or child window, respectively. If we do not have a creator frame
1418         then we return the default referrer policy, non-referrer-when-downgrade, by <https://www.w3.org/TR/2017/CR-referrer-policy-20170126/#referrer-policy-empty-string>.
1419         * loader/FrameLoader.h:
1420
1421 2017-10-19  Zalan Bujtas  <zalan@apple.com>
1422
1423         [FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
1424         https://bugs.webkit.org/show_bug.cgi?id=178518
1425         <rdar://problem/35075409>
1426
1427         Reviewed by Antti Koivisto.
1428
1429         This patch tightens existing reentrancy policy on performPostLayoutTasks.
1430
1431         Covered by existing test cases.
1432
1433         * page/FrameView.cpp:
1434         (WebCore::FrameView::FrameView):
1435         (WebCore::FrameView::reset):
1436         (WebCore::FrameView::layout):
1437         (WebCore::FrameView::performPostLayoutTasks):
1438         * page/FrameView.h:
1439
1440 2017-10-19  Chris Dumez  <cdumez@apple.com>
1441
1442         Unreviewed, revert r223650 as it caused crashes on the bots.
1443
1444         * WebCore.xcodeproj/project.pbxproj:
1445         * dom/ScriptExecutionContext.h:
1446         * loader/DocumentThreadableLoader.cpp:
1447         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1448         * loader/FetchOptions.h:
1449         * loader/ResourceLoaderOptions.h:
1450         * loader/WorkerThreadableLoader.cpp:
1451         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
1452         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1453         * loader/WorkerThreadableLoader.h:
1454         * platform/network/ResourceRequestBase.h:
1455         * platform/network/ResourceResponseBase.h:
1456         * workers/WorkerThread.h:
1457         * workers/service/ServiceWorkerContainer.cpp:
1458         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1459         * workers/service/context/SWContextManager.cpp: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
1460         (WebCore::SWContextManager::singleton):
1461         (WebCore::SWContextManager::SWContextManager):
1462         (WebCore::SWContextManager::startServiceWorkerContext):
1463         * workers/service/context/SWContextManager.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
1464         * workers/service/context/ServiceWorkerThread.h:
1465
1466 2017-10-19  Zalan Bujtas  <zalan@apple.com>
1467
1468         [FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
1469         https://bugs.webkit.org/show_bug.cgi?id=178503
1470         <rdar://problem/35066561>
1471
1472         Reviewed by Antti Koivisto.
1473
1474         Covered by existing tests.
1475
1476         * page/FrameView.cpp:
1477         (WebCore::FrameView::reset):
1478         (WebCore::FrameView::layout):
1479         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
1480         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
1481         (WebCore::FrameView::updateEmbeddedObjects):
1482         (WebCore::FrameView::flushPostLayoutTasksQueue):
1483         (WebCore::FrameView::performPostLayoutTasks):
1484         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
1485         * page/FrameView.h:
1486
1487 2017-10-19  Antti Koivisto  <antti@apple.com>
1488
1489         Overlapping text on all CSS fonts specs
1490         https://bugs.webkit.org/show_bug.cgi?id=177585
1491         <rdar://problem/34704078>
1492
1493         Reviewed by Daniel Bates.
1494
1495         We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements.
1496         This resulted in 'rem' units being miscomputed.
1497
1498         Reduction by Zalan.
1499
1500         Test: fast/html/details-line-height-overlap.html
1501
1502         * style/StyleTreeResolver.cpp:
1503         (WebCore::Style::TreeResolver::Scope::Scope):
1504         (WebCore::Style::TreeResolver::Scope::~Scope):
1505
1506             Only reset overrideDocumentElementStyle when destroying the scope.
1507
1508         (WebCore::Style::TreeResolver::pushScope):
1509         (WebCore::Style::TreeResolver::pushEnclosingScope):
1510         (WebCore::Style::TreeResolver::popScope):
1511
1512             A scope can show up multiple times in scope stack.
1513
1514         * style/StyleTreeResolver.h:
1515
1516 2017-10-19  Ryosuke Niwa  <rniwa@webkit.org>
1517
1518         Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
1519         https://bugs.webkit.org/show_bug.cgi?id=178504
1520
1521         Reviewed by Antti Koivisto.
1522
1523         Consolidated calls to notifyChildNodeInserted, childrenChanged, didFinishInsertingNode, and
1524         dispatchChildInsertionEvents for inserting a node by executeNodeInsertionWithScriptAssertion,
1525         a new templatefunction which takes a closure to do the node insertion to make exactly when
1526         the script becomes runnable clear.
1527
1528         Added an exception to SVGTRefElement::updateReferencedText since this code mutates user agent
1529         shadow root during insertedInto, and turned ChildChangeSource into an enum class.
1530
1531         * dom/CharacterData.cpp:
1532         (WebCore::CharacterData::parserAppendData):
1533         (WebCore::CharacterData::setDataAndUpdate):
1534         * dom/ContainerNode.cpp:
1535         (WebCore::executeNodeInsertionWithScriptAssertion): Extracted.
1536         (WebCore::ContainerNode::takeAllChildrenFrom): Deployed executeNodeInsertionWithScriptAssertion.
1537         (WebCore::ContainerNode::insertBefore): Ditto.
1538         (WebCore::ContainerNode::changeForChildInsertion): Deleted.
1539         (WebCore::ContainerNode::notifyChildInserted): Deleted.
1540         (WebCore::ContainerNode::parserInsertBefore): Deployed executeNodeInsertionWithScriptAssertion. 
1541         (WebCore::ContainerNode::replaceChild): Ditto.
1542         (WebCore::ContainerNode::removeChild):
1543         (WebCore::ContainerNode::parserRemoveChild):
1544         (WebCore::ContainerNode::replaceAllChildren): Ditto.
1545         (WebCore::ContainerNode::removeChildren):
1546         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
1547         (WebCore::ContainerNode::parserAppendChild): Ditto.
1548         (WebCore::ContainerNode::childrenChanged):
1549         (WebCore::ContainerNode::updateTreeAfterInsertion): Deleted.
1550         * dom/ContainerNode.h:
1551         * dom/Element.cpp:
1552         (WebCore::Element::childrenChanged):
1553         * html/HTMLOutputElement.cpp:
1554         (WebCore::HTMLOutputElement::childrenChanged):
1555         * svg/SVGClipPathElement.cpp:
1556         (WebCore::SVGClipPathElement::childrenChanged):
1557         * svg/SVGElement.cpp:
1558         (WebCore::SVGElement::childrenChanged):
1559         * svg/SVGFELightElement.cpp:
1560         (WebCore::SVGFELightElement::childrenChanged):
1561         * svg/SVGFilterElement.cpp:
1562         (WebCore::SVGFilterElement::childrenChanged):
1563         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1564         (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
1565         * svg/SVGGradientElement.cpp:
1566         (WebCore::SVGGradientElement::childrenChanged):
1567         * svg/SVGMarkerElement.cpp:
1568         (WebCore::SVGMarkerElement::childrenChanged):
1569         * svg/SVGMaskElement.cpp:
1570         (WebCore::SVGMaskElement::childrenChanged):
1571         * svg/SVGPatternElement.cpp:
1572         (WebCore::SVGPatternElement::childrenChanged):
1573         * svg/SVGTRefElement.cpp:
1574         (WebCore::SVGTRefElement::updateReferencedText): Allow DOM mutations inside the user agent shadow tree here.
1575
1576 2017-10-19  Ryosuke Niwa  <rniwa@webkit.org>
1577
1578         Add an argument indicating the type of removal to Node::removedFrom
1579         https://bugs.webkit.org/show_bug.cgi?id=178505
1580
1581         Reviewed by Antti Koivisto.
1582
1583         Like r223628, added RemovalType as the first argument to Node::removedFrom, which contains two booleans indicating
1584         whether the node just become disconnected from a document, and whether node's tree scope had changed or not.
1585
1586         These boolean flags simplifies the logic in removedFrom implementations, and are required to have a better
1587         guarantee about the correctness of node flags during calls to removedFrom. Right now, Node::isConnected() and
1588         Node::isInShadowTree() are both outdated until Node::removedFrom is called.
1589
1590         Also renamed the second argument of removedFrom to parentOfRemovedTree to make the semantics clear.
1591
1592         Note that in some implementations of removedFrom, we check whether isConnected() was true to decide whether
1593         the node had already been disconnected from a document prior to calls to this particular call of removedFrom.
1594         This extra check is no longer necessary since no node will be removed from a document without first being inserted
1595         completely somewhere after r223458.
1596
1597         No new tests since there should be no behavioral changes.
1598
1599         * dom/ContainerNodeAlgorithms.cpp:
1600         (WebCore::notifyNodeInsertedIntoDocument): Replaced RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
1601         (WebCore::notifyNodeRemovedFromDocument): Replaced the check that the node had not been re-connected by scripts
1602         by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
1603         Also moved the code to call setCSSTarget to Element::removedFrom. This random call to setCSSTarget predates r114351,
1604         as well as r40475. It was originally introduced by r29311 into Node::removedFromDocument() ten years ago.
1605         (WebCore::notifyNodeRemovedFromTree): Moved NoEventDispatchAssertion to notifyChildNodeRemoved.
1606         (WebCore::notifyChildNodeRemoved): Added NoEventDispatchAssertion.
1607         * dom/ContainerNodeAlgorithms.h:
1608         * dom/Element.cpp:
1609         (WebCore::Element::removedFrom): Replaced the complicated code to detect when this element is removed from a document
1610         and its tree scope had changed by removalType.disconnectedFromDocument and removalType.treeScopeChanged.
1611         * dom/Element.h:
1612         * dom/Node.cpp:
1613         (WebCore::Node::removedFrom):
1614         * dom/Node.h: Replaced a long block of comments above insertedInto by two lines of concise comments now that
1615         the semantics of insertedInto and didFinishInsertingNode are more clear, and enforced by assertions.
1616         (WebCore::Node::RemovalType::RemovalType): Addedl
1617         * dom/ProcessingInstruction.cpp:
1618         (WebCore::ProcessingInstruction::removedFrom):
1619         * dom/ProcessingInstruction.h:
1620         * dom/ShadowRoot.cpp:
1621         (WebCore::ShadowRoot::removedFrom): The extra !isConnected() check is no longer needed. See the description above.
1622         * dom/ShadowRoot.h:
1623         * html/FormAssociatedElement.cpp:
1624         (WebCore::FormAssociatedElement::removedFrom):
1625         * html/FormAssociatedElement.h:
1626         * html/HTMLBaseElement.cpp:
1627         (WebCore::HTMLBaseElement::removedFrom):
1628         * html/HTMLBaseElement.h:
1629         * html/HTMLFormControlElement.cpp:
1630         (WebCore::HTMLFormControlElement::removedFrom):
1631         * html/HTMLFormControlElement.h:
1632         * html/HTMLFormControlElementWithState.cpp:
1633         (WebCore::HTMLFormControlElementWithState::removedFrom):
1634         * html/HTMLFormControlElementWithState.h:
1635         * html/HTMLFormElement.cpp:
1636         (WebCore::HTMLFormElement::removedFrom):
1637         * html/HTMLFormElement.h:
1638         * html/HTMLFrameSetElement.cpp:
1639         (WebCore::HTMLFrameSetElement::removedFrom):
1640         * html/HTMLFrameSetElement.h:
1641         * html/HTMLImageElement.cpp:
1642         (WebCore::HTMLImageElement::removedFrom):
1643         * html/HTMLImageElement.h:
1644         * html/HTMLInputElement.cpp:
1645         (WebCore::HTMLInputElement::removedFrom):
1646         * html/HTMLInputElement.h:
1647         * html/HTMLLinkElement.cpp:
1648         (WebCore::HTMLLinkElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
1649         * html/HTMLLinkElement.h:
1650         * html/HTMLMapElement.cpp:
1651         (WebCore::HTMLMapElement::removedFrom):
1652         * html/HTMLMapElement.h:
1653         * html/HTMLMediaElement.cpp:
1654         (WebCore::HTMLMediaElement::removedFrom):
1655         * html/HTMLMediaElement.h:
1656         * html/HTMLObjectElement.cpp:
1657         (WebCore::HTMLObjectElement::removedFrom):
1658         * html/HTMLObjectElement.h:
1659         * html/HTMLSlotElement.cpp:
1660         (WebCore::HTMLSlotElement::removedFrom): Simplifies the logic to detect when this slot element is being
1661         removed from a shadow tree using removalType.treeScopeChanged.
1662         * html/HTMLSlotElement.h:
1663         * html/HTMLSourceElement.cpp:
1664         (WebCore::HTMLSourceElement::insertedInto): Added a FIXME for an obvious bug.
1665         (WebCore::HTMLSourceElement::removedFrom): Ditto.
1666         * html/HTMLSourceElement.h:
1667         * html/HTMLStyleElement.cpp:
1668         (WebCore::HTMLStyleElement::removedFrom):
1669         * html/HTMLStyleElement.h:
1670         * html/HTMLTitleElement.cpp:
1671         (WebCore::HTMLTitleElement::removedFrom):
1672         * html/HTMLTitleElement.h:
1673         * html/HTMLTrackElement.cpp:
1674         (WebCore::HTMLTrackElement::removedFrom): Ditto.
1675         * html/HTMLTrackElement.h:
1676         * svg/SVGElement.cpp:
1677         (WebCore::SVGElement::removedFrom): Replaced isConnected() check before calling Node::removedFrom by the check of
1678         removalType.disconnectedFromDocument.
1679         * svg/SVGElement.h:
1680         * svg/SVGFEImageElement.cpp:
1681         (WebCore::SVGFEImageElement::removedFrom):
1682         * svg/SVGFEImageElement.h:
1683         * svg/SVGFontFaceElement.cpp:
1684         (WebCore::SVGFontFaceElement::removedFrom):
1685         * svg/SVGFontFaceElement.h:
1686         * svg/SVGMPathElement.cpp:
1687         (WebCore::SVGMPathElement::removedFrom):
1688         * svg/SVGMPathElement.h:
1689         * svg/SVGPathElement.cpp:
1690         (WebCore::SVGPathElement::removedFrom):
1691         * svg/SVGPathElement.h:
1692         * svg/SVGSVGElement.cpp:
1693         (WebCore::SVGSVGElement::removedFrom):
1694         * svg/SVGSVGElement.h:
1695         * svg/SVGStyleElement.cpp:
1696         (WebCore::SVGStyleElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
1697         * svg/SVGStyleElement.h:
1698         * svg/SVGTRefElement.cpp:
1699         (WebCore::SVGTRefElement::removedFrom):
1700         * svg/SVGTRefElement.h:
1701         * svg/SVGTextPathElement.cpp:
1702         (WebCore::SVGTextPathElement::removedFrom):
1703         * svg/SVGTextPathElement.h:
1704         * svg/SVGTitleElement.cpp:
1705         (WebCore::SVGTitleElement::removedFrom):
1706         * svg/SVGTitleElement.h:
1707         * svg/SVGUseElement.cpp:
1708         (WebCore::SVGUseElement::removedFrom):
1709         * svg/SVGUseElement.h:
1710         * svg/animation/SVGSMILElement.cpp:
1711         (WebCore::SVGSMILElement::removedFrom):
1712         * svg/animation/SVGSMILElement.h:
1713
1714 2017-10-19  Ms2ger  <Ms2ger@igalia.com>
1715
1716         Update the signatures of compressedTexSubImage3D.
1717         https://bugs.webkit.org/show_bug.cgi?id=178507
1718
1719         Reviewed by Ryosuke Niwa.
1720
1721         No new tests: not much point in adding tests now; this method doesn't
1722         do anything anyway.
1723
1724         * html/canvas/WebGL2RenderingContext.cpp:
1725         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
1726         * html/canvas/WebGL2RenderingContext.h:
1727         * html/canvas/WebGL2RenderingContext.idl:
1728
1729 2017-10-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1730
1731         [curl] Segfault in WebCore::CurlRequest::setupPOST
1732         https://bugs.webkit.org/show_bug.cgi?id=178434
1733
1734         Reviewed by Ryosuke Niwa.
1735
1736         * platform/network/curl/CurlRequest.cpp:
1737         (WebCore::CurlRequest::resolveBlobReferences):
1738         (WebCore::CurlRequest::setupPOST):
1739
1740 2017-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1741
1742         Don't expose raw HTML in pasteboard to the web content
1743         https://bugs.webkit.org/show_bug.cgi?id=178422
1744         <rdar://problem/34567052>
1745
1746         Reviewed by Wenson Hsieh.
1747
1748         This patch enables HTML sanitization added in r223440 when WebKit pastes & concludes edit drag as opposed to
1749         just when dataTransfer.get is used. This is important to avoid leaking privacy sensitive information such as
1750         local file paths and pasting potentially harmful content such as scripts in event handler serialized by
1751         WebKit prior to r223462. In addition, we start using blob URLs in the pasted content instead of retaining
1752         the original URL and overriding the document loader like r222839 for RTFD and r222119 for image files.
1753
1754         To do this, a new superclass FrameWebContentReader of PasteboardWebContentReader and WebContentMarkupReader
1755         is introduced, and helper functions are extracted out of WebContentMarkupReader in WebContentReaderCocoa.mm
1756         to be also used in WebContentReader.
1757
1758         Tests: http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html
1759                http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html
1760                http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html
1761                PasteWebArchive.SanitizesHTML
1762
1763         * editing/WebContentReader.cpp:
1764         (WebCore::FrameWebContentReader::shouldSanitize const): Moved from WebContentMarkupReader.
1765         * editing/WebContentReader.h:
1766         (WebCore::FrameWebContentReader): Added to share code between WebContentReader and WebContentMarkupReader.
1767         (WebCore::FrameWebContentReader::FrameWebContentReader): Added.
1768         * editing/cocoa/EditorCocoa.mm:
1769         (WebCore::Editor::writeSelectionToPasteboard): Store the content's origin in the pasteboard so that we can
1770         avoid sanitizing the content when pasting into the same document. This is important since converting all URLs
1771         into blob URLs would break editors on the Web which tracks images, etc... in the content using URLs.
1772         (WebCore::Editor::writeSelection): Ditto.
1773         * editing/cocoa/WebContentReaderCocoa.mm:
1774         (WebCore::MarkupAndArchive): Replaced FragmentAndArchive. Now returns the markup string in the archive
1775         instead of the parsed fragment.
1776         (WebCore::extractMarkupAndArchive): Renamed from createFragmentFromWebArchive. Now returns the markup string.
1777         (WebCore::sanitizeMarkupWithArchive): Extracted out of WebContentMarkupReader::readWebArchive to share code
1778         between WebContentReader and WebContentMarkupReader, and added the code to handle subframes recursively.
1779         As inefficient as this code is, we can't delay the conversion of subframes' marksup until later time since
1780         the main frame's markup would contain blob URLs to refer to those subframes. 
1781         (WebCore::WebContentReader::readWebArchive): Use sanitizeMarkupWithArchive when shouldSanitize() is true.
1782         Don't add the subresources to the document loader when the content will be loaded into the same origin since
1783         subresouces are mostly likely available in the document anyway.
1784         (WebCore::WebContentMarkupReader::readWebArchive):
1785         * platform/Pasteboard.h:
1786         (WebCore::PasteboardWebContent): Added contentOrigin.
1787         * platform/PasteboardWriterData.h:
1788         (WebCore::PasteboardWriterData): Ditto.
1789         * platform/ios/PasteboardIOS.mm:
1790         (WebCore::Pasteboard::read): Read the origin before branching out to readRespectingUTIFidelities.
1791         * platform/ios/PlatformPasteboardIOS.mm:
1792         (WebCore::PlatformPasteboard::write): Record the content origin into the pasteboard.
1793         * platform/mac/PasteboardMac.mm:
1794         (WebCore::Pasteboard::write): Ditto.
1795         * platform/mac/PasteboardWriter.mm:
1796         (WebCore::createPasteboardWriter): Ditto.
1797
1798 2017-10-18  Sam Weinig  <sam@webkit.org>
1799
1800         Another attempt to fix the windows build.
1801
1802         * page/SettingsBase.cpp:
1803         (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
1804         * page/SettingsBase.h:
1805
1806 2017-10-18  Sam Weinig  <sam@webkit.org>
1807
1808         Attempt to fix the windows build.
1809
1810         * page/SettingsBase.cpp:
1811         (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
1812         * page/SettingsBase.h:
1813
1814 2017-10-18  Sam Weinig  <sam@webkit.org>
1815
1816         [Settings] Convert more settings to be generated
1817         https://bugs.webkit.org/show_bug.cgi?id=177766
1818
1819         Reviewed by Dean Jackson.
1820
1821         - Replaces setNeedsStyleRecalcInAllFrames option in Settings.in
1822           with a more generic, onChange, which allows you to specify a function
1823           in SettingsBase that will be called when the setting changes. 
1824           setNeedsStyleRecalcInAllFrames is then reimplemented in terms of
1825           onChange.
1826         - Moves most (all but two) of the remaining non-static settings from
1827           SettingsBase to Settings.in
1828
1829         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
1830         (printSetterBody):
1831         * Scripts/GenerateSettings/Settings.py:
1832         (Setting.__init__):
1833         (Setting.__str__):
1834         (Setting.typeIsValueType):
1835         (Setting.setterFunctionName):
1836         (Setting.setterChangeFunctionName):
1837         (Setting.hasComplexSetter):
1838         (parseInput):
1839         
1840             Add support for the onChange option.
1841         
1842         * page/Settings.in:
1843
1844             Migrate most of the remaining non-static settings to Settings.in.
1845             Adopt onChange option.
1846
1847         * page/SettingsBase.cpp:
1848         * page/SettingsBase.h:
1849
1850             Add helper functions for use by the onChange option.
1851
1852 2017-10-18  Chris Dumez  <cdumez@apple.com>
1853
1854         Implement ServiceWorkerRegistration.scope / updateViaCache
1855         https://bugs.webkit.org/show_bug.cgi?id=178497
1856
1857         Reviewed by Youenn Fablet.
1858
1859         Implement ServiceWorkerRegistration.scope / updateViaCache.
1860
1861         No new tests, updated existing test.
1862
1863         * WebCore.xcodeproj/project.pbxproj:
1864         * workers/service/ServiceWorkerContainer.cpp:
1865         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1866         * workers/service/ServiceWorkerContainer.h:
1867         * workers/service/ServiceWorkerJob.cpp:
1868         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
1869         * workers/service/ServiceWorkerJob.h:
1870         * workers/service/ServiceWorkerJobClient.h:
1871         * workers/service/ServiceWorkerRegistration.cpp:
1872         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
1873         (WebCore::ServiceWorkerRegistration::scope const):
1874         (WebCore::ServiceWorkerRegistration::updateViaCache const):
1875         (WebCore::ServiceWorkerRegistration::update):
1876         (WebCore::ServiceWorkerRegistration::unregister):
1877         (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
1878         (WebCore::ServiceWorkerRegistration::activeDOMObjectName const):
1879         (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
1880         * workers/service/ServiceWorkerRegistration.h:
1881         * workers/service/ServiceWorkerRegistration.idl:
1882         * workers/service/ServiceWorkerRegistrationData.cpp:
1883         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
1884         * workers/service/ServiceWorkerRegistrationData.h:
1885         (WebCore::ServiceWorkerRegistrationData::encode const):
1886         (WebCore::ServiceWorkerRegistrationData::decode):
1887         * workers/service/server/SWClientConnection.cpp:
1888         (WebCore::SWClientConnection::jobResolvedInServer):
1889         * workers/service/server/SWClientConnection.h:
1890         * workers/service/server/SWServerRegistration.cpp:
1891         (WebCore::SWServerRegistration::scriptContextStarted):
1892         (WebCore::SWServerRegistration::data const):
1893
1894 2017-10-18  Youenn Fablet  <youenn@apple.com>
1895
1896         Add preliminary support for ServiceWorker Handle Fetch
1897         https://bugs.webkit.org/show_bug.cgi?id=178475
1898
1899         Reviewed by Chris Dumez.
1900
1901         Test: http/tests/workers/service/basic-fetch.https.html
1902
1903         Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
1904         A script context is now storing its selected service worker identifier. This should be fully implemented later on.
1905         This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
1906         Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.
1907
1908         * WebCore.xcodeproj/project.pbxproj:
1909         * dom/ScriptExecutionContext.h:
1910         (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
1911         (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
1912         * loader/DocumentThreadableLoader.cpp:
1913         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1914         * loader/FetchOptions.h:
1915         (WebCore::isPotentialNavigationOrSubresourceRequest):
1916         (WebCore::isNonSubresourceRequest):
1917         * loader/ResourceLoaderOptions.h:
1918         * loader/WorkerThreadableLoader.cpp:
1919         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
1920         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1921         * loader/WorkerThreadableLoader.h:
1922         * platform/network/ResourceRequestBase.h:
1923         * platform/network/ResourceResponseBase.h:
1924         * workers/WorkerThread.h:
1925         * workers/service/ServiceWorkerContainer.cpp:
1926         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1927         * workers/service/ServiceWorkerProvider.h:
1928         * workers/service/context/SWContextManager.cpp: Removed.
1929         * workers/service/context/ServiceWorkerThread.h:
1930         * workers/service/server/SWServer.h:
1931
1932 2017-10-18  Zalan Bujtas  <zalan@apple.com>
1933
1934         [FrameView::layout cleanup] Group related pre-layout code to improve readability
1935         https://bugs.webkit.org/show_bug.cgi?id=178496
1936         <rdar://problem/35065718>
1937
1938         Reviewed by Simon Fraser.
1939
1940         Early returns/asserts/member variable resets etc.
1941
1942         Covered by existing tests.
1943
1944         * page/FrameView.cpp:
1945         (WebCore::FrameView::layout):
1946
1947 2017-10-17  Jiewen Tan  <jiewen_tan@apple.com>
1948
1949         Replace some stack raw pointers with RefPtrs within WebCore/html
1950         https://bugs.webkit.org/show_bug.cgi?id=178201
1951         <rdar://problem/34841692>
1952
1953         Reviewed by Ryosuke Niwa.
1954
1955         This is an effort to reduce raw pointer usage in DOM code. In this patch, raw pointers
1956         that are ref countable are blindly selected to be replaced with RefPtrs with one exception
1957         which is auto*.
1958
1959         Also, this patch occasionally modifies the return type of some methods, and therefore callers
1960         of those methods are modified accordingly.
1961
1962         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
1963         (WebCore::LegacyCDM::mediaPlayer const):
1964         * Modules/encryptedmedia/legacy/LegacyCDM.h:
1965         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
1966         (WebCore::CDMPrivateMediaPlayer::createSession):
1967         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
1968         (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
1969         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
1970         * Modules/mediacontrols/MediaControlsHost.cpp:
1971         (WebCore::MediaControlsHost::externalDeviceDisplayName const):
1972         (WebCore::MediaControlsHost::externalDeviceType const):
1973         * dom/Element.cpp:
1974         (WebCore::Element::focusDelegate):
1975         (WebCore::Element::userAgentShadowRoot const):
1976         (WebCore::Element::ensureUserAgentShadowRoot):
1977         * dom/Element.h:
1978         * dom/EventContext.cpp:
1979         (WebCore::TouchEventContext::checkReachability const):
1980         * dom/EventPath.cpp:
1981         (WebCore::shouldEventCrossShadowBoundary):
1982         (WebCore::EventPath::setRelatedTarget):
1983         (WebCore::EventPath::retargetTouch):
1984         (WebCore:: const):
1985         * dom/EventTarget.cpp:
1986         (WebCore::EventTarget::toNode):
1987         (WebCore::EventTarget::addEventListener):
1988         * dom/EventTarget.h:
1989         * dom/MouseEvent.cpp:
1990         (WebCore::MouseEvent::toElement const):
1991         (WebCore::MouseEvent::fromElement const):
1992         * dom/MouseEvent.h:
1993         * dom/MouseRelatedEvent.cpp:
1994         (WebCore::MouseRelatedEvent::computeRelativePosition):
1995         * dom/Node.cpp:
1996         (WebCore::Node::toNode):
1997         * dom/Node.h:
1998         * dom/ScopedEventQueue.cpp:
1999         * editing/Editor.cpp:
2000         (WebCore::Editor::selectionForCommand):
2001         * editing/EditorCommand.cpp:
2002         (WebCore::targetFrame):
2003         * editing/TextIterator.cpp:
2004         (WebCore::TextIterator::handleReplacedElement):
2005         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2006         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
2007         * html/ColorInputType.cpp:
2008         (WebCore::ColorInputType::updateColorSwatch):
2009         (WebCore::ColorInputType::shadowColorSwatch const):
2010         * html/FileInputType.cpp:
2011         (WebCore::FileInputType::disabledAttributeChanged):
2012         (WebCore::FileInputType::multipleAttributeChanged):
2013         * html/FormAssociatedElement.cpp:
2014         (WebCore::FormAssociatedElement::findAssociatedForm):
2015         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
2016         (WebCore::FormAssociatedElement::resetFormOwner):
2017         (WebCore::FormAssociatedElement::formAttributeChanged):
2018         * html/FormController.cpp:
2019         (WebCore::recordFormStructure):
2020         (WebCore::FormKeyGenerator::formKey):
2021         (WebCore::FormController::restoreControlStateIn):
2022         * html/HTMLAnchorElement.cpp:
2023         (WebCore::appendServerMapMousePosition):
2024         (WebCore::HTMLAnchorElement::handleClick):
2025         * html/HTMLAppletElement.cpp:
2026         (WebCore::HTMLAppletElement::updateWidget):
2027         * html/HTMLAreaElement.cpp:
2028         (WebCore::HTMLAreaElement::imageElement const):
2029         (WebCore::HTMLAreaElement::isFocusable const):
2030         (WebCore::HTMLAreaElement::setFocus):
2031         (WebCore::HTMLAreaElement::updateFocusAppearance):
2032         * html/HTMLBodyElement.cpp:
2033         (WebCore::HTMLBodyElement::scrollLeft):
2034         (WebCore::HTMLBodyElement::setScrollLeft):
2035         (WebCore::HTMLBodyElement::scrollTop):
2036         (WebCore::HTMLBodyElement::setScrollTop):
2037         (WebCore::HTMLBodyElement::scrollHeight):
2038         (WebCore::HTMLBodyElement::scrollWidth):
2039         * html/HTMLCanvasElement.cpp:
2040         (WebCore::HTMLCanvasElement::createElementRenderer):
2041         (WebCore:: const):
2042         * html/HTMLDocument.cpp:
2043         (WebCore::HTMLDocument::width):
2044         (WebCore::HTMLDocument::height):
2045         * html/HTMLElement.cpp:
2046         (WebCore::HTMLElement::rendererIsNeeded):
2047         (WebCore::setHasDirAutoFlagRecursively):
2048         (WebCore::HTMLElement::directionality const):
2049         (WebCore::HTMLElement::dirAttributeChanged):
2050         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
2051         * html/HTMLEmbedElement.cpp:
2052         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
2053         (WebCore::HTMLEmbedElement::rendererIsNeeded):
2054         * html/HTMLFieldSetElement.cpp:
2055         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
2056         (WebCore::HTMLFieldSetElement::disabledStateChanged):
2057         (WebCore::HTMLFieldSetElement::childrenChanged):
2058         * html/HTMLFormControlElement.cpp:
2059         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
2060         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
2061         (WebCore::HTMLFormControlElement::didChangeForm):
2062         (WebCore::HTMLFormControlElement::shouldAutocorrect const):
2063         (WebCore::HTMLFormControlElement::autocapitalizeType const):
2064         * html/HTMLFormElement.cpp:
2065         (WebCore::HTMLFormElement::handleLocalEvents):
2066         (WebCore::submitElementFromEvent):
2067         (WebCore::HTMLFormElement::prepareForSubmission):
2068         (WebCore::HTMLFormElement::submit):
2069         (WebCore::HTMLFormElement::reset):
2070         (WebCore::HTMLFormElement::shouldAutocorrect const):
2071         (WebCore::HTMLFormElement::parseAttribute):
2072         (WebCore::HTMLFormElement::resetDefaultButton):
2073         (WebCore::HTMLFormElement::elementFromPastNamesMap const):
2074         (WebCore::HTMLFormElement::namedElements):
2075         * html/HTMLFormElement.h:
2076         * html/HTMLFrameElement.cpp:
2077         (WebCore::HTMLFrameElement::didAttachRenderers):
2078         * html/HTMLFrameElementBase.cpp:
2079         (WebCore::HTMLFrameElementBase::isURLAllowed const):
2080         (WebCore::HTMLFrameElementBase::openURL):
2081         (WebCore::HTMLFrameElementBase::didAttachRenderers):
2082         * html/HTMLFrameOwnerElement.cpp:
2083         (WebCore::HTMLFrameOwnerElement::setContentFrame):
2084         (WebCore::HTMLFrameOwnerElement::clearContentFrame):
2085         (WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
2086         (WebCore::SubframeLoadingDisabler::canLoadFrame):
2087         * html/HTMLFrameSetElement.cpp:
2088         (WebCore::HTMLFrameSetElement::findContaining):
2089         (WebCore::HTMLFrameSetElement::willAttachRenderers):
2090         (WebCore::HTMLFrameSetElement::insertedInto):
2091         (WebCore::HTMLFrameSetElement::removedFrom):
2092         * html/HTMLFrameSetElement.h:
2093         * html/HTMLImageElement.cpp:
2094         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2095         (WebCore::HTMLImageElement::pictureElement const):
2096         (WebCore::HTMLImageElement::destroyImageControls):
2097         (WebCore::HTMLImageElement::hasImageControls const):
2098         * html/HTMLInputElement.cpp:
2099         (WebCore::HTMLInputElement::innerTextElement const):
2100         (WebCore::HTMLInputElement::endEditing):
2101         (WebCore::HTMLInputElement::dataList const):
2102         (WebCore::HTMLInputElement::resetListAttributeTargetObserver): Deleted.
2103         (WebCore::HTMLInputElement::listAttributeTargetChanged): Deleted.
2104         (WebCore::HTMLInputElement::isSteppable const): Deleted.
2105         (WebCore::HTMLInputElement::dateType const): Deleted.
2106         (WebCore::HTMLInputElement::isTextButton const): Deleted.
2107         (WebCore::HTMLInputElement::isRadioButton const): Deleted.
2108         (WebCore::HTMLInputElement::isSearchField const): Deleted.
2109         (WebCore::HTMLInputElement::isInputTypeHidden const): Deleted.
2110         (WebCore::HTMLInputElement::isPasswordField const): Deleted.
2111         (WebCore::HTMLInputElement::isCheckbox const): Deleted.
2112         (WebCore::HTMLInputElement::isRangeControl const): Deleted.
2113         (WebCore::HTMLInputElement::isColorControl const): Deleted.
2114         (WebCore::HTMLInputElement::isText const): Deleted.
2115         (WebCore::HTMLInputElement::isEmailField const): Deleted.
2116         (WebCore::HTMLInputElement::isFileUpload const): Deleted.
2117         (WebCore::HTMLInputElement::isImageButton const): Deleted.
2118         (WebCore::HTMLInputElement::isNumberField const): Deleted.
2119         (WebCore::HTMLInputElement::isSubmitButton const): Deleted.
2120         (WebCore::HTMLInputElement::isTelephoneField const): Deleted.
2121         (WebCore::HTMLInputElement::isURLField const): Deleted.
2122         (WebCore::HTMLInputElement::isDateField const): Deleted.
2123         (WebCore::HTMLInputElement::isDateTimeField const): Deleted.
2124         (WebCore::HTMLInputElement::isDateTimeLocalField const): Deleted.
2125         (WebCore::HTMLInputElement::isMonthField const): Deleted.
2126         (WebCore::HTMLInputElement::isTimeField const): Deleted.
2127         (WebCore::HTMLInputElement::isWeekField const): Deleted.
2128         (WebCore::HTMLInputElement::isEnumeratable const): Deleted.
2129         (WebCore::HTMLInputElement::supportLabels const): Deleted.
2130         (WebCore::HTMLInputElement::shouldAppearChecked const): Deleted.
2131         (WebCore::HTMLInputElement::supportsPlaceholder const): Deleted.
2132         (WebCore::HTMLInputElement::updatePlaceholderText): Deleted.
2133         (WebCore::HTMLInputElement::isEmptyValue const): Deleted.
2134         (WebCore::HTMLInputElement::maxLengthAttributeChanged): Deleted.
2135         (WebCore::HTMLInputElement::minLengthAttributeChanged): Deleted.
2136         (WebCore::HTMLInputElement::updateValueIfNeeded): Deleted.
2137         (WebCore::HTMLInputElement::defaultToolTip const): Deleted.
2138         (WebCore::HTMLInputElement::matchesIndeterminatePseudoClass const): Deleted.
2139         (WebCore::HTMLInputElement::shouldAppearIndeterminate const): Deleted.
2140         (WebCore::HTMLInputElement::mediaCaptureType const): Deleted.
2141         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Deleted.
2142         (WebCore:: const): Deleted.
2143         (WebCore::HTMLInputElement::checkedRadioButtonForGroup const): Deleted.
2144         (WebCore::HTMLInputElement::radioButtonGroups const): Deleted.
2145         (WebCore::HTMLInputElement::addToRadioButtonGroup): Deleted.
2146         (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Deleted.
2147         (WebCore::HTMLInputElement::height const): Deleted.
2148         (WebCore::HTMLInputElement::width const): Deleted.
2149         (WebCore::HTMLInputElement::setHeight): Deleted.
2150         (WebCore::HTMLInputElement::setWidth): Deleted.
2151         (WebCore::ListAttributeTargetObserver::ListAttributeTargetObserver): Deleted.
2152         (WebCore::ListAttributeTargetObserver::idTargetChanged): Deleted.
2153         (WebCore::HTMLInputElement::setRangeText): Deleted.
2154         (WebCore::HTMLInputElement::shouldTruncateText const): Deleted.
2155         (WebCore::HTMLInputElement::selectionStartForBindings const): Deleted.
2156         (WebCore::HTMLInputElement::setSelectionStartForBindings): Deleted.
2157         (WebCore::HTMLInputElement::selectionEndForBindings const): Deleted.
2158         (WebCore::HTMLInputElement::setSelectionEndForBindings): Deleted.
2159         (WebCore::HTMLInputElement::selectionDirectionForBindings const): Deleted.
2160         (WebCore::HTMLInputElement::setSelectionDirectionForBindings): Deleted.
2161         (WebCore::HTMLInputElement::setSelectionRangeForBindings): Deleted.
2162         (WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
2163         (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Deleted.
2164         (WebCore::HTMLInputElement::capsLockStateMayHaveChanged): Deleted.
2165         * html/HTMLInputElement.h:
2166         * html/HTMLKeygenElement.cpp:
2167         (WebCore::HTMLKeygenElement::shadowSelect const):
2168         * html/HTMLLabelElement.cpp:
2169         (WebCore::HTMLLabelElement::defaultEventHandler):
2170         * html/HTMLLinkElement.cpp:
2171         (WebCore::HTMLLinkElement::handleClick):
2172         * html/HTMLMapElement.cpp:
2173         (WebCore::HTMLMapElement::mapMouseEvent):
2174         * html/HTMLMediaElement.cpp:
2175         (WebCore::HTMLMediaElement::selectMediaResource):
2176         (WebCore::HTMLMediaElement::loadResource):
2177         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2178         (WebCore::HTMLMediaElement::isSafeToLoadURL):
2179         (WebCore::HTMLMediaElement::controls const):
2180         (WebCore::HTMLMediaElement::layoutSizeChanged):
2181         (WebCore::HTMLMediaElement::enterFullscreen):
2182         (WebCore::HTMLMediaElement::mediaControls const):
2183         (WebCore::HTMLMediaElement::hasMediaControls const):
2184         (WebCore::HTMLMediaElement::mediaPlayerReferrer const):
2185         (WebCore::HTMLMediaElement::mediaPlayerUserAgent const):
2186         (WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge):
2187         (WebCore::HTMLMediaElement::sourceApplicationIdentifier const):
2188         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
2189         (WebCore::HTMLMediaElement::session const):
2190         * html/HTMLMediaElement.h:
2191         (WebCore::HTMLMediaElement::player const):
2192         * html/HTMLObjectElement.cpp:
2193         (WebCore::HTMLObjectElement::hasFallbackContent const):
2194         * html/HTMLOptGroupElement.cpp:
2195         (WebCore::HTMLOptGroupElement::ownerSelectElement const):
2196         (WebCore::HTMLOptGroupElement::accessKeyAction):
2197         * html/HTMLOptionElement.cpp:
2198         (WebCore::HTMLOptionElement::setText):
2199         (WebCore::HTMLOptionElement::accessKeyAction):
2200         (WebCore::HTMLOptionElement::index const):
2201         (WebCore::HTMLOptionElement::parseAttribute):
2202         (WebCore::HTMLOptionElement::selected):
2203         (WebCore::HTMLOptionElement::setSelected):
2204         (WebCore::HTMLOptionElement::setSelectedState):
2205         (WebCore::HTMLOptionElement::childrenChanged):
2206         (WebCore::HTMLOptionElement::ownerDataListElement const):
2207         (WebCore::HTMLOptionElement::ownerSelectElement const):
2208         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
2209         (WebCore::HTMLOptionElement::insertedInto):
2210         (WebCore::HTMLOptionElement::collectOptionInnerText const):
2211         * html/HTMLPlugInElement.cpp:
2212         (WebCore::HTMLPlugInElement::willDetachRenderers):
2213         (WebCore::HTMLPlugInElement::isKeyboardFocusable const):
2214         (WebCore::HTMLPlugInElement::isUserObservable const):
2215         * html/HTMLPlugInImageElement.cpp:
2216         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
2217         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
2218         * html/HTMLSelectElement.cpp:
2219         (WebCore::HTMLSelectElement::add):
2220         (WebCore::HTMLSelectElement::recalcListItems const):
2221         (WebCore::HTMLSelectElement::selectOption):
2222         (WebCore::HTMLSelectElement::reset):
2223         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2224         * html/HTMLSlotElement.cpp:
2225         (WebCore::flattenAssignedNodes):
2226         * html/HTMLSourceElement.cpp:
2227         (WebCore::HTMLSourceElement::removedFrom):
2228         * html/HTMLSummaryElement.cpp:
2229         (WebCore::HTMLSummaryElement::isActiveSummary const):
2230         (WebCore::isClickableControl):
2231         (WebCore::HTMLSummaryElement::defaultEventHandler):
2232         * html/HTMLTableCellElement.cpp:
2233         (WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
2234         * html/HTMLTableColElement.cpp:
2235         (WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
2236         * html/HTMLTableElement.cpp:
2237         (WebCore::HTMLTableElement::tHead const):
2238         (WebCore::HTMLTableElement::setTHead):
2239         (WebCore::HTMLTableElement::tFoot const):
2240         (WebCore::HTMLTableElement::createTBody):
2241         (WebCore::HTMLTableElement::lastBody const):
2242         (WebCore::HTMLTableElement::deleteRow):
2243         * html/HTMLTablePartElement.cpp:
2244         (WebCore::HTMLTablePartElement::findParentTable const):
2245         * html/HTMLTableRowsCollection.cpp:
2246         (WebCore::HTMLTableRowsCollection::rowAfter):
2247         * html/HTMLTextAreaElement.cpp:
2248         (WebCore::HTMLTextAreaElement::subtreeHasChanged):
2249         (WebCore::HTMLTextAreaElement::innerTextElement const):
2250         * html/HTMLTextAreaElement.h:
2251         * html/HTMLTextFormControlElement.cpp:
2252         (WebCore::HTMLTextFormControlElement::setSelectionRange):
2253         (WebCore::HTMLTextFormControlElement::indexForVisiblePosition const):
2254         (WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
2255         (WebCore::HTMLTextFormControlElement::computeSelectionStart const):
2256         (WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
2257         (WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
2258         (WebCore::HTMLTextFormControlElement::selection const):
2259         (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
2260         (WebCore::innerTextValueFrom):
2261         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
2262         (WebCore::HTMLTextFormControlElement::innerTextValue const):
2263         (WebCore::positionForIndex):
2264         (WebCore::HTMLTextFormControlElement::indexForPosition const):
2265         (WebCore::HTMLTextFormControlElement::hidePlaceholder):
2266         (WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary):
2267         (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
2268         (WebCore::enclosingTextFormControl):
2269         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
2270         * html/HTMLTextFormControlElement.h:
2271         * html/HTMLTrackElement.cpp:
2272         (WebCore::HTMLTrackElement::canLoadURL):
2273         (WebCore::HTMLTrackElement::setReadyState):
2274         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute const):
2275         (WebCore::HTMLTrackElement::textTrackKindChanged):
2276         (WebCore::HTMLTrackElement::textTrackModeChanged):
2277         (WebCore::HTMLTrackElement::textTrackAddCues):
2278         (WebCore::HTMLTrackElement::textTrackRemoveCues):
2279         (WebCore::HTMLTrackElement::textTrackAddCue):
2280         (WebCore::HTMLTrackElement::textTrackRemoveCue):
2281         (WebCore::HTMLTrackElement::mediaElement const):
2282         * html/HTMLTrackElement.h:
2283         * html/HTMLVideoElement.cpp:
2284         (WebCore::HTMLVideoElement::setDisplayMode):
2285         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
2286         * html/ImageDocument.cpp:
2287         (WebCore::ImageDocument::createDocumentStructure):
2288         (WebCore::ImageDocument::scale):
2289         (WebCore::ImageDocument::imageFitsInWindow):
2290         * html/InputType.cpp:
2291         (WebCore::InputType::destroyShadowSubtree):
2292         * html/InputType.h:
2293         (WebCore::InputType::innerTextElement const):
2294         * html/MediaDocument.cpp:
2295         (WebCore::MediaDocumentParser::createDocumentStructure):
2296         (WebCore::MediaDocument::defaultEventHandler):
2297         * html/MediaElementSession.cpp:
2298         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
2299         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
2300         (WebCore::isMainContentForPurposesOfAutoplay):
2301         * html/NumberInputType.cpp:
2302         (WebCore::NumberInputType::decorationWidth const):
2303         * html/PluginDocument.cpp:
2304         (WebCore::PluginDocumentParser::appendBytes):
2305         * html/RadioInputType.cpp:
2306         (WebCore::RadioInputType::handleKeydownEvent):
2307         (WebCore::RadioInputType::isKeyboardFocusable const):
2308         (WebCore::RadioInputType::didDispatchClick):
2309         * html/RadioNodeList.cpp:
2310         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const):
2311         * html/RangeInputType.cpp:
2312         (WebCore::RangeInputType::handleMouseDownEvent):
2313         (WebCore::RangeInputType::handleTouchEvent):
2314         (WebCore::RangeInputType::sliderTrackElement const):
2315         (WebCore::RangeInputType::listAttributeTargetChanged):
2316         (WebCore::RangeInputType::updateTickMarkValues):
2317         * html/SearchInputType.cpp:
2318         (WebCore::SearchInputType::createShadowSubtree):
2319         * html/TextFieldInputType.cpp:
2320         (WebCore::TextFieldInputType::isEmptyValue const):
2321         (WebCore::TextFieldInputType::handleKeydownEvent):
2322         (WebCore::TextFieldInputType::handleFocusEvent):
2323         (WebCore::TextFieldInputType::innerTextElement const):
2324         (WebCore::TextFieldInputType::updatePlaceholderText):
2325         (WebCore::TextFieldInputType::didSetValueByUserEdit):
2326         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
2327         * html/TextFieldInputType.h:
2328         * html/canvas/CanvasRenderingContext2D.cpp:
2329         (WebCore::size):
2330         (WebCore::CanvasRenderingContext2D::drawImage):
2331         * html/canvas/WebGL2RenderingContext.cpp:
2332         (WebCore::WebGL2RenderingContext::copyBufferSubData):
2333         (WebCore::WebGL2RenderingContext::getBufferSubData):
2334         * html/canvas/WebGLFramebuffer.cpp:
2335         (WebCore::WebGLFramebuffer::attach):
2336         (WebCore::WebGLFramebuffer::getAttachmentObject const):
2337         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
2338         (WebCore::WebGLFramebuffer::getColorBufferWidth const):
2339         (WebCore::WebGLFramebuffer::getColorBufferHeight const):
2340         (WebCore::WebGLFramebuffer::getColorBufferFormat const):
2341         (WebCore::WebGLFramebuffer::checkStatus const):
2342         (WebCore::WebGLFramebuffer::hasStencilBuffer const):
2343         (WebCore::WebGLFramebuffer::initializeAttachments):
2344         * html/canvas/WebGLRenderingContext.cpp:
2345         (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
2346         * html/canvas/WebGLRenderingContextBase.cpp:
2347         (WebCore::WebGLRenderingContextBase::create):
2348         (WebCore::WebGLRenderingContextBase::bufferData):
2349         (WebCore::WebGLRenderingContextBase::bufferSubData):
2350         (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
2351         (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
2352         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
2353         (WebCore::WebGLRenderingContextBase::generateMipmap):
2354         (WebCore::WebGLRenderingContextBase::getAttachedShaders):
2355         (WebCore::WebGLRenderingContextBase::getTexParameter):
2356         (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
2357         (WebCore::WebGLRenderingContextBase::texImage2DBase):
2358         (WebCore::WebGLRenderingContextBase::validateTexFunc):
2359         (WebCore::WebGLRenderingContextBase::texSubImage2D):
2360         (WebCore::WebGLRenderingContextBase::texSubImage2DBase):
2361         (WebCore::WebGLRenderingContextBase::copyTexImage2D):
2362         (WebCore::WebGLRenderingContextBase::texImage2D):
2363         (WebCore::WebGLRenderingContextBase::texParameter):
2364         (WebCore::WebGLRenderingContextBase::loseContextImpl):
2365         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
2366         (WebCore::WebGLRenderingContextBase::validateTextureBinding):
2367         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2368         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
2369         (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const):
2370         (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor):
2371         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
2372         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const):
2373         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth):
2374         * html/parser/HTMLConstructionSite.cpp:
2375         (WebCore::executeInsertAlreadyParsedChildTask):
2376         (WebCore::HTMLConstructionSite::insertTextNode):
2377         * html/parser/HTMLFormattingElementList.cpp:
2378         (WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly):
2379         * html/parser/HTMLParserOptions.cpp:
2380         (WebCore::HTMLParserOptions::HTMLParserOptions):
2381         * html/parser/HTMLParserScheduler.cpp:
2382         (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
2383         * html/parser/HTMLTreeBuilder.cpp:
2384         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2385         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
2386         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
2387         * html/parser/XSSAuditor.cpp:
2388         (WebCore::XSSAuditor::init):
2389         * html/shadow/MediaControlElementTypes.cpp:
2390         (WebCore::parentMediaElement):
2391         * html/shadow/MediaControlElementTypes.h:
2392         (WebCore::parentMediaElement):
2393         * html/shadow/MediaControlElements.cpp:
2394         (WebCore::MediaControlPanelElement::startDrag):
2395         (WebCore::MediaControlPanelElement::endDrag):
2396         (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
2397         (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
2398         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
2399         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
2400         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
2401         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
2402         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
2403         (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
2404         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
2405         (WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
2406         (WebCore::MediaControlTextTrackContainerElement::updateSizes):
2407         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
2408         * html/shadow/MediaControls.cpp:
2409         (WebCore::MediaControls::containsRelatedTarget):
2410         * html/shadow/SliderThumbElement.cpp:
2411         (WebCore::SliderThumbElement::isDisabledFormControl const):
2412         (WebCore::SliderThumbElement::matchesReadWritePseudoClass const):
2413         (WebCore::SliderThumbElement::focusDelegate):
2414         (WebCore::SliderThumbElement::setPositionFromPoint):
2415         (WebCore::SliderThumbElement::startDragging):
2416         (WebCore::SliderThumbElement::stopDragging):
2417         (WebCore::SliderThumbElement::defaultEventHandler):
2418         (WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
2419         (WebCore::SliderThumbElement::willRespondToMouseClickEvents):
2420         (WebCore::SliderThumbElement::willDetachRenderers):
2421         (WebCore::findTouchWithIdentifier):
2422         (WebCore::SliderThumbElement::handleTouchStart):
2423         (WebCore::SliderThumbElement::handleTouchMove):
2424         (WebCore::SliderThumbElement::handleTouchEndAndCancel):
2425         (WebCore::SliderThumbElement::handleTouchEvent):
2426         (WebCore::SliderThumbElement::hostInput const):
2427         * html/shadow/SliderThumbElement.h:
2428         * html/shadow/SpinButtonElement.cpp:
2429         (WebCore::SpinButtonElement::defaultEventHandler):
2430         (WebCore::SpinButtonElement::releaseCapture):
2431         * html/shadow/TextControlInnerElements.cpp:
2432         (WebCore::TextControlInnerTextElement::defaultEventHandler):
2433         (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
2434         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
2435         (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
2436         * html/track/LoadableTextTrack.cpp:
2437         (WebCore::LoadableTextTrack::trackElementIndex):
2438         * html/track/TextTrack.cpp:
2439         (WebCore::TextTrack::setMode):
2440         (WebCore::TextTrack::hasCue):
2441         * html/track/TextTrackCueGeneric.cpp:
2442         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
2443         * html/track/VTTCue.cpp:
2444         (WebCore::VTTCue::copyWebVTTNodeToDOMTree):
2445         (WebCore::VTTCue::determineTextDirection):
2446         (WebCore::VTTCue::markFutureAndPastNodes):
2447         (WebCore::VTTCue::removeDisplayTree):
2448         (WebCore::VTTCue::cueContentsMatch const):
2449         * inspector/InspectorDOMAgent.cpp:
2450         (WebCore::InspectorDOMAgent::didAddEventListener):
2451         (WebCore::InspectorDOMAgent::willRemoveEventListener):
2452         * loader/FormSubmission.cpp:
2453         (WebCore::FormSubmission::create):
2454         * page/ContextMenuController.cpp:
2455         (WebCore::ContextMenuController::maybeCreateContextMenu):
2456         * rendering/RenderSnapshottedPlugIn.cpp:
2457         (WebCore::RenderSnapshottedPlugIn::handleEvent):
2458         * rendering/RenderTextControl.cpp:
2459         (WebCore::RenderTextControl::innerTextElement const):
2460         (WebCore::RenderTextControl::styleDidChange):
2461         (WebCore::RenderTextControl::textBlockLogicalWidth const):
2462         (WebCore::RenderTextControl::computeLogicalHeight const):
2463         (WebCore::RenderTextControl::hitInnerTextElement):
2464         (WebCore::RenderTextControl::canScroll const):
2465         (WebCore::RenderTextControl::innerLineHeight const):
2466         * rendering/RenderTextControl.h:
2467         * rendering/RenderTextControlSingleLine.cpp:
2468         (WebCore::RenderTextControlSingleLine::nodeAtPoint):
2469         (WebCore::RenderTextControlSingleLine::styleDidChange):
2470         * rendering/RenderTheme.cpp:
2471         (WebCore::RenderTheme::isFocused const):
2472         * rendering/RenderThemeGtk.cpp:
2473         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
2474         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
2475         * rendering/RenderThemeMac.mm:
2476         (WebCore::RenderThemeMac::paintSliderThumb):
2477         * rendering/RenderVideo.cpp:
2478         (WebCore::RenderVideo::willBeDestroyed):
2479         (WebCore::RenderVideo::calculateIntrinsicSize):
2480         (WebCore::RenderVideo::paintReplaced):
2481         (WebCore::RenderVideo::updatePlayer):
2482         (WebCore::RenderVideo::supportsAcceleratedRendering const):
2483         (WebCore::RenderVideo::acceleratedRenderingStateChanged):
2484         (WebCore::RenderVideo::requiresImmediateCompositing const):
2485         (WebCore::RenderVideo::foregroundIsKnownToBeOpaqueInRect const):
2486         * svg/SVGUseElement.cpp:
2487         (WebCore::SVGUseElement::clearShadowTree):
2488         (WebCore::SVGUseElement::targetClone const):
2489
2490 2017-10-18  Dean Jackson  <dino@apple.com>
2491
2492         Some older hardware can't actually use renderbuffers at the size they advertise
2493         https://bugs.webkit.org/show_bug.cgi?id=178417
2494         <rdar://problem/35042291>
2495
2496         Reviewed by Tim Horton.
2497
2498         The change in r223567 caused some older hardware to fail, because even though
2499         they claimed to support a maximum renderbuffer and viewport of 16K, they were
2500         unable to actually handle one. Rather than trying to identify such hardware,
2501         clamp all buffers to a maximum of 8192. This is bigger than the previous value
2502         of 4096, and large enough to have a full-screen buffer on a Retina 5K iMac.
2503
2504         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2505         (WebCore::GraphicsContext3D::getIntegerv):
2506
2507 2017-10-18  Chris Dumez  <cdumez@apple.com>
2508
2509         [Service Worker] Add stubs for Client / WindowClient / Clients
2510         https://bugs.webkit.org/show_bug.cgi?id=178469
2511
2512         Reviewed by Youenn Fablet.
2513
2514         Add stubs for Client / WindowClient / Clients:
2515         - https://w3c.github.io/ServiceWorker/v1/#clients
2516         - https://w3c.github.io/ServiceWorker/v1/#client-interface
2517
2518         * CMakeLists.txt:
2519         * DerivedSources.make:
2520         * WebCore.xcodeproj/project.pbxproj:
2521         * bindings/js/WebCoreBuiltinNames.h:
2522         * dom/Document.cpp:
2523         (WebCore::Document::visibilityState const):
2524         * dom/Document.h:
2525         * dom/Document.idl:
2526         * dom/VisibilityState.h: Renamed from Source/WebCore/page/PageVisibilityState.h.
2527         * dom/VisibilityState.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
2528         * page/Page.cpp:
2529         (WebCore::Page::visibilityState const):
2530         * page/Page.h:
2531         * workers/service/ServiceWorkerClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
2532         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
2533         (WebCore::ServiceWorkerClient::activeDOMObjectName const):
2534         (WebCore::ServiceWorkerClient::canSuspendForDocumentSuspension const):
2535         (WebCore::ServiceWorkerClient::url const):
2536         (WebCore::ServiceWorkerClient::frameType const):
2537         (WebCore::ServiceWorkerClient::id const):
2538         (WebCore::ServiceWorkerClient::postMessage):
2539         * workers/service/ServiceWorkerClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
2540         * workers/service/ServiceWorkerClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
2541         * workers/service/ServiceWorkerClients.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
2542         (WebCore::ServiceWorkerClients::ServiceWorkerClients):
2543         (WebCore::ServiceWorkerClients::activeDOMObjectName const):
2544         (WebCore::ServiceWorkerClients::canSuspendForDocumentSuspension const):
2545         (WebCore::ServiceWorkerClients::get):
2546         (WebCore::ServiceWorkerClients::matchAll):
2547         (WebCore::ServiceWorkerClients::openWindow):
2548         (WebCore::ServiceWorkerClients::claim):
2549         * workers/service/ServiceWorkerClients.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
2550         (WebCore::ServiceWorkerClients::create):
2551         * workers/service/ServiceWorkerClients.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
2552         * workers/service/ServiceWorkerGlobalScope.cpp:
2553         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
2554         * workers/service/ServiceWorkerGlobalScope.h:
2555         (WebCore::ServiceWorkerGlobalScope::clients):
2556         * workers/service/ServiceWorkerGlobalScope.idl:
2557         * workers/service/ServiceWorkerWindowClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
2558         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
2559         (WebCore::ServiceWorkerWindowClient::visibilityState const):
2560         (WebCore::ServiceWorkerWindowClient::isFocused const):
2561         (WebCore::ServiceWorkerWindowClient::focus):
2562         (WebCore::ServiceWorkerWindowClient::navigate):
2563         * workers/service/ServiceWorkerWindowClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
2564         * workers/service/ServiceWorkerWindowClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
2565
2566 2017-10-18  Zalan Bujtas  <zalan@apple.com>
2567
2568         [FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value on reentrancy
2569         https://bugs.webkit.org/show_bug.cgi?id=178479
2570         <rdar://problem/35056950>
2571
2572         Reviewed by Simon Fraser.
2573
2574         No change in functionality.
2575
2576         * page/FrameView.cpp:
2577         (WebCore::FrameView::layout):
2578
2579 2017-10-18  Zalan Bujtas  <zalan@apple.com>
2580
2581         [FrameView::layout cleanup] Remove InPreLayoutStyleUpdate.
2582         https://bugs.webkit.org/show_bug.cgi?id=178483
2583         <rdar://problem/35058800>
2584
2585         Reviewed by Simon Fraser.
2586
2587         Its client, updateCompositingLayersAfterStyleChange only needs to know if there's a upcoming
2588         layer update (part of FrameView::layout()).
2589
2590         No change in functionality.
2591
2592         * page/FrameView.cpp:
2593         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
2594         (WebCore::FrameView::layout):
2595         * page/FrameView.h:
2596
2597 2017-10-18  Chris Dumez  <cdumez@apple.com>
2598
2599         Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface
2600         https://bugs.webkit.org/show_bug.cgi?id=178482
2601
2602         Reviewed by Sam Weinig.
2603
2604         Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface,
2605         not the ServiceWorker interface.
2606
2607         * bindings/scripts/preprocess-idls.pl:
2608
2609 2017-10-17  Ryosuke Niwa  <rniwa@webkit.org>
2610
2611         Add an argument indicating the type of insertion to Node::insertedInto
2612         https://bugs.webkit.org/show_bug.cgi?id=178431
2613
2614         Reviewed by Antti Koivisto.
2615
2616         Added InsertionType as the first argument to Node::insertedInto, which contains two booleans indicating
2617         whether the node just become newly connected to a document, and whether node's tree scope had changed or not.
2618
2619         These boolean flags simplifie the logic in insertedInto implementations, and are required to have a better
2620         guarantee about the correctness of node flags during calls to insertedInto. Right now, isConnected() and
2621         isInShadowTree() are both outdated until Node::insertedInto is called.
2622
2623         Also renamed the second argument from insertionPoint to parentOfInsertedTree to make the semantics clear,
2624         and renamed finishedInsertingSubtree to didFinishInsertingNode, and renamed InsertionNotificationRequest
2625         to InsertedIntoResult using enum class.
2626
2627         Note that in some implementations of insertedInto, we check whether isConnected() was false to decide whether
2628         the node is newly connected to a document. This extra check is no longer necessary since no node will be inserted
2629         into a document without first being completely removed after r223458.
2630
2631         No new tests since there should be no behavioral changes.
2632
2633         * dom/ContainerNode.cpp:
2634         (WebCore::ContainerNode::notifyChildInserted):
2635         * dom/ContainerNodeAlgorithms.cpp:
2636         (WebCore::notifyNodeInsertedIntoDocument): Replaced the check that the node had not been disconnected by scripts
2637         by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
2638         (WebCore::notifyNodeInsertedIntoTree): Removed NoEventDispatchAssertion since notifyChildNodeInserted has it
2639         already since r223458.
2640         (WebCore::notifyChildNodeInserted): Made this function return NodeVector (copy elision).
2641         * dom/ContainerNodeAlgorithms.h:
2642         * dom/Element.cpp:
2643         (WebCore::Element::insertedInto): Use insertionType.connectedToDocument to detect when this element had become
2644         connected to some document. Similarly, use insertionType.treeScopeChanged to detect when this element had been
2645         inserted into a new tree scope. Removed the comment which became obsolete due to this cleanup.
2646         (WebCore::Element::addShadowRoot): Simplified the code here since we never attach a ShadowRoot with children.
2647         * dom/Element.h:
2648         * dom/Node.cpp:
2649         (WebCore::Node::insertedInto):
2650         * dom/Node.h:
2651         (WebCore::Node::InsertedIntoResult): Renamed from InsertionNotificationRequest, and turned into an enum class.
2652         (WebCore::Node::InsertionType): Added. We pass this object by value to insertedInto as a performance optimization
2653         as passing two booleans by value is faster than passing a pointer and then de-referencing it in a virtual callee.
2654         (WebCore::Node::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2655         * dom/ProcessingInstruction.cpp:
2656         (WebCore::ProcessingInstruction::insertedInto):
2657         (WebCore::ProcessingInstruction::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2658         * dom/ProcessingInstruction.h:
2659         * dom/ScriptElement.cpp:
2660         (WebCore::ScriptElement::shouldCallFinishedInsertingSubtree): Deleted.
2661         (WebCore::ScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2662         * dom/ScriptElement.h:
2663         (WebCore::ScriptElement::insertedInto const): Added. Extracted from shouldCallFinishedInsertingSubtree.
2664         * dom/ShadowRoot.cpp:
2665         (WebCore::ShadowRoot::insertedInto): The extra isConnected() check is no longer needed. See the description above.
2666         * dom/ShadowRoot.h:
2667         * html/FormAssociatedElement.cpp:
2668         (WebCore::FormAssociatedElement::insertedInto):
2669         * html/FormAssociatedElement.h:
2670         * html/HTMLBaseElement.cpp:
2671         (WebCore::HTMLBaseElement::insertedInto):
2672         * html/HTMLBaseElement.h:
2673         * html/HTMLBodyElement.cpp:
2674         (WebCore::HTMLBodyElement::insertedInto):
2675         (WebCore::HTMLBodyElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2676         * html/HTMLBodyElement.h:
2677         * html/HTMLFormControlElement.cpp:
2678         (WebCore::HTMLFormControlElement::insertedInto):
2679         (WebCore::HTMLFormControlElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2680         * html/HTMLFormControlElement.h:
2681         * html/HTMLFormControlElementWithState.cpp:
2682         (WebCore::HTMLFormControlElementWithState::insertedInto):
2683         * html/HTMLFormControlElementWithState.h:
2684         * html/HTMLFormElement.cpp:
2685         (WebCore::HTMLFormElement::insertedInto):
2686         * html/HTMLFormElement.h:
2687         * html/HTMLFrameElementBase.cpp:
2688         (WebCore::HTMLFrameElementBase::insertedInto):
2689         (WebCore::HTMLFrameElementBase::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2690         * html/HTMLFrameElementBase.h:
2691         * html/HTMLFrameSetElement.cpp:
2692         (WebCore::HTMLFrameSetElement::insertedInto):
2693         * html/HTMLFrameSetElement.h:
2694         * html/HTMLImageElement.cpp:
2695         (WebCore::HTMLImageElement::insertedInto):
2696         * html/HTMLImageElement.h:
2697         * html/HTMLInputElement.cpp:
2698         (WebCore::HTMLInputElement::insertedInto):
2699         (WebCore::HTMLInputElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2700         * html/HTMLInputElement.h:
2701         * html/HTMLLinkElement.cpp:
2702         (WebCore::HTMLLinkElement::insertedInto): The extra isConnected() check is no longer needed. See above.
2703         (WebCore::HTMLLinkElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2704         * html/HTMLLinkElement.h:
2705         * html/HTMLMapElement.cpp:
2706         (WebCore::HTMLMapElement::insertedInto):
2707         * html/HTMLMapElement.h:
2708         * html/HTMLMediaElement.cpp:
2709         (WebCore::HTMLMediaElement::insertedInto):
2710         (WebCore::HTMLMediaElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2711         * html/HTMLMediaElement.h:
2712         * html/HTMLMetaElement.cpp:
2713         (WebCore::HTMLMetaElement::insertedInto):
2714         * html/HTMLMetaElement.h:
2715         * html/HTMLObjectElement.cpp:
2716         (WebCore::HTMLObjectElement::insertedInto):
2717         (WebCore::HTMLObjectElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2718         * html/HTMLObjectElement.h:
2719         * html/HTMLOptionElement.cpp:
2720         (WebCore::HTMLOptionElement::insertedInto):
2721         * html/HTMLOptionElement.h:
2722         * html/HTMLScriptElement.cpp:
2723         (WebCore::HTMLScriptElement::insertedInto):
2724         (WebCore::HTMLScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2725         * html/HTMLScriptElement.h:
2726         * html/HTMLSelectElement.cpp:
2727         (WebCore::HTMLSelectElement::insertedInto):
2728         * html/HTMLSelectElement.h:
2729         * html/HTMLSlotElement.cpp:
2730         (WebCore::HTMLSlotElement::insertedInto): Replaced a cumbersome condition by a boolean check on insertionType's
2731         treeScopeChanged and removed the accompanying comment which is no longer needed.
2732         * html/HTMLSlotElement.h:
2733         * html/HTMLSourceElement.cpp:
2734         (WebCore::HTMLSourceElement::insertedInto):
2735         * html/HTMLSourceElement.h:
2736         * html/HTMLStyleElement.cpp:
2737         (WebCore::HTMLStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above.
2738         * html/HTMLStyleElement.h:
2739         * html/HTMLTextFormControlElement.cpp:
2740         (WebCore::HTMLTextFormControlElement::insertedInto):
2741         * html/HTMLTextFormControlElement.h:
2742         * html/HTMLTitleElement.cpp:
2743         (WebCore::HTMLTitleElement::insertedInto):
2744         * html/HTMLTitleElement.h:
2745         * html/HTMLTrackElement.cpp:
2746         (WebCore::HTMLTrackElement::insertedInto): Added a FIXME since this code is clearly wrong.
2747         * html/HTMLTrackElement.h:
2748         * svg/SVGElement.cpp:
2749         (WebCore::SVGElement::insertedInto):
2750         * svg/SVGElement.h:
2751         * svg/SVGFEImageElement.cpp:
2752         (WebCore::SVGFEImageElement::insertedInto):
2753         (WebCore::SVGFEImageElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2754         * svg/SVGFEImageElement.h:
2755         * svg/SVGFontFaceElement.cpp:
2756         (WebCore::SVGFontFaceElement::insertedInto):
2757         * svg/SVGFontFaceElement.h:
2758         * svg/SVGFontFaceUriElement.cpp:
2759         (WebCore::SVGFontFaceUriElement::insertedInto):
2760         * svg/SVGFontFaceUriElement.h:
2761         * svg/SVGImageElement.cpp:
2762         (WebCore::SVGImageElement::insertedInto):
2763         * svg/SVGImageElement.h:
2764         * svg/SVGMPathElement.cpp:
2765         (WebCore::SVGMPathElement::insertedInto):
2766         (WebCore::SVGMPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2767         * svg/SVGMPathElement.h:
2768         * svg/SVGPathElement.cpp:
2769         (WebCore::SVGPathElement::insertedInto):
2770         * svg/SVGPathElement.h:
2771         * svg/SVGSVGElement.cpp:
2772         (WebCore::SVGSVGElement::insertedInto):
2773         * svg/SVGSVGElement.h:
2774         * svg/SVGScriptElement.cpp:
2775         (WebCore::SVGScriptElement::insertedInto):
2776         (WebCore::SVGScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2777         * svg/SVGScriptElement.h:
2778         * svg/SVGStyleElement.cpp:
2779         (WebCore::SVGStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above description.
2780         * svg/SVGStyleElement.h:
2781         * svg/SVGTRefElement.cpp:
2782         (WebCore::SVGTRefElement::insertedInto):
2783         (WebCore::SVGTRefElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2784         * svg/SVGTRefElement.h:
2785         * svg/SVGTextPathElement.cpp:
2786         (WebCore::SVGTextPathElement::insertedInto):
2787         (WebCore::SVGTextPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2788         * svg/SVGTextPathElement.h:
2789         * svg/SVGTitleElement.cpp:
2790         (WebCore::SVGTitleElement::insertedInto):
2791         * svg/SVGTitleElement.h:
2792         * svg/SVGUseElement.cpp:
2793         (WebCore::SVGUseElement::insertedInto):
2794         * svg/SVGUseElement.h:
2795         * svg/animation/SVGSMILElement.cpp:
2796         (WebCore::SVGSMILElement::insertedInto):
2797         (WebCore::SVGSMILElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
2798         * svg/animation/SVGSMILElement.h:
2799
2800 2017-10-18  Eric Carlson  <eric.carlson@apple.com>
2801
2802         Key events should not update Document.lastHandledUserGestureTimestamp unless key event is handled
2803         https://bugs.webkit.org/show_bug.cgi?id=178473
2804         <rdar://problem/34869935>
2805
2806         Reviewed by Brent Fulgham.
2807
2808         No new tests, updated media/restricted-audio-playback-with-document-gesture.html for this change.
2809
2810         * page/EventHandler.cpp:
2811         (WebCore::EventHandler::keyEvent): Restore the current Document's "lastHandledUserGestureTimestamp"
2812         if the key event was not handled.
2813
2814 2017-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2815
2816         Unreviewed, rolling out r223291.
2817
2818         After further investigation, this removed codepath is
2819         something Mail may want to re-adopt. Additionally, the
2820         original breaking change was rolled out in r223408, so
2821         this test once again passes on ToT.
2822
2823         Reverted changeset:
2824
2825         "Remove Editor::simplifyMarkup"
2826         https://bugs.webkit.org/show_bug.cgi?id=178271
2827         https://trac.webkit.org/changeset/223291
2828
2829 2017-10-18  Sam Weinig  <sam@webkit.org>
2830
2831         [Settings] Move remaining simple settings to Settings.in
2832         https://bugs.webkit.org/show_bug.cgi?id=177730
2833         <rdar://problem/34763346>
2834
2835         Reviewed by Daniel Bates.
2836
2837         * Scripts/GenerateSettings/Settings.py:
2838         (Setting.__init__):
2839         (Setting.__str__):
2840         (Setting.getterFunctionName):
2841         (parseInput):
2842
2843             Add support for parsing the 'getter' option.
2844
2845         * page/Settings.in:
2846         
2847             Migrate simple settings from SettingsBase to here.
2848         
2849         * page/SettingsBase.cpp:
2850         (WebCore::SettingsBase::SettingsBase):
2851         (WebCore::SettingsBase::setJavaEnabled): Deleted.
2852         (WebCore::SettingsBase::setJavaEnabledForLocalFiles): Deleted.
2853         (WebCore::SettingsBase::setPreferMIMETypeForImages): Deleted.
2854         (WebCore::SettingsBase::setForcePendingWebGLPolicy): Deleted.
2855         (WebCore::SettingsBase::setNeedsAdobeFrameReloadingQuirk): Deleted.
2856         (WebCore::SettingsBase::setFontRenderingMode): Deleted.
2857         (WebCore::SettingsBase::fontRenderingMode const): Deleted.
2858         (WebCore::SettingsBase::setShowTiledScrollingIndicator): Deleted.
2859         (WebCore::SettingsBase::setFontFallbackPrefersPictographs): Deleted.
2860         * page/SettingsBase.h:
2861         (WebCore::SettingsBase::isJavaEnabled const): Deleted.
2862         (WebCore::SettingsBase::isJavaEnabledForLocalFiles const): Deleted.
2863         (WebCore::SettingsBase::preferMIMETypeForImages const): Deleted.
2864         (WebCore::SettingsBase::needsAcrobatFrameReloadingQuirk const): Deleted.
2865         (WebCore::SettingsBase::showTiledScrollingIndicator const): Deleted.
2866         (WebCore::SettingsBase::setTouchEventEmulationEnabled): Deleted.
2867         (WebCore::SettingsBase::isTouchEventEmulationEnabled const): Deleted.
2868         (WebCore::SettingsBase::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
2869         (WebCore::SettingsBase::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
2870         (WebCore::SettingsBase::fontFallbackPrefersPictographs const): Deleted.
2871         (WebCore::SettingsBase::setMediaKeysStorageDirectory): Deleted.
2872         (WebCore::SettingsBase::mediaKeysStorageDirectory const): Deleted.
2873         (WebCore::SettingsBase::setMediaDeviceIdentifierStorageDirectory): Deleted.
2874         (WebCore::SettingsBase::mediaDeviceIdentifierStorageDirectory const): Deleted.
2875         (WebCore::SettingsBase::applePayEnabled const): Deleted.
2876         (WebCore::SettingsBase::setApplePayEnabled): Deleted.
2877         (WebCore::SettingsBase::applePayCapabilityDisclosureAllowed const): Deleted.
2878         (WebCore::SettingsBase::setApplePayCapabilityDisclosureAllowed): Deleted.
2879         (WebCore::SettingsBase::isForcePendingWebGLPolicy const): Deleted.
2880         
2881             Remove simple settings.
2882
2883 2017-10-18  Zalan Bujtas  <zalan@apple.com>
2884
2885         [FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
2886         https://bugs.webkit.org/show_bug.cgi?id=178477
2887         <rdar://problem/35056478>
2888
2889         Reviewed by Simon Fraser.
2890
2891         No change in functionality.
2892
2893         * page/FrameView.cpp:
2894         (WebCore::FrameView::markRootOrBodyRendererDirty const):
2895         (WebCore::FrameView::layout):
2896         * page/FrameView.h:
2897
2898 2017-10-18  Keith Miller  <keith_miller@apple.com>
2899
2900         Setup WebCore build to start using unified sources.
2901         https://bugs.webkit.org/show_bug.cgi?id=178362
2902
2903         Reviewed by Tim Horton.
2904
2905         This patch adds all the long tooling needed to start adding
2906         unified sources to WebCore. Most of the source list files
2907         are empty to start but will be filled over the next few days.
2908
2909         I started by moving all the non-derived bindings code to
2910         unified sources to make sure everything worked correctly.
2911
2912         * CMakeLists.txt:
2913         * Configurations/GenerateUnifiedSources.xcconfig: Added.
2914         * Configurations/WebCore.xcconfig:
2915         * PlatformMac.cmake:
2916         * Sources.txt: Added.
2917         * SourcesCocoa.txt: Added.
2918         * SourcesIOS.txt: Added.
2919         * SourcesMac.txt: Added.
2920         * WebCore.xcodeproj/project.pbxproj:
2921         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Removed. No one seems to use this...
2922
2923 2017-10-18  Commit Queue  <commit-queue@webkit.org>
2924
2925         Unreviewed, rolling out r223321.
2926         https://bugs.webkit.org/show_bug.cgi?id=178476
2927
2928         This protocol change broke some internal builds (Requested by
2929         brrian__ on #webkit).
2930
2931         Reverted changeset:
2932
2933         "Web Inspector: provide a way to enable/disable event
2934         listeners"
2935         https://bugs.webkit.org/show_bug.cgi?id=177451
2936         https://trac.webkit.org/changeset/223321
2937
2938 2017-10-18  Sam Weinig  <sam@webkit.org>
2939
2940         [Settings] Miscellaneous cleanup of the settings generation scripts
2941         https://bugs.webkit.org/show_bug.cgi?id=178462
2942
2943         Reviewed by Daniel Bates.
2944
2945         - Stop generating and remove now unused SettingsMacros.h
2946         - Make functions operating on the python Setting object member functions
2947         - Add predicate to determine if a Setting's type is a value type, allowing
2948           us to exclude those from using const references.
2949
2950         * CMakeLists.txt:
2951         * DerivedSources.make:
2952         * Scripts/GenerateSettings.py:
2953         * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py:
2954         * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py:
2955         * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
2956         * Scripts/GenerateSettings/GenerateSettings.py:
2957         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
2958         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
2959         * Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
2960         * Scripts/GenerateSettings/Settings.py:
2961         * WebCoreMacros.cmake:
2962         * WebCore.xcodeproj/project.pbxproj:
2963
2964 2017-10-18  Chris Dumez  <cdumez@apple.com>
2965
2966         Align ImageData constructor with the specification
2967         https://bugs.webkit.org/show_bug.cgi?id=178406
2968
2969         Reviewed by Youenn Fablet.
2970
2971         Align ImageData constructor with the specification:
2972         - https://html.spec.whatwg.org/multipage/canvas.html#dom-imagedata
2973
2974         It sometimes throws the wrong exception.
2975
2976         No new tests, rebaselined existing test.
2977
2978         * html/ImageData.cpp:
2979         (WebCore::ImageData::create):
2980         * html/ImageData.h:
2981         * html/ImageData.idl:
2982
2983 2017-10-18  Chris Dumez  <cdumez@apple.com>
2984
2985         Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
2986         https://bugs.webkit.org/show_bug.cgi?id=177876
2987         <rdar://problem/34813129>
2988
2989         Reviewed by Ryosuke Niwa.
2990
2991         No new tests, updatdd existing test.
2992
2993         * dom/Document.h:
2994         * testing/Internals.cpp:
2995         (WebCore::Internals::hasServiceWorkerRegisteredForOrigin):
2996         * testing/Internals.h:
2997         * testing/Internals.idl:
2998         * workers/service/ServiceWorkerProvider.h:
2999         * workers/service/context/SWContextManager.cpp:
3000         (WebCore::SWContextManager::startServiceWorkerContext):
3001         * workers/service/server/SWClientConnection.h:
3002         * workers/service/server/SWServer.cpp:
3003         (WebCore::SWServer::Connection::scriptContextStarted):
3004         (WebCore::SWServer::scriptContextStarted):
3005         * workers/service/server/SWServer.h:
3006         * workers/service/server/SWServerRegistration.cpp:
3007         (WebCore::SWServerRegistration::scriptContextFailedToStart):
3008         (WebCore::SWServerRegistration::scriptContextStarted):
3009         * workers/service/server/SWServerRegistration.h:
3010
3011 2017-10-18  Sam Weinig  <sam@webkit.org>
3012
3013         [Settings] Replace macros in Settings.h/cpp with generated code
3014         https://bugs.webkit.org/show_bug.cgi?id=178419
3015
3016         Reviewed by Antti Koivisto.
3017
3018         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
3019         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
3020
3021             Rather than use macros in the generated Settings class, generate the code the macros
3022             would expand to.
3023
3024 2017-10-18  Zalan Bujtas  <zalan@apple.com>
3025
3026         [FrameView::layout cleanup] Move frame flattening layout logic to a separate function
3027         https://bugs.webkit.org/show_bug.cgi?id=178425
3028         <rdar://problem/35045836>
3029
3030         Reviewed by Antti Koivisto.
3031
3032         No change in functionality.
3033
3034         * page/FrameView.cpp:
3035         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
3036         (WebCore::FrameView::layout):
3037         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
3038         * page/FrameView.h:
3039
3040 2017-10-18  Antti Koivisto  <antti@apple.com>
3041
3042         Resolve ::before and ::after pseudo elements during style resolution
3043         https://bugs.webkit.org/show_bug.cgi?id=178339
3044
3045         Reviewed by Ryosuke Niwa.
3046
3047         They are currently resolved during render tree building which creates problems with display:contents and animations.
3048
3049         * dom/PseudoElement.cpp:
3050         (WebCore::PseudoElement::PseudoElement):
3051
3052             Call InspectorInstrumentation from constructor.
3053
3054         * style/RenderTreeUpdater.cpp:
3055         (WebCore::RenderTreeUpdater::Parent::Parent):
3056         (WebCore::RenderTreeUpdater::updateRenderTree):
3057         (WebCore::RenderTreeUpdater::pushParent):
3058
3059             Push the full update to the parent stack.
3060
3061         (WebCore::RenderTreeUpdater::popParent):
3062         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
3063         (WebCore::RenderTreeUpdater::updateAfterDescendants):
3064         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
3065         * style/RenderTreeUpdater.h:
3066         * style/RenderTreeUpdaterGeneratedContent.cpp:
3067         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
3068
3069             No need to resolve pseudo style, we have it already.
3070
3071         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
3072         (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
3073         (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
3074         * style/RenderTreeUpdaterGeneratedContent.h:
3075         * style/StyleTreeResolver.cpp:
3076         (WebCore::Style::TreeResolver::resolveElement):
3077         (WebCore::Style::TreeResolver::resolvePseudoStyle):
3078
3079             Resolve pseudos.
3080
3081         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3082
3083             Make a private member function.
3084
3085         (WebCore::Style::TreeResolver::resolveComposedTree):
3086         * style/StyleTreeResolver.h:
3087         * style/StyleUpdate.cpp:
3088         (WebCore::Style::Update::elementUpdates const):
3089         (WebCore::Style::Update::elementUpdates):
3090
3091             Bundle the style update for an element and the associated before/after pseudos.
3092
3093         (WebCore::Style::Update::elementStyle const):
3094         (WebCore::Style::Update::elementStyle):
3095         (WebCore::Style::Update::addElement):
3096         (WebCore::Style::Update::elementUpdate const): Deleted.
3097         (WebCore::Style::Update::elementUpdate): Deleted.
3098         * style/StyleUpdate.h:
3099
3100 2017-10-18  Ms2ger  <Ms2ger@igalia.com>
3101
3102         Update the signatures of texSubImage3D.
3103         https://bugs.webkit.org/show_bug.cgi?id=178435
3104
3105         Reviewed by Sam Weinig.
3106
3107         Update the signatures of texSubImage3D.
3108
3109         No new tests: not much point in adding tests now; this method doesn't
3110         do anything anyway.
3111
3112         * html/canvas/WebGL2RenderingContext.cpp:
3113         (WebCore::WebGL2RenderingContext::texSubImage3D):
3114         * html/canvas/WebGL2RenderingContext.h:
3115         * html/canvas/WebGL2RenderingContext.idl:
3116
3117 2017-10-18  Fujii Hironori  <Hironori.Fujii@sony.com>
3118
3119         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
3120         https://bugs.webkit.org/show_bug.cgi?id=175106
3121
3122         Reviewed by Yusuke Suzuki.
3123
3124         No new tests because there is no behavior change.
3125
3126         * css/CSSFontFaceSet.cpp:
3127         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Call get() method of LazyNeverDestroyed.
3128         * dom/make_names.pl: Use LazyNeverDestroyed for font names.
3129
3130 2017-10-18  Zan Dobersek  <zdobersek@igalia.com>
3131
3132         [MSE] Move SourceBuffer's pending append data into the platform implementations
3133         https://bugs.webkit.org/show_bug.cgi?id=178003
3134
3135         Reviewed by Jer Noble.
3136
3137         In SourceBuffer::appendBufferTimerFired(), we can use move semantics to
3138         pass the pending append data into the platform layer, where it can then
3139         be used more efficiently.
3140
3141         Resources in the m_pendingAppendData member are moved into the append()
3142         call on the SourceBufferPrivate object. The m_pendingAppendData is still
3143         cleared out manually in case the underlying implementation doesn't clear
3144         it out through a move operation. The SourceBufferPrivate interface is
3145         updated to accept a Vector rvalue reference as the only parameter of the
3146         append() method.
3147
3148         For the GStreamer implementation, signature of the append() method in
3149         MediaSourceClientGStreamerMSE class is also updated. The implementation
3150         now moves the Vector resources over to a on-heap Vector object that is
3151         then wrapped into a GstBuffer object by using the
3152         gst_buffer_new_wrapped_full() API and specifying the custom deleter.
3153
3154         The AVFoundation implementation of SourceBufferPrivate is only updated
3155         to reflect the changes in the interface. The Vector data that is passed
3156         in is still copied into the NSData allocation.
3157
3158         MockSourceBufferPrivate is also updated, with the append data still
3159         being copied into the m_inputBuffer Vector.
3160
3161         No new tests -- no change in behavior.
3162
3163         * Modules/mediasource/SourceBuffer.cpp:
3164         (WebCore::SourceBuffer::appendBufferTimerFired):
3165         * platform/graphics/SourceBufferPrivate.h:
3166         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3167         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3168         (WebCore::SourceBufferPrivateAVFObjC::append):
3169         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3170         (WebCore::MediaSourceClientGStreamerMSE::append):
3171         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
3172         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
3173         (WebCore::SourceBufferPrivateGStreamer::append):
3174         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
3175         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3176         (WebCore::MockSourceBufferPrivate::append):
3177         * platform/mock/mediasource/MockSourceBufferPrivate.h:
3178
3179 2017-10-17  Zalan Bujtas  <zalan@apple.com>
3180
3181         [FrameView::layout cleanup] Remove redundant body->renderer()->setChildNeedsLayout() call
3182         https://bugs.webkit.org/show_bug.cgi?id=178414
3183         <rdar://problem/35040876>
3184
3185         Reviewed by Simon Fraser.
3186
3187         Since m_size always equals to layoutSize() at this point, we never call setChildNeedsLayout() on the body's renderer.
3188         However a few lines below, when we adjust the frame size and check if oldSize != m_size, we actually
3189         dirty the body's renderer.
3190
3191         Covered by existing tests.
3192
3193         * page/FrameView.cpp:
3194         (WebCore::FrameView::layout):
3195
3196 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
3197
3198         [Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
3199         https://bugs.webkit.org/show_bug.cgi?id=177345
3200         <rdar://problem/32975942>
3201
3202         Reviewed by Jon Lee.
3203
3204         This bug has a fairly insideous cause. In particular, the system font fallback path follows
3205         system conventions, which are not the same as the CSS fallback path. For example, the Chinese
3206         fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
3207         assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
3208         However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
3209         Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
3210         and expected, and we shouldn't synthesize bold in this situation.
3211
3212         Test: fast/text/system-ui-chinese-bold-fallback.html
3213
3214         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
3215         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
3216
3217 2017-10-17  Chelsea Pugh  <cpugh@apple.com>
3218
3219         [iOS] Don't turn fields yellow after filling credentials
3220         https://bugs.webkit.org/show_bug.cgi?id=178411
3221
3222         Reviewed by Wenson Hsieh.
3223
3224         * editing/ios/AutofillElements.cpp:
3225         (WebCore::AutofillElements::autofill): We don't want to turn fields yellow when filling the user name
3226         and password. Remove the code that was causing that to happen.
3227
3228 2017-10-16  Andy Estes  <aestes@apple.com>
3229
3230         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
3231         https://bugs.webkit.org/show_bug.cgi?id=178191
3232         <rdar://problem/34906367>
3233
3234         Reviewed by Tim Horton.
3235
3236         Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
3237
3238         * Modules/applepay/ApplePayError.idl:
3239         * Modules/applepay/ApplePayPaymentContact.h:
3240         * Modules/applepay/ApplePayPaymentContact.idl:
3241         * Modules/applepay/ApplePaySessionPaymentRequest.h:
3242         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3243         (WebCore::subLocality):
3244         (WebCore::setSubLocality):
3245         (WebCore::subAdministrativeArea):
3246         (WebCore::setSubAdministrativeArea):
3247         (WebCore::convert):
3248
3249 2017-10-17  Commit Queue  <commit-queue@webkit.org>
3250
3251         Unreviewed, rolling out r223500.
3252         https://bugs.webkit.org/show_bug.cgi?id=178408
3253
3254         Introduced a crash in CSSAnimationController::updateAnimations
3255         (Requested by rniwa on #webkit).
3256
3257         Reverted changeset:
3258
3259         "Resolve ::before and ::after pseudo elements during style
3260         resolution"
3261         https://bugs.webkit.org/show_bug.cgi?id=178339
3262         https://trac.webkit.org/changeset/223500
3263
3264 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
3265
3266         Delete button doesn't fully delete certain emoji
3267         https://bugs.webkit.org/show_bug.cgi?id=178096
3268         <rdar://problem/34785106>
3269
3270         Reviewed by Simon Fraser.
3271
3272         System infrastructure for handling emoji changes every year. Instead of having
3273         custom code to specifically walk over codepoints, we should delegate to the
3274         system handling.
3275
3276         Tests: editing/deleting/delete-emoji.html
3277                editing/deleting/delete-emoji-1.html
3278                editing/deleting/delete-emoji-2.html
3279                editing/deleting/delete-emoji-3.html
3280                editing/deleting/delete-emoji-4.html
3281                editing/deleting/delete-emoji-5.html
3282                editing/deleting/delete-emoji-6.html
3283                editing/deleting/delete-emoji-7.html
3284                editing/deleting/delete-emoji-8.html
3285                editing/deleting/delete-emoji-9.html
3286
3287         * rendering/RenderText.cpp:
3288         (WebCore::RenderText::previousOffset const):
3289         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
3290         (WebCore::RenderText::nextOffset const):
3291         (WebCore::isHangulLVT): Deleted.
3292         (WebCore::isMark): Deleted.
3293         (WebCore::isRegionalIndicator): Deleted.
3294         (WebCore::isInArmenianToLimbuRange): Deleted.
3295
3296 2017-10-17  Youenn Fablet  <youenn@apple.com>
3297
3298         Add preliminary support for fetch event
3299         https://bugs.webkit.org/show_bug.cgi?id=178171
3300
3301         Unreviewed.
3302
3303         * workers/service/FetchEvent.cpp:
3304         (WebCore::FetchEvent::promiseIsSettled): build fix by removing unnecessary captured this at the moment.
3305
3306 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
3307
3308         [CSS Font Loading] Fonts are erroneously invisible when the policy says they should be visible
3309         https://bugs.webkit.org/show_bug.cgi?id=178238
3310
3311         Reviewed by Simon Fraser.
3312
3313         When implementing font-display, I added testing infrastructure (so we don't have to wait for
3314         3 second timeouts to occur). This testing infrastructure covered up a real bug where the wrong
3315         font would be reported to CSSFontAccessor. This patch reverts the erroneous testing
3316         infrastructure and replaces it with a real fix to the problem. The replacement fix is covered
3317         by the same tests that I wrote when implementing the feature.
3318
3319         Covered by existing tests.
3320
3321         * css/CSSFontFace.cpp:
3322         (WebCore::CSSFontFace::pump):
3323         (WebCore::visibility):
3324         (WebCore::CSSFontFace::font):
3325
3326 2017-10-16  Sam Weinig  <sam@webkit.org>
3327
3328         [Settings] Generate Settings.h/cpp
3329         https://bugs.webkit.org/show_bug.cgi?id=178361
3330
3331         Reviewed by Dean Jackson.
3332
3333         This change generates Settings.h and Settings.cpp exactly as they are,
3334         using SettingsMacros.h and everything. In follow up changes, the use of
3335         SettingsMacros.h will be removed.
3336
3337         * CMakeLists.txt:
3338         * DerivedSources.make:
3339         * Scripts/GenerateSettings.py:
3340         * Scripts/GenerateSettings/GenerateSettings.py:
3341         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
3342         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
3343         * WebCore.xcodeproj/project.pbxproj:
3344         * WebCoreMacros.cmake:
3345         * page/Settings.cpp: Removed.
3346         * page/Settings.h: Removed.
3347
3348 2017-10-17  Ms2ger  <Ms2ger@igalia.com>
3349
3350         Create bindings for WebGL2's versions of texSubImage2D.
3351         https://bugs.webkit.org/show_bug.cgi?id=178382
3352
3353         Reviewed by Ryosuke Niwa.
3354
3355         Create bindings for WebGL2's versions of texSubImage2D.
3356
3357         No new tests: not much point in adding tests now; this method doesn't
3358         do anything anyway.
3359
3360         * html/canvas/WebGL2RenderingContext.cpp:
3361         (WebCore::WebGL2RenderingContext::texSubImage2D):
3362         * html/canvas/WebGL2RenderingContext.h:
3363         * html/canvas/WebGL2RenderingContext.idl:
3364         * html/canvas/WebGLRenderingContext.idl:
3365         * html/canvas/WebGLRenderingContextBase.idl:
3366
3367 2017-10-17  Zalan Bujtas  <zalan@apple.com>
3368
3369         [FrameView::layout cleanup] Subtree should read subtreeLayout.
3370         https://bugs.webkit.org/show_bug.cgi?id=178401
3371
3372         Reviewed by Simon Fraser.
3373
3374         Rename some variables to improve readability.
3375
3376         No change in functionality.
3377
3378         * page/FrameView.cpp:
3379         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
3380         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
3381         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
3382         (WebCore::FrameView::reset):
3383         (WebCore::FrameView::willDestroyRenderTree):
3384         (WebCore::FrameView::didDestroyRenderTree):
3385         (WebCore::FrameView::calculateScrollbarModesForLayout):
3386         (WebCore::FrameView::layout):
3387         (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
3388         (WebCore::FrameView::scheduleRelayout):
3389         (WebCore::FrameView::scheduleRelayoutOfSubtree):
3390         (WebCore::FrameView::needsLayout const):
3391         (WebCore::FrameView::autoSizeIfEnabled):
3392         * page/FrameView.h:
3393
3394 2017-10-16  Dean Jackson  <dino@apple.com>
3395
3396         WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
3397         https://bugs.webkit.org/show_bug.cgi?id=178223
3398         <rdar://problem/34597567>
3399
3400         Reviewed by Antoine Quint.
3401
3402         Remove the limit of 4k on the width/height of the renderbuffer.
3403
3404         Test: fast/canvas/webgl/large-drawing-buffer-resize.html
3405
3406         * html/canvas/WebGLRenderingContextBase.cpp:
3407         (WebCore::WebGLRenderingContextBase::reshape):
3408
3409 2017-10-17  John Wilander  <wilander@apple.com>
3410
3411         Add and remove cookie partition accordingly in intermediary redirect requests
3412         https://bugs.webkit.org/show_bug.cgi?id=178369
3413         <rdar://problem/34467603>
3414
3415         Reviewed by Brent Fulgham.
3416
3417         Tests: http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html
3418                http/tests/resour