[Payment Request] Only process shipping options if shipping is requested, and throw...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-19  Andy Estes  <aestes@apple.com>
2
3         [Payment Request] Only process shipping options if shipping is requested, and throw an exception on duplicate shipping option IDs
4         https://bugs.webkit.org/show_bug.cgi?id=178535
5
6         Reviewed by Alex Christensen.
7
8         Progresses four tests in web-platform-tests/payment-request/payment-request-constructor.https.html.
9
10         * Modules/paymentrequest/PaymentRequest.cpp:
11         (WebCore::PaymentRequest::create):
12
13 2017-10-19  Daniel Bates  <dabates@apple.com>
14
15         Share logic in InlineTextBox to compute selection rect
16         https://bugs.webkit.org/show_bug.cgi?id=178232
17         <rdar://problem/34963452>
18
19         Reviewed by Zalan Bujtas.
20
21         Currently each paint routine in InlineTextBox duplicates similar code to compute the selection
22         rect it will paint. This change consolidates all the duplication into localSelectionRectWithClampedPositions()
23         and writes all of the paint operations, except for paintCompositionUnderline(), in terms of it.
24         We will write paintCompositionUnderline() in terms of localSelectionRectWithClampedPositions()
25         in a subsequent patch.
26
27         We also write localSelectionRect() in terms of localSelectionRectWithClampedPositions(). Ideally
28         we would have one way to compute the selection rect. However, localSelectionRect() and paintDocumentMarker()
29         currently expect the enclosing integral rectangle of the selection rectangle. The function
30         paintDocumentMarker() needs the enclosing integral rectangle to avoid truncating the dot pattern
31         drawn under marked words (e.g. a spelling error) on Cocoa platforms. With regards to localSelectionRect()
32         we should look to have it return the actual selection rectangle. See <https://bugs.webkit.org/show_bug.cgi?id=138913>
33         for more details.
34
35         * rendering/InlineTextBox.cpp:
36         (WebCore::InlineTextBox::localSelectionRect const): Move logic in common with paintSelection() into
37         localSelectionRectWithClampedPositions() and modified code to use it.
38         (WebCore::InlineTextBox::localSelectionRectWithClampedPositions const): Added.
39         (WebCore::InlineTextBox::paint): Store the local paint offset as a LayoutPoint as it is the canonical
40         data type for representing an offset when painting. Pass the local paint offset instead of the analagous boxOrigin value.
41         (WebCore::InlineTextBox::paintSelection): Write in terms of localSelectionRectWithClampedPositions().
42         (WebCore::InlineTextBox::paintTextSubrangeBackground): Ditto.
43         (WebCore::InlineTextBox::paintCompositionBackground): Ditto.
44         (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
45         (WebCore::InlineTextBox::paintDocumentMarker): Ditto.
46         (WebCore::InlineTextBox::paintDocumentMarkers): Pass paint offset instead of the analogous boxOrigin value.
47         * rendering/InlineTextBox.h:
48
49 2017-10-19  Daniel Bates  <dabates@apple.com>
50
51         Referrer policy should be inherited from creator
52         https://bugs.webkit.org/show_bug.cgi?id=178403
53         <rdar://problem/31546136>
54
55         Reviewed by Andy Estes.
56
57         As per section Browsing contexts of the the HTML standard, <https://html.spec.whatwg.org/multipage/browsers.html>
58         (17 October 2017), the referrer policy of a document should initially be inherited from its
59         creator.
60
61         Tests: http/tests/security/referrer-policy-nested-subframe.html
62                http/tests/security/referrer-policy-nested-window-open.html
63                http/tests/security/referrer-policy-subframe-window-open.html
64                http/tests/security/referrer-policy-window-open-subframe.html
65
66         * dom/Document.cpp:
67         (WebCore::Document::initSecurityContext): Ask the loader for the effective referrer policy.
68         * loader/FrameLoader.cpp:
69         (WebCore::FrameLoader::effectiveReferrerPolicy const): Added. Returns the referrer policy
70         of the creator document. The creator document is document of the parent frame or the document
71         of the opener for a subframe or child window, respectively. If we do not have a creator frame
72         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>.
73         * loader/FrameLoader.h:
74
75 2017-10-19  Zalan Bujtas  <zalan@apple.com>
76
77         [FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
78         https://bugs.webkit.org/show_bug.cgi?id=178518
79         <rdar://problem/35075409>
80
81         Reviewed by Antti Koivisto.
82
83         This patch tightens existing reentrancy policy on performPostLayoutTasks.
84
85         Covered by existing test cases.
86
87         * page/FrameView.cpp:
88         (WebCore::FrameView::FrameView):
89         (WebCore::FrameView::reset):
90         (WebCore::FrameView::layout):
91         (WebCore::FrameView::performPostLayoutTasks):
92         * page/FrameView.h:
93
94 2017-10-19  Chris Dumez  <cdumez@apple.com>
95
96         Unreviewed, revert r223650 as it caused crashes on the bots.
97
98         * WebCore.xcodeproj/project.pbxproj:
99         * dom/ScriptExecutionContext.h:
100         * loader/DocumentThreadableLoader.cpp:
101         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
102         * loader/FetchOptions.h:
103         * loader/ResourceLoaderOptions.h:
104         * loader/WorkerThreadableLoader.cpp:
105         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
106         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
107         * loader/WorkerThreadableLoader.h:
108         * platform/network/ResourceRequestBase.h:
109         * platform/network/ResourceResponseBase.h:
110         * workers/WorkerThread.h:
111         * workers/service/ServiceWorkerContainer.cpp:
112         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
113         * workers/service/context/SWContextManager.cpp: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
114         (WebCore::SWContextManager::singleton):
115         (WebCore::SWContextManager::SWContextManager):
116         (WebCore::SWContextManager::startServiceWorkerContext):
117         * workers/service/context/SWContextManager.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
118         * workers/service/context/ServiceWorkerThread.h:
119
120 2017-10-19  Zalan Bujtas  <zalan@apple.com>
121
122         [FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
123         https://bugs.webkit.org/show_bug.cgi?id=178503
124         <rdar://problem/35066561>
125
126         Reviewed by Antti Koivisto.
127
128         Covered by existing tests.
129
130         * page/FrameView.cpp:
131         (WebCore::FrameView::reset):
132         (WebCore::FrameView::layout):
133         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
134         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
135         (WebCore::FrameView::updateEmbeddedObjects):
136         (WebCore::FrameView::flushPostLayoutTasksQueue):
137         (WebCore::FrameView::performPostLayoutTasks):
138         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
139         * page/FrameView.h:
140
141 2017-10-19  Antti Koivisto  <antti@apple.com>
142
143         Overlapping text on all CSS fonts specs
144         https://bugs.webkit.org/show_bug.cgi?id=177585
145         <rdar://problem/34704078>
146
147         Reviewed by Daniel Bates.
148
149         We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements.
150         This resulted in 'rem' units being miscomputed.
151
152         Reduction by Zalan.
153
154         Test: fast/html/details-line-height-overlap.html
155
156         * style/StyleTreeResolver.cpp:
157         (WebCore::Style::TreeResolver::Scope::Scope):
158         (WebCore::Style::TreeResolver::Scope::~Scope):
159
160             Only reset overrideDocumentElementStyle when destroying the scope.
161
162         (WebCore::Style::TreeResolver::pushScope):
163         (WebCore::Style::TreeResolver::pushEnclosingScope):
164         (WebCore::Style::TreeResolver::popScope):
165
166             A scope can show up multiple times in scope stack.
167
168         * style/StyleTreeResolver.h:
169
170 2017-10-19  Ryosuke Niwa  <rniwa@webkit.org>
171
172         Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
173         https://bugs.webkit.org/show_bug.cgi?id=178504
174
175         Reviewed by Antti Koivisto.
176
177         Consolidated calls to notifyChildNodeInserted, childrenChanged, didFinishInsertingNode, and
178         dispatchChildInsertionEvents for inserting a node by executeNodeInsertionWithScriptAssertion,
179         a new templatefunction which takes a closure to do the node insertion to make exactly when
180         the script becomes runnable clear.
181
182         Added an exception to SVGTRefElement::updateReferencedText since this code mutates user agent
183         shadow root during insertedInto, and turned ChildChangeSource into an enum class.
184
185         * dom/CharacterData.cpp:
186         (WebCore::CharacterData::parserAppendData):
187         (WebCore::CharacterData::setDataAndUpdate):
188         * dom/ContainerNode.cpp:
189         (WebCore::executeNodeInsertionWithScriptAssertion): Extracted.
190         (WebCore::ContainerNode::takeAllChildrenFrom): Deployed executeNodeInsertionWithScriptAssertion.
191         (WebCore::ContainerNode::insertBefore): Ditto.
192         (WebCore::ContainerNode::changeForChildInsertion): Deleted.
193         (WebCore::ContainerNode::notifyChildInserted): Deleted.
194         (WebCore::ContainerNode::parserInsertBefore): Deployed executeNodeInsertionWithScriptAssertion. 
195         (WebCore::ContainerNode::replaceChild): Ditto.
196         (WebCore::ContainerNode::removeChild):
197         (WebCore::ContainerNode::parserRemoveChild):
198         (WebCore::ContainerNode::replaceAllChildren): Ditto.
199         (WebCore::ContainerNode::removeChildren):
200         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
201         (WebCore::ContainerNode::parserAppendChild): Ditto.
202         (WebCore::ContainerNode::childrenChanged):
203         (WebCore::ContainerNode::updateTreeAfterInsertion): Deleted.
204         * dom/ContainerNode.h:
205         * dom/Element.cpp:
206         (WebCore::Element::childrenChanged):
207         * html/HTMLOutputElement.cpp:
208         (WebCore::HTMLOutputElement::childrenChanged):
209         * svg/SVGClipPathElement.cpp:
210         (WebCore::SVGClipPathElement::childrenChanged):
211         * svg/SVGElement.cpp:
212         (WebCore::SVGElement::childrenChanged):
213         * svg/SVGFELightElement.cpp:
214         (WebCore::SVGFELightElement::childrenChanged):
215         * svg/SVGFilterElement.cpp:
216         (WebCore::SVGFilterElement::childrenChanged):
217         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
218         (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
219         * svg/SVGGradientElement.cpp:
220         (WebCore::SVGGradientElement::childrenChanged):
221         * svg/SVGMarkerElement.cpp:
222         (WebCore::SVGMarkerElement::childrenChanged):
223         * svg/SVGMaskElement.cpp:
224         (WebCore::SVGMaskElement::childrenChanged):
225         * svg/SVGPatternElement.cpp:
226         (WebCore::SVGPatternElement::childrenChanged):
227         * svg/SVGTRefElement.cpp:
228         (WebCore::SVGTRefElement::updateReferencedText): Allow DOM mutations inside the user agent shadow tree here.
229
230 2017-10-19  Ryosuke Niwa  <rniwa@webkit.org>
231
232         Add an argument indicating the type of removal to Node::removedFrom
233         https://bugs.webkit.org/show_bug.cgi?id=178505
234
235         Reviewed by Antti Koivisto.
236
237         Like r223628, added RemovalType as the first argument to Node::removedFrom, which contains two booleans indicating
238         whether the node just become disconnected from a document, and whether node's tree scope had changed or not.
239
240         These boolean flags simplifies the logic in removedFrom implementations, and are required to have a better
241         guarantee about the correctness of node flags during calls to removedFrom. Right now, Node::isConnected() and
242         Node::isInShadowTree() are both outdated until Node::removedFrom is called.
243
244         Also renamed the second argument of removedFrom to parentOfRemovedTree to make the semantics clear.
245
246         Note that in some implementations of removedFrom, we check whether isConnected() was true to decide whether
247         the node had already been disconnected from a document prior to calls to this particular call of removedFrom.
248         This extra check is no longer necessary since no node will be removed from a document without first being inserted
249         completely somewhere after r223458.
250
251         No new tests since there should be no behavioral changes.
252
253         * dom/ContainerNodeAlgorithms.cpp:
254         (WebCore::notifyNodeInsertedIntoDocument): Replaced RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
255         (WebCore::notifyNodeRemovedFromDocument): Replaced the check that the node had not been re-connected by scripts
256         by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
257         Also moved the code to call setCSSTarget to Element::removedFrom. This random call to setCSSTarget predates r114351,
258         as well as r40475. It was originally introduced by r29311 into Node::removedFromDocument() ten years ago.
259         (WebCore::notifyNodeRemovedFromTree): Moved NoEventDispatchAssertion to notifyChildNodeRemoved.
260         (WebCore::notifyChildNodeRemoved): Added NoEventDispatchAssertion.
261         * dom/ContainerNodeAlgorithms.h:
262         * dom/Element.cpp:
263         (WebCore::Element::removedFrom): Replaced the complicated code to detect when this element is removed from a document
264         and its tree scope had changed by removalType.disconnectedFromDocument and removalType.treeScopeChanged.
265         * dom/Element.h:
266         * dom/Node.cpp:
267         (WebCore::Node::removedFrom):
268         * dom/Node.h: Replaced a long block of comments above insertedInto by two lines of concise comments now that
269         the semantics of insertedInto and didFinishInsertingNode are more clear, and enforced by assertions.
270         (WebCore::Node::RemovalType::RemovalType): Addedl
271         * dom/ProcessingInstruction.cpp:
272         (WebCore::ProcessingInstruction::removedFrom):
273         * dom/ProcessingInstruction.h:
274         * dom/ShadowRoot.cpp:
275         (WebCore::ShadowRoot::removedFrom): The extra !isConnected() check is no longer needed. See the description above.
276         * dom/ShadowRoot.h:
277         * html/FormAssociatedElement.cpp:
278         (WebCore::FormAssociatedElement::removedFrom):
279         * html/FormAssociatedElement.h:
280         * html/HTMLBaseElement.cpp:
281         (WebCore::HTMLBaseElement::removedFrom):
282         * html/HTMLBaseElement.h:
283         * html/HTMLFormControlElement.cpp:
284         (WebCore::HTMLFormControlElement::removedFrom):
285         * html/HTMLFormControlElement.h:
286         * html/HTMLFormControlElementWithState.cpp:
287         (WebCore::HTMLFormControlElementWithState::removedFrom):
288         * html/HTMLFormControlElementWithState.h:
289         * html/HTMLFormElement.cpp:
290         (WebCore::HTMLFormElement::removedFrom):
291         * html/HTMLFormElement.h:
292         * html/HTMLFrameSetElement.cpp:
293         (WebCore::HTMLFrameSetElement::removedFrom):
294         * html/HTMLFrameSetElement.h:
295         * html/HTMLImageElement.cpp:
296         (WebCore::HTMLImageElement::removedFrom):
297         * html/HTMLImageElement.h:
298         * html/HTMLInputElement.cpp:
299         (WebCore::HTMLInputElement::removedFrom):
300         * html/HTMLInputElement.h:
301         * html/HTMLLinkElement.cpp:
302         (WebCore::HTMLLinkElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
303         * html/HTMLLinkElement.h:
304         * html/HTMLMapElement.cpp:
305         (WebCore::HTMLMapElement::removedFrom):
306         * html/HTMLMapElement.h:
307         * html/HTMLMediaElement.cpp:
308         (WebCore::HTMLMediaElement::removedFrom):
309         * html/HTMLMediaElement.h:
310         * html/HTMLObjectElement.cpp:
311         (WebCore::HTMLObjectElement::removedFrom):
312         * html/HTMLObjectElement.h:
313         * html/HTMLSlotElement.cpp:
314         (WebCore::HTMLSlotElement::removedFrom): Simplifies the logic to detect when this slot element is being
315         removed from a shadow tree using removalType.treeScopeChanged.
316         * html/HTMLSlotElement.h:
317         * html/HTMLSourceElement.cpp:
318         (WebCore::HTMLSourceElement::insertedInto): Added a FIXME for an obvious bug.
319         (WebCore::HTMLSourceElement::removedFrom): Ditto.
320         * html/HTMLSourceElement.h:
321         * html/HTMLStyleElement.cpp:
322         (WebCore::HTMLStyleElement::removedFrom):
323         * html/HTMLStyleElement.h:
324         * html/HTMLTitleElement.cpp:
325         (WebCore::HTMLTitleElement::removedFrom):
326         * html/HTMLTitleElement.h:
327         * html/HTMLTrackElement.cpp:
328         (WebCore::HTMLTrackElement::removedFrom): Ditto.
329         * html/HTMLTrackElement.h:
330         * svg/SVGElement.cpp:
331         (WebCore::SVGElement::removedFrom): Replaced isConnected() check before calling Node::removedFrom by the check of
332         removalType.disconnectedFromDocument.
333         * svg/SVGElement.h:
334         * svg/SVGFEImageElement.cpp:
335         (WebCore::SVGFEImageElement::removedFrom):
336         * svg/SVGFEImageElement.h:
337         * svg/SVGFontFaceElement.cpp:
338         (WebCore::SVGFontFaceElement::removedFrom):
339         * svg/SVGFontFaceElement.h:
340         * svg/SVGMPathElement.cpp:
341         (WebCore::SVGMPathElement::removedFrom):
342         * svg/SVGMPathElement.h:
343         * svg/SVGPathElement.cpp:
344         (WebCore::SVGPathElement::removedFrom):
345         * svg/SVGPathElement.h:
346         * svg/SVGSVGElement.cpp:
347         (WebCore::SVGSVGElement::removedFrom):
348         * svg/SVGSVGElement.h:
349         * svg/SVGStyleElement.cpp:
350         (WebCore::SVGStyleElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
351         * svg/SVGStyleElement.h:
352         * svg/SVGTRefElement.cpp:
353         (WebCore::SVGTRefElement::removedFrom):
354         * svg/SVGTRefElement.h:
355         * svg/SVGTextPathElement.cpp:
356         (WebCore::SVGTextPathElement::removedFrom):
357         * svg/SVGTextPathElement.h:
358         * svg/SVGTitleElement.cpp:
359         (WebCore::SVGTitleElement::removedFrom):
360         * svg/SVGTitleElement.h:
361         * svg/SVGUseElement.cpp:
362         (WebCore::SVGUseElement::removedFrom):
363         * svg/SVGUseElement.h:
364         * svg/animation/SVGSMILElement.cpp:
365         (WebCore::SVGSMILElement::removedFrom):
366         * svg/animation/SVGSMILElement.h:
367
368 2017-10-19  Ms2ger  <Ms2ger@igalia.com>
369
370         Update the signatures of compressedTexSubImage3D.
371         https://bugs.webkit.org/show_bug.cgi?id=178507
372
373         Reviewed by Ryosuke Niwa.
374
375         No new tests: not much point in adding tests now; this method doesn't
376         do anything anyway.
377
378         * html/canvas/WebGL2RenderingContext.cpp:
379         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
380         * html/canvas/WebGL2RenderingContext.h:
381         * html/canvas/WebGL2RenderingContext.idl:
382
383 2017-10-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>
384
385         [curl] Segfault in WebCore::CurlRequest::setupPOST
386         https://bugs.webkit.org/show_bug.cgi?id=178434
387
388         Reviewed by Ryosuke Niwa.
389
390         * platform/network/curl/CurlRequest.cpp:
391         (WebCore::CurlRequest::resolveBlobReferences):
392         (WebCore::CurlRequest::setupPOST):
393
394 2017-10-18  Ryosuke Niwa  <rniwa@webkit.org>
395
396         Don't expose raw HTML in pasteboard to the web content
397         https://bugs.webkit.org/show_bug.cgi?id=178422
398         <rdar://problem/34567052>
399
400         Reviewed by Wenson Hsieh.
401
402         This patch enables HTML sanitization added in r223440 when WebKit pastes & concludes edit drag as opposed to
403         just when dataTransfer.get is used. This is important to avoid leaking privacy sensitive information such as
404         local file paths and pasting potentially harmful content such as scripts in event handler serialized by
405         WebKit prior to r223462. In addition, we start using blob URLs in the pasted content instead of retaining
406         the original URL and overriding the document loader like r222839 for RTFD and r222119 for image files.
407
408         To do this, a new superclass FrameWebContentReader of PasteboardWebContentReader and WebContentMarkupReader
409         is introduced, and helper functions are extracted out of WebContentMarkupReader in WebContentReaderCocoa.mm
410         to be also used in WebContentReader.
411
412         Tests: http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html
413                http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html
414                http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html
415                PasteWebArchive.SanitizesHTML
416
417         * editing/WebContentReader.cpp:
418         (WebCore::FrameWebContentReader::shouldSanitize const): Moved from WebContentMarkupReader.
419         * editing/WebContentReader.h:
420         (WebCore::FrameWebContentReader): Added to share code between WebContentReader and WebContentMarkupReader.
421         (WebCore::FrameWebContentReader::FrameWebContentReader): Added.
422         * editing/cocoa/EditorCocoa.mm:
423         (WebCore::Editor::writeSelectionToPasteboard): Store the content's origin in the pasteboard so that we can
424         avoid sanitizing the content when pasting into the same document. This is important since converting all URLs
425         into blob URLs would break editors on the Web which tracks images, etc... in the content using URLs.
426         (WebCore::Editor::writeSelection): Ditto.
427         * editing/cocoa/WebContentReaderCocoa.mm:
428         (WebCore::MarkupAndArchive): Replaced FragmentAndArchive. Now returns the markup string in the archive
429         instead of the parsed fragment.
430         (WebCore::extractMarkupAndArchive): Renamed from createFragmentFromWebArchive. Now returns the markup string.
431         (WebCore::sanitizeMarkupWithArchive): Extracted out of WebContentMarkupReader::readWebArchive to share code
432         between WebContentReader and WebContentMarkupReader, and added the code to handle subframes recursively.
433         As inefficient as this code is, we can't delay the conversion of subframes' marksup until later time since
434         the main frame's markup would contain blob URLs to refer to those subframes. 
435         (WebCore::WebContentReader::readWebArchive): Use sanitizeMarkupWithArchive when shouldSanitize() is true.
436         Don't add the subresources to the document loader when the content will be loaded into the same origin since
437         subresouces are mostly likely available in the document anyway.
438         (WebCore::WebContentMarkupReader::readWebArchive):
439         * platform/Pasteboard.h:
440         (WebCore::PasteboardWebContent): Added contentOrigin.
441         * platform/PasteboardWriterData.h:
442         (WebCore::PasteboardWriterData): Ditto.
443         * platform/ios/PasteboardIOS.mm:
444         (WebCore::Pasteboard::read): Read the origin before branching out to readRespectingUTIFidelities.
445         * platform/ios/PlatformPasteboardIOS.mm:
446         (WebCore::PlatformPasteboard::write): Record the content origin into the pasteboard.
447         * platform/mac/PasteboardMac.mm:
448         (WebCore::Pasteboard::write): Ditto.
449         * platform/mac/PasteboardWriter.mm:
450         (WebCore::createPasteboardWriter): Ditto.
451
452 2017-10-18  Sam Weinig  <sam@webkit.org>
453
454         Another attempt to fix the windows build.
455
456         * page/SettingsBase.cpp:
457         (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
458         * page/SettingsBase.h:
459
460 2017-10-18  Sam Weinig  <sam@webkit.org>
461
462         Attempt to fix the windows build.
463
464         * page/SettingsBase.cpp:
465         (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
466         * page/SettingsBase.h:
467
468 2017-10-18  Sam Weinig  <sam@webkit.org>
469
470         [Settings] Convert more settings to be generated
471         https://bugs.webkit.org/show_bug.cgi?id=177766
472
473         Reviewed by Dean Jackson.
474
475         - Replaces setNeedsStyleRecalcInAllFrames option in Settings.in
476           with a more generic, onChange, which allows you to specify a function
477           in SettingsBase that will be called when the setting changes. 
478           setNeedsStyleRecalcInAllFrames is then reimplemented in terms of
479           onChange.
480         - Moves most (all but two) of the remaining non-static settings from
481           SettingsBase to Settings.in
482
483         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
484         (printSetterBody):
485         * Scripts/GenerateSettings/Settings.py:
486         (Setting.__init__):
487         (Setting.__str__):
488         (Setting.typeIsValueType):
489         (Setting.setterFunctionName):
490         (Setting.setterChangeFunctionName):
491         (Setting.hasComplexSetter):
492         (parseInput):
493         
494             Add support for the onChange option.
495         
496         * page/Settings.in:
497
498             Migrate most of the remaining non-static settings to Settings.in.
499             Adopt onChange option.
500
501         * page/SettingsBase.cpp:
502         * page/SettingsBase.h:
503
504             Add helper functions for use by the onChange option.
505
506 2017-10-18  Chris Dumez  <cdumez@apple.com>
507
508         Implement ServiceWorkerRegistration.scope / updateViaCache
509         https://bugs.webkit.org/show_bug.cgi?id=178497
510
511         Reviewed by Youenn Fablet.
512
513         Implement ServiceWorkerRegistration.scope / updateViaCache.
514
515         No new tests, updated existing test.
516
517         * WebCore.xcodeproj/project.pbxproj:
518         * workers/service/ServiceWorkerContainer.cpp:
519         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
520         * workers/service/ServiceWorkerContainer.h:
521         * workers/service/ServiceWorkerJob.cpp:
522         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
523         * workers/service/ServiceWorkerJob.h:
524         * workers/service/ServiceWorkerJobClient.h:
525         * workers/service/ServiceWorkerRegistration.cpp:
526         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
527         (WebCore::ServiceWorkerRegistration::scope const):
528         (WebCore::ServiceWorkerRegistration::updateViaCache const):
529         (WebCore::ServiceWorkerRegistration::update):
530         (WebCore::ServiceWorkerRegistration::unregister):
531         (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
532         (WebCore::ServiceWorkerRegistration::activeDOMObjectName const):
533         (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
534         * workers/service/ServiceWorkerRegistration.h:
535         * workers/service/ServiceWorkerRegistration.idl:
536         * workers/service/ServiceWorkerRegistrationData.cpp:
537         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
538         * workers/service/ServiceWorkerRegistrationData.h:
539         (WebCore::ServiceWorkerRegistrationData::encode const):
540         (WebCore::ServiceWorkerRegistrationData::decode):
541         * workers/service/server/SWClientConnection.cpp:
542         (WebCore::SWClientConnection::jobResolvedInServer):
543         * workers/service/server/SWClientConnection.h:
544         * workers/service/server/SWServerRegistration.cpp:
545         (WebCore::SWServerRegistration::scriptContextStarted):
546         (WebCore::SWServerRegistration::data const):
547
548 2017-10-18  Youenn Fablet  <youenn@apple.com>
549
550         Add preliminary support for ServiceWorker Handle Fetch
551         https://bugs.webkit.org/show_bug.cgi?id=178475
552
553         Reviewed by Chris Dumez.
554
555         Test: http/tests/workers/service/basic-fetch.https.html
556
557         Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
558         A script context is now storing its selected service worker identifier. This should be fully implemented later on.
559         This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
560         Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.
561
562         * WebCore.xcodeproj/project.pbxproj:
563         * dom/ScriptExecutionContext.h:
564         (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
565         (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
566         * loader/DocumentThreadableLoader.cpp:
567         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
568         * loader/FetchOptions.h:
569         (WebCore::isPotentialNavigationOrSubresourceRequest):
570         (WebCore::isNonSubresourceRequest):
571         * loader/ResourceLoaderOptions.h:
572         * loader/WorkerThreadableLoader.cpp:
573         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
574         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
575         * loader/WorkerThreadableLoader.h:
576         * platform/network/ResourceRequestBase.h:
577         * platform/network/ResourceResponseBase.h:
578         * workers/WorkerThread.h:
579         * workers/service/ServiceWorkerContainer.cpp:
580         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
581         * workers/service/ServiceWorkerProvider.h:
582         * workers/service/context/SWContextManager.cpp: Removed.
583         * workers/service/context/ServiceWorkerThread.h:
584         * workers/service/server/SWServer.h:
585
586 2017-10-18  Zalan Bujtas  <zalan@apple.com>
587
588         [FrameView::layout cleanup] Group related pre-layout code to improve readability
589         https://bugs.webkit.org/show_bug.cgi?id=178496
590         <rdar://problem/35065718>
591
592         Reviewed by Simon Fraser.
593
594         Early returns/asserts/member variable resets etc.
595
596         Covered by existing tests.
597
598         * page/FrameView.cpp:
599         (WebCore::FrameView::layout):
600
601 2017-10-17  Jiewen Tan  <jiewen_tan@apple.com>
602
603         Replace some stack raw pointers with RefPtrs within WebCore/html
604         https://bugs.webkit.org/show_bug.cgi?id=178201
605         <rdar://problem/34841692>
606
607         Reviewed by Ryosuke Niwa.
608
609         This is an effort to reduce raw pointer usage in DOM code. In this patch, raw pointers
610         that are ref countable are blindly selected to be replaced with RefPtrs with one exception
611         which is auto*.
612
613         Also, this patch occasionally modifies the return type of some methods, and therefore callers
614         of those methods are modified accordingly.
615
616         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
617         (WebCore::LegacyCDM::mediaPlayer const):
618         * Modules/encryptedmedia/legacy/LegacyCDM.h:
619         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
620         (WebCore::CDMPrivateMediaPlayer::createSession):
621         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
622         (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
623         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
624         * Modules/mediacontrols/MediaControlsHost.cpp:
625         (WebCore::MediaControlsHost::externalDeviceDisplayName const):
626         (WebCore::MediaControlsHost::externalDeviceType const):
627         * dom/Element.cpp:
628         (WebCore::Element::focusDelegate):
629         (WebCore::Element::userAgentShadowRoot const):
630         (WebCore::Element::ensureUserAgentShadowRoot):
631         * dom/Element.h:
632         * dom/EventContext.cpp:
633         (WebCore::TouchEventContext::checkReachability const):
634         * dom/EventPath.cpp:
635         (WebCore::shouldEventCrossShadowBoundary):
636         (WebCore::EventPath::setRelatedTarget):
637         (WebCore::EventPath::retargetTouch):
638         (WebCore:: const):
639         * dom/EventTarget.cpp:
640         (WebCore::EventTarget::toNode):
641         (WebCore::EventTarget::addEventListener):
642         * dom/EventTarget.h:
643         * dom/MouseEvent.cpp:
644         (WebCore::MouseEvent::toElement const):
645         (WebCore::MouseEvent::fromElement const):
646         * dom/MouseEvent.h:
647         * dom/MouseRelatedEvent.cpp:
648         (WebCore::MouseRelatedEvent::computeRelativePosition):
649         * dom/Node.cpp:
650         (WebCore::Node::toNode):
651         * dom/Node.h:
652         * dom/ScopedEventQueue.cpp:
653         * editing/Editor.cpp:
654         (WebCore::Editor::selectionForCommand):
655         * editing/EditorCommand.cpp:
656         (WebCore::targetFrame):
657         * editing/TextIterator.cpp:
658         (WebCore::TextIterator::handleReplacedElement):
659         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
660         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
661         * html/ColorInputType.cpp:
662         (WebCore::ColorInputType::updateColorSwatch):
663         (WebCore::ColorInputType::shadowColorSwatch const):
664         * html/FileInputType.cpp:
665         (WebCore::FileInputType::disabledAttributeChanged):
666         (WebCore::FileInputType::multipleAttributeChanged):
667         * html/FormAssociatedElement.cpp:
668         (WebCore::FormAssociatedElement::findAssociatedForm):
669         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
670         (WebCore::FormAssociatedElement::resetFormOwner):
671         (WebCore::FormAssociatedElement::formAttributeChanged):
672         * html/FormController.cpp:
673         (WebCore::recordFormStructure):
674         (WebCore::FormKeyGenerator::formKey):
675         (WebCore::FormController::restoreControlStateIn):
676         * html/HTMLAnchorElement.cpp:
677         (WebCore::appendServerMapMousePosition):
678         (WebCore::HTMLAnchorElement::handleClick):
679         * html/HTMLAppletElement.cpp:
680         (WebCore::HTMLAppletElement::updateWidget):
681         * html/HTMLAreaElement.cpp:
682         (WebCore::HTMLAreaElement::imageElement const):
683         (WebCore::HTMLAreaElement::isFocusable const):
684         (WebCore::HTMLAreaElement::setFocus):
685         (WebCore::HTMLAreaElement::updateFocusAppearance):
686         * html/HTMLBodyElement.cpp:
687         (WebCore::HTMLBodyElement::scrollLeft):
688         (WebCore::HTMLBodyElement::setScrollLeft):
689         (WebCore::HTMLBodyElement::scrollTop):
690         (WebCore::HTMLBodyElement::setScrollTop):
691         (WebCore::HTMLBodyElement::scrollHeight):
692         (WebCore::HTMLBodyElement::scrollWidth):
693         * html/HTMLCanvasElement.cpp:
694         (WebCore::HTMLCanvasElement::createElementRenderer):
695         (WebCore:: const):
696         * html/HTMLDocument.cpp:
697         (WebCore::HTMLDocument::width):
698         (WebCore::HTMLDocument::height):
699         * html/HTMLElement.cpp:
700         (WebCore::HTMLElement::rendererIsNeeded):
701         (WebCore::setHasDirAutoFlagRecursively):
702         (WebCore::HTMLElement::directionality const):
703         (WebCore::HTMLElement::dirAttributeChanged):
704         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
705         * html/HTMLEmbedElement.cpp:
706         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
707         (WebCore::HTMLEmbedElement::rendererIsNeeded):
708         * html/HTMLFieldSetElement.cpp:
709         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
710         (WebCore::HTMLFieldSetElement::disabledStateChanged):
711         (WebCore::HTMLFieldSetElement::childrenChanged):
712         * html/HTMLFormControlElement.cpp:
713         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
714         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
715         (WebCore::HTMLFormControlElement::didChangeForm):
716         (WebCore::HTMLFormControlElement::shouldAutocorrect const):
717         (WebCore::HTMLFormControlElement::autocapitalizeType const):
718         * html/HTMLFormElement.cpp:
719         (WebCore::HTMLFormElement::handleLocalEvents):
720         (WebCore::submitElementFromEvent):
721         (WebCore::HTMLFormElement::prepareForSubmission):
722         (WebCore::HTMLFormElement::submit):
723         (WebCore::HTMLFormElement::reset):
724         (WebCore::HTMLFormElement::shouldAutocorrect const):
725         (WebCore::HTMLFormElement::parseAttribute):
726         (WebCore::HTMLFormElement::resetDefaultButton):
727         (WebCore::HTMLFormElement::elementFromPastNamesMap const):
728         (WebCore::HTMLFormElement::namedElements):
729         * html/HTMLFormElement.h:
730         * html/HTMLFrameElement.cpp:
731         (WebCore::HTMLFrameElement::didAttachRenderers):
732         * html/HTMLFrameElementBase.cpp:
733         (WebCore::HTMLFrameElementBase::isURLAllowed const):
734         (WebCore::HTMLFrameElementBase::openURL):
735         (WebCore::HTMLFrameElementBase::didAttachRenderers):
736         * html/HTMLFrameOwnerElement.cpp:
737         (WebCore::HTMLFrameOwnerElement::setContentFrame):
738         (WebCore::HTMLFrameOwnerElement::clearContentFrame):
739         (WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
740         (WebCore::SubframeLoadingDisabler::canLoadFrame):
741         * html/HTMLFrameSetElement.cpp:
742         (WebCore::HTMLFrameSetElement::findContaining):
743         (WebCore::HTMLFrameSetElement::willAttachRenderers):
744         (WebCore::HTMLFrameSetElement::insertedInto):
745         (WebCore::HTMLFrameSetElement::removedFrom):
746         * html/HTMLFrameSetElement.h:
747         * html/HTMLImageElement.cpp:
748         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
749         (WebCore::HTMLImageElement::pictureElement const):
750         (WebCore::HTMLImageElement::destroyImageControls):
751         (WebCore::HTMLImageElement::hasImageControls const):
752         * html/HTMLInputElement.cpp:
753         (WebCore::HTMLInputElement::innerTextElement const):
754         (WebCore::HTMLInputElement::endEditing):
755         (WebCore::HTMLInputElement::dataList const):
756         (WebCore::HTMLInputElement::resetListAttributeTargetObserver): Deleted.
757         (WebCore::HTMLInputElement::listAttributeTargetChanged): Deleted.
758         (WebCore::HTMLInputElement::isSteppable const): Deleted.
759         (WebCore::HTMLInputElement::dateType const): Deleted.
760         (WebCore::HTMLInputElement::isTextButton const): Deleted.
761         (WebCore::HTMLInputElement::isRadioButton const): Deleted.
762         (WebCore::HTMLInputElement::isSearchField const): Deleted.
763         (WebCore::HTMLInputElement::isInputTypeHidden const): Deleted.
764         (WebCore::HTMLInputElement::isPasswordField const): Deleted.
765         (WebCore::HTMLInputElement::isCheckbox const): Deleted.
766         (WebCore::HTMLInputElement::isRangeControl const): Deleted.
767         (WebCore::HTMLInputElement::isColorControl const): Deleted.
768         (WebCore::HTMLInputElement::isText const): Deleted.
769         (WebCore::HTMLInputElement::isEmailField const): Deleted.
770         (WebCore::HTMLInputElement::isFileUpload const): Deleted.
771         (WebCore::HTMLInputElement::isImageButton const): Deleted.
772         (WebCore::HTMLInputElement::isNumberField const): Deleted.
773         (WebCore::HTMLInputElement::isSubmitButton const): Deleted.
774         (WebCore::HTMLInputElement::isTelephoneField const): Deleted.
775         (WebCore::HTMLInputElement::isURLField const): Deleted.
776         (WebCore::HTMLInputElement::isDateField const): Deleted.
777         (WebCore::HTMLInputElement::isDateTimeField const): Deleted.
778         (WebCore::HTMLInputElement::isDateTimeLocalField const): Deleted.
779         (WebCore::HTMLInputElement::isMonthField const): Deleted.
780         (WebCore::HTMLInputElement::isTimeField const): Deleted.
781         (WebCore::HTMLInputElement::isWeekField const): Deleted.
782         (WebCore::HTMLInputElement::isEnumeratable const): Deleted.
783         (WebCore::HTMLInputElement::supportLabels const): Deleted.
784         (WebCore::HTMLInputElement::shouldAppearChecked const): Deleted.
785         (WebCore::HTMLInputElement::supportsPlaceholder const): Deleted.
786         (WebCore::HTMLInputElement::updatePlaceholderText): Deleted.
787         (WebCore::HTMLInputElement::isEmptyValue const): Deleted.
788         (WebCore::HTMLInputElement::maxLengthAttributeChanged): Deleted.
789         (WebCore::HTMLInputElement::minLengthAttributeChanged): Deleted.
790         (WebCore::HTMLInputElement::updateValueIfNeeded): Deleted.
791         (WebCore::HTMLInputElement::defaultToolTip const): Deleted.
792         (WebCore::HTMLInputElement::matchesIndeterminatePseudoClass const): Deleted.
793         (WebCore::HTMLInputElement::shouldAppearIndeterminate const): Deleted.
794         (WebCore::HTMLInputElement::mediaCaptureType const): Deleted.
795         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Deleted.
796         (WebCore:: const): Deleted.
797         (WebCore::HTMLInputElement::checkedRadioButtonForGroup const): Deleted.
798         (WebCore::HTMLInputElement::radioButtonGroups const): Deleted.
799         (WebCore::HTMLInputElement::addToRadioButtonGroup): Deleted.
800         (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Deleted.
801         (WebCore::HTMLInputElement::height const): Deleted.
802         (WebCore::HTMLInputElement::width const): Deleted.
803         (WebCore::HTMLInputElement::setHeight): Deleted.
804         (WebCore::HTMLInputElement::setWidth): Deleted.
805         (WebCore::ListAttributeTargetObserver::ListAttributeTargetObserver): Deleted.
806         (WebCore::ListAttributeTargetObserver::idTargetChanged): Deleted.
807         (WebCore::HTMLInputElement::setRangeText): Deleted.
808         (WebCore::HTMLInputElement::shouldTruncateText const): Deleted.
809         (WebCore::HTMLInputElement::selectionStartForBindings const): Deleted.
810         (WebCore::HTMLInputElement::setSelectionStartForBindings): Deleted.
811         (WebCore::HTMLInputElement::selectionEndForBindings const): Deleted.
812         (WebCore::HTMLInputElement::setSelectionEndForBindings): Deleted.
813         (WebCore::HTMLInputElement::selectionDirectionForBindings const): Deleted.
814         (WebCore::HTMLInputElement::setSelectionDirectionForBindings): Deleted.
815         (WebCore::HTMLInputElement::setSelectionRangeForBindings): Deleted.
816         (WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
817         (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Deleted.
818         (WebCore::HTMLInputElement::capsLockStateMayHaveChanged): Deleted.
819         * html/HTMLInputElement.h:
820         * html/HTMLKeygenElement.cpp:
821         (WebCore::HTMLKeygenElement::shadowSelect const):
822         * html/HTMLLabelElement.cpp:
823         (WebCore::HTMLLabelElement::defaultEventHandler):
824         * html/HTMLLinkElement.cpp:
825         (WebCore::HTMLLinkElement::handleClick):
826         * html/HTMLMapElement.cpp:
827         (WebCore::HTMLMapElement::mapMouseEvent):
828         * html/HTMLMediaElement.cpp:
829         (WebCore::HTMLMediaElement::selectMediaResource):
830         (WebCore::HTMLMediaElement::loadResource):
831         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
832         (WebCore::HTMLMediaElement::isSafeToLoadURL):
833         (WebCore::HTMLMediaElement::controls const):
834         (WebCore::HTMLMediaElement::layoutSizeChanged):
835         (WebCore::HTMLMediaElement::enterFullscreen):
836         (WebCore::HTMLMediaElement::mediaControls const):
837         (WebCore::HTMLMediaElement::hasMediaControls const):
838         (WebCore::HTMLMediaElement::mediaPlayerReferrer const):
839         (WebCore::HTMLMediaElement::mediaPlayerUserAgent const):
840         (WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge):
841         (WebCore::HTMLMediaElement::sourceApplicationIdentifier const):
842         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
843         (WebCore::HTMLMediaElement::session const):
844         * html/HTMLMediaElement.h:
845         (WebCore::HTMLMediaElement::player const):
846         * html/HTMLObjectElement.cpp:
847         (WebCore::HTMLObjectElement::hasFallbackContent const):
848         * html/HTMLOptGroupElement.cpp:
849         (WebCore::HTMLOptGroupElement::ownerSelectElement const):
850         (WebCore::HTMLOptGroupElement::accessKeyAction):
851         * html/HTMLOptionElement.cpp:
852         (WebCore::HTMLOptionElement::setText):
853         (WebCore::HTMLOptionElement::accessKeyAction):
854         (WebCore::HTMLOptionElement::index const):
855         (WebCore::HTMLOptionElement::parseAttribute):
856         (WebCore::HTMLOptionElement::selected):
857         (WebCore::HTMLOptionElement::setSelected):
858         (WebCore::HTMLOptionElement::setSelectedState):
859         (WebCore::HTMLOptionElement::childrenChanged):
860         (WebCore::HTMLOptionElement::ownerDataListElement const):
861         (WebCore::HTMLOptionElement::ownerSelectElement const):
862         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
863         (WebCore::HTMLOptionElement::insertedInto):
864         (WebCore::HTMLOptionElement::collectOptionInnerText const):
865         * html/HTMLPlugInElement.cpp:
866         (WebCore::HTMLPlugInElement::willDetachRenderers):
867         (WebCore::HTMLPlugInElement::isKeyboardFocusable const):
868         (WebCore::HTMLPlugInElement::isUserObservable const):
869         * html/HTMLPlugInImageElement.cpp:
870         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
871         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
872         * html/HTMLSelectElement.cpp:
873         (WebCore::HTMLSelectElement::add):
874         (WebCore::HTMLSelectElement::recalcListItems const):
875         (WebCore::HTMLSelectElement::selectOption):
876         (WebCore::HTMLSelectElement::reset):
877         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
878         * html/HTMLSlotElement.cpp:
879         (WebCore::flattenAssignedNodes):
880         * html/HTMLSourceElement.cpp:
881         (WebCore::HTMLSourceElement::removedFrom):
882         * html/HTMLSummaryElement.cpp:
883         (WebCore::HTMLSummaryElement::isActiveSummary const):
884         (WebCore::isClickableControl):
885         (WebCore::HTMLSummaryElement::defaultEventHandler):
886         * html/HTMLTableCellElement.cpp:
887         (WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
888         * html/HTMLTableColElement.cpp:
889         (WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
890         * html/HTMLTableElement.cpp:
891         (WebCore::HTMLTableElement::tHead const):
892         (WebCore::HTMLTableElement::setTHead):
893         (WebCore::HTMLTableElement::tFoot const):
894         (WebCore::HTMLTableElement::createTBody):
895         (WebCore::HTMLTableElement::lastBody const):
896         (WebCore::HTMLTableElement::deleteRow):
897         * html/HTMLTablePartElement.cpp:
898         (WebCore::HTMLTablePartElement::findParentTable const):
899         * html/HTMLTableRowsCollection.cpp:
900         (WebCore::HTMLTableRowsCollection::rowAfter):
901         * html/HTMLTextAreaElement.cpp:
902         (WebCore::HTMLTextAreaElement::subtreeHasChanged):
903         (WebCore::HTMLTextAreaElement::innerTextElement const):
904         * html/HTMLTextAreaElement.h:
905         * html/HTMLTextFormControlElement.cpp:
906         (WebCore::HTMLTextFormControlElement::setSelectionRange):
907         (WebCore::HTMLTextFormControlElement::indexForVisiblePosition const):
908         (WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
909         (WebCore::HTMLTextFormControlElement::computeSelectionStart const):
910         (WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
911         (WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
912         (WebCore::HTMLTextFormControlElement::selection const):
913         (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
914         (WebCore::innerTextValueFrom):
915         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
916         (WebCore::HTMLTextFormControlElement::innerTextValue const):
917         (WebCore::positionForIndex):
918         (WebCore::HTMLTextFormControlElement::indexForPosition const):
919         (WebCore::HTMLTextFormControlElement::hidePlaceholder):
920         (WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary):
921         (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
922         (WebCore::enclosingTextFormControl):
923         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
924         * html/HTMLTextFormControlElement.h:
925         * html/HTMLTrackElement.cpp:
926         (WebCore::HTMLTrackElement::canLoadURL):
927         (WebCore::HTMLTrackElement::setReadyState):
928         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute const):
929         (WebCore::HTMLTrackElement::textTrackKindChanged):
930         (WebCore::HTMLTrackElement::textTrackModeChanged):
931         (WebCore::HTMLTrackElement::textTrackAddCues):
932         (WebCore::HTMLTrackElement::textTrackRemoveCues):
933         (WebCore::HTMLTrackElement::textTrackAddCue):
934         (WebCore::HTMLTrackElement::textTrackRemoveCue):
935         (WebCore::HTMLTrackElement::mediaElement const):
936         * html/HTMLTrackElement.h:
937         * html/HTMLVideoElement.cpp:
938         (WebCore::HTMLVideoElement::setDisplayMode):
939         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
940         * html/ImageDocument.cpp:
941         (WebCore::ImageDocument::createDocumentStructure):
942         (WebCore::ImageDocument::scale):
943         (WebCore::ImageDocument::imageFitsInWindow):
944         * html/InputType.cpp:
945         (WebCore::InputType::destroyShadowSubtree):
946         * html/InputType.h:
947         (WebCore::InputType::innerTextElement const):
948         * html/MediaDocument.cpp:
949         (WebCore::MediaDocumentParser::createDocumentStructure):
950         (WebCore::MediaDocument::defaultEventHandler):
951         * html/MediaElementSession.cpp:
952         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
953         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
954         (WebCore::isMainContentForPurposesOfAutoplay):
955         * html/NumberInputType.cpp:
956         (WebCore::NumberInputType::decorationWidth const):
957         * html/PluginDocument.cpp:
958         (WebCore::PluginDocumentParser::appendBytes):
959         * html/RadioInputType.cpp:
960         (WebCore::RadioInputType::handleKeydownEvent):
961         (WebCore::RadioInputType::isKeyboardFocusable const):
962         (WebCore::RadioInputType::didDispatchClick):
963         * html/RadioNodeList.cpp:
964         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const):
965         * html/RangeInputType.cpp:
966         (WebCore::RangeInputType::handleMouseDownEvent):
967         (WebCore::RangeInputType::handleTouchEvent):
968         (WebCore::RangeInputType::sliderTrackElement const):
969         (WebCore::RangeInputType::listAttributeTargetChanged):
970         (WebCore::RangeInputType::updateTickMarkValues):
971         * html/SearchInputType.cpp:
972         (WebCore::SearchInputType::createShadowSubtree):
973         * html/TextFieldInputType.cpp:
974         (WebCore::TextFieldInputType::isEmptyValue const):
975         (WebCore::TextFieldInputType::handleKeydownEvent):
976         (WebCore::TextFieldInputType::handleFocusEvent):
977         (WebCore::TextFieldInputType::innerTextElement const):
978         (WebCore::TextFieldInputType::updatePlaceholderText):
979         (WebCore::TextFieldInputType::didSetValueByUserEdit):
980         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
981         * html/TextFieldInputType.h:
982         * html/canvas/CanvasRenderingContext2D.cpp:
983         (WebCore::size):
984         (WebCore::CanvasRenderingContext2D::drawImage):
985         * html/canvas/WebGL2RenderingContext.cpp:
986         (WebCore::WebGL2RenderingContext::copyBufferSubData):
987         (WebCore::WebGL2RenderingContext::getBufferSubData):
988         * html/canvas/WebGLFramebuffer.cpp:
989         (WebCore::WebGLFramebuffer::attach):
990         (WebCore::WebGLFramebuffer::getAttachmentObject const):
991         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
992         (WebCore::WebGLFramebuffer::getColorBufferWidth const):
993         (WebCore::WebGLFramebuffer::getColorBufferHeight const):
994         (WebCore::WebGLFramebuffer::getColorBufferFormat const):
995         (WebCore::WebGLFramebuffer::checkStatus const):
996         (WebCore::WebGLFramebuffer::hasStencilBuffer const):
997         (WebCore::WebGLFramebuffer::initializeAttachments):
998         * html/canvas/WebGLRenderingContext.cpp:
999         (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
1000         * html/canvas/WebGLRenderingContextBase.cpp:
1001         (WebCore::WebGLRenderingContextBase::create):
1002         (WebCore::WebGLRenderingContextBase::bufferData):
1003         (WebCore::WebGLRenderingContextBase::bufferSubData):
1004         (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
1005         (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
1006         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
1007         (WebCore::WebGLRenderingContextBase::generateMipmap):
1008         (WebCore::WebGLRenderingContextBase::getAttachedShaders):
1009         (WebCore::WebGLRenderingContextBase::getTexParameter):
1010         (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
1011         (WebCore::WebGLRenderingContextBase::texImage2DBase):
1012         (WebCore::WebGLRenderingContextBase::validateTexFunc):
1013         (WebCore::WebGLRenderingContextBase::texSubImage2D):
1014         (WebCore::WebGLRenderingContextBase::texSubImage2DBase):
1015         (WebCore::WebGLRenderingContextBase::copyTexImage2D):
1016         (WebCore::WebGLRenderingContextBase::texImage2D):
1017         (WebCore::WebGLRenderingContextBase::texParameter):
1018         (WebCore::WebGLRenderingContextBase::loseContextImpl):
1019         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
1020         (WebCore::WebGLRenderingContextBase::validateTextureBinding):
1021         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
1022         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
1023         (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const):
1024         (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor):
1025         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
1026         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const):
1027         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth):
1028         * html/parser/HTMLConstructionSite.cpp:
1029         (WebCore::executeInsertAlreadyParsedChildTask):
1030         (WebCore::HTMLConstructionSite::insertTextNode):
1031         * html/parser/HTMLFormattingElementList.cpp:
1032         (WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly):
1033         * html/parser/HTMLParserOptions.cpp:
1034         (WebCore::HTMLParserOptions::HTMLParserOptions):
1035         * html/parser/HTMLParserScheduler.cpp:
1036         (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
1037         * html/parser/HTMLTreeBuilder.cpp:
1038         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
1039         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
1040         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
1041         * html/parser/XSSAuditor.cpp:
1042         (WebCore::XSSAuditor::init):
1043         * html/shadow/MediaControlElementTypes.cpp:
1044         (WebCore::parentMediaElement):
1045         * html/shadow/MediaControlElementTypes.h:
1046         (WebCore::parentMediaElement):
1047         * html/shadow/MediaControlElements.cpp:
1048         (WebCore::MediaControlPanelElement::startDrag):
1049         (WebCore::MediaControlPanelElement::endDrag):
1050         (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
1051         (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
1052         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
1053         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
1054         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
1055         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1056         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
1057         (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
1058         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
1059         (WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
1060         (WebCore::MediaControlTextTrackContainerElement::updateSizes):
1061         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
1062         * html/shadow/MediaControls.cpp:
1063         (WebCore::MediaControls::containsRelatedTarget):
1064         * html/shadow/SliderThumbElement.cpp:
1065         (WebCore::SliderThumbElement::isDisabledFormControl const):
1066         (WebCore::SliderThumbElement::matchesReadWritePseudoClass const):
1067         (WebCore::SliderThumbElement::focusDelegate):
1068         (WebCore::SliderThumbElement::setPositionFromPoint):
1069         (WebCore::SliderThumbElement::startDragging):
1070         (WebCore::SliderThumbElement::stopDragging):
1071         (WebCore::SliderThumbElement::defaultEventHandler):
1072         (WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
1073         (WebCore::SliderThumbElement::willRespondToMouseClickEvents):
1074         (WebCore::SliderThumbElement::willDetachRenderers):
1075         (WebCore::findTouchWithIdentifier):
1076         (WebCore::SliderThumbElement::handleTouchStart):
1077         (WebCore::SliderThumbElement::handleTouchMove):
1078         (WebCore::SliderThumbElement::handleTouchEndAndCancel):
1079         (WebCore::SliderThumbElement::handleTouchEvent):
1080         (WebCore::SliderThumbElement::hostInput const):
1081         * html/shadow/SliderThumbElement.h:
1082         * html/shadow/SpinButtonElement.cpp:
1083         (WebCore::SpinButtonElement::defaultEventHandler):
1084         (WebCore::SpinButtonElement::releaseCapture):
1085         * html/shadow/TextControlInnerElements.cpp:
1086         (WebCore::TextControlInnerTextElement::defaultEventHandler):
1087         (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
1088         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
1089         (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
1090         * html/track/LoadableTextTrack.cpp:
1091         (WebCore::LoadableTextTrack::trackElementIndex):
1092         * html/track/TextTrack.cpp:
1093         (WebCore::TextTrack::setMode):
1094         (WebCore::TextTrack::hasCue):
1095         * html/track/TextTrackCueGeneric.cpp:
1096         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
1097         * html/track/VTTCue.cpp:
1098         (WebCore::VTTCue::copyWebVTTNodeToDOMTree):
1099         (WebCore::VTTCue::determineTextDirection):
1100         (WebCore::VTTCue::markFutureAndPastNodes):
1101         (WebCore::VTTCue::removeDisplayTree):
1102         (WebCore::VTTCue::cueContentsMatch const):
1103         * inspector/InspectorDOMAgent.cpp:
1104         (WebCore::InspectorDOMAgent::didAddEventListener):
1105         (WebCore::InspectorDOMAgent::willRemoveEventListener):
1106         * loader/FormSubmission.cpp:
1107         (WebCore::FormSubmission::create):
1108         * page/ContextMenuController.cpp:
1109         (WebCore::ContextMenuController::maybeCreateContextMenu):
1110         * rendering/RenderSnapshottedPlugIn.cpp:
1111         (WebCore::RenderSnapshottedPlugIn::handleEvent):
1112         * rendering/RenderTextControl.cpp:
1113         (WebCore::RenderTextControl::innerTextElement const):
1114         (WebCore::RenderTextControl::styleDidChange):
1115         (WebCore::RenderTextControl::textBlockLogicalWidth const):
1116         (WebCore::RenderTextControl::computeLogicalHeight const):
1117         (WebCore::RenderTextControl::hitInnerTextElement):
1118         (WebCore::RenderTextControl::canScroll const):
1119         (WebCore::RenderTextControl::innerLineHeight const):
1120         * rendering/RenderTextControl.h:
1121         * rendering/RenderTextControlSingleLine.cpp:
1122         (WebCore::RenderTextControlSingleLine::nodeAtPoint):
1123         (WebCore::RenderTextControlSingleLine::styleDidChange):
1124         * rendering/RenderTheme.cpp:
1125         (WebCore::RenderTheme::isFocused const):
1126         * rendering/RenderThemeGtk.cpp:
1127         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
1128         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
1129         * rendering/RenderThemeMac.mm:
1130         (WebCore::RenderThemeMac::paintSliderThumb):
1131         * rendering/RenderVideo.cpp:
1132         (WebCore::RenderVideo::willBeDestroyed):
1133         (WebCore::RenderVideo::calculateIntrinsicSize):
1134         (WebCore::RenderVideo::paintReplaced):
1135         (WebCore::RenderVideo::updatePlayer):
1136         (WebCore::RenderVideo::supportsAcceleratedRendering const):
1137         (WebCore::RenderVideo::acceleratedRenderingStateChanged):
1138         (WebCore::RenderVideo::requiresImmediateCompositing const):
1139         (WebCore::RenderVideo::foregroundIsKnownToBeOpaqueInRect const):
1140         * svg/SVGUseElement.cpp:
1141         (WebCore::SVGUseElement::clearShadowTree):
1142         (WebCore::SVGUseElement::targetClone const):
1143
1144 2017-10-18  Dean Jackson  <dino@apple.com>
1145
1146         Some older hardware can't actually use renderbuffers at the size they advertise
1147         https://bugs.webkit.org/show_bug.cgi?id=178417
1148         <rdar://problem/35042291>
1149
1150         Reviewed by Tim Horton.
1151
1152         The change in r223567 caused some older hardware to fail, because even though
1153         they claimed to support a maximum renderbuffer and viewport of 16K, they were
1154         unable to actually handle one. Rather than trying to identify such hardware,
1155         clamp all buffers to a maximum of 8192. This is bigger than the previous value
1156         of 4096, and large enough to have a full-screen buffer on a Retina 5K iMac.
1157
1158         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1159         (WebCore::GraphicsContext3D::getIntegerv):
1160
1161 2017-10-18  Chris Dumez  <cdumez@apple.com>
1162
1163         [Service Worker] Add stubs for Client / WindowClient / Clients
1164         https://bugs.webkit.org/show_bug.cgi?id=178469
1165
1166         Reviewed by Youenn Fablet.
1167
1168         Add stubs for Client / WindowClient / Clients:
1169         - https://w3c.github.io/ServiceWorker/v1/#clients
1170         - https://w3c.github.io/ServiceWorker/v1/#client-interface
1171
1172         * CMakeLists.txt:
1173         * DerivedSources.make:
1174         * WebCore.xcodeproj/project.pbxproj:
1175         * bindings/js/WebCoreBuiltinNames.h:
1176         * dom/Document.cpp:
1177         (WebCore::Document::visibilityState const):
1178         * dom/Document.h:
1179         * dom/Document.idl:
1180         * dom/VisibilityState.h: Renamed from Source/WebCore/page/PageVisibilityState.h.
1181         * dom/VisibilityState.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
1182         * page/Page.cpp:
1183         (WebCore::Page::visibilityState const):
1184         * page/Page.h:
1185         * workers/service/ServiceWorkerClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
1186         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
1187         (WebCore::ServiceWorkerClient::activeDOMObjectName const):
1188         (WebCore::ServiceWorkerClient::canSuspendForDocumentSuspension const):
1189         (WebCore::ServiceWorkerClient::url const):
1190         (WebCore::ServiceWorkerClient::frameType const):
1191         (WebCore::ServiceWorkerClient::id const):
1192         (WebCore::ServiceWorkerClient::postMessage):
1193         * workers/service/ServiceWorkerClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
1194         * workers/service/ServiceWorkerClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
1195         * workers/service/ServiceWorkerClients.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
1196         (WebCore::ServiceWorkerClients::ServiceWorkerClients):
1197         (WebCore::ServiceWorkerClients::activeDOMObjectName const):
1198         (WebCore::ServiceWorkerClients::canSuspendForDocumentSuspension const):
1199         (WebCore::ServiceWorkerClients::get):
1200         (WebCore::ServiceWorkerClients::matchAll):
1201         (WebCore::ServiceWorkerClients::openWindow):
1202         (WebCore::ServiceWorkerClients::claim):
1203         * workers/service/ServiceWorkerClients.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
1204         (WebCore::ServiceWorkerClients::create):
1205         * workers/service/ServiceWorkerClients.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
1206         * workers/service/ServiceWorkerGlobalScope.cpp:
1207         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
1208         * workers/service/ServiceWorkerGlobalScope.h:
1209         (WebCore::ServiceWorkerGlobalScope::clients):
1210         * workers/service/ServiceWorkerGlobalScope.idl:
1211         * workers/service/ServiceWorkerWindowClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
1212         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
1213         (WebCore::ServiceWorkerWindowClient::visibilityState const):
1214         (WebCore::ServiceWorkerWindowClient::isFocused const):
1215         (WebCore::ServiceWorkerWindowClient::focus):
1216         (WebCore::ServiceWorkerWindowClient::navigate):
1217         * workers/service/ServiceWorkerWindowClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
1218         * workers/service/ServiceWorkerWindowClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
1219
1220 2017-10-18  Zalan Bujtas  <zalan@apple.com>
1221
1222         [FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value on reentrancy
1223         https://bugs.webkit.org/show_bug.cgi?id=178479
1224         <rdar://problem/35056950>
1225
1226         Reviewed by Simon Fraser.
1227
1228         No change in functionality.
1229
1230         * page/FrameView.cpp:
1231         (WebCore::FrameView::layout):
1232
1233 2017-10-18  Zalan Bujtas  <zalan@apple.com>
1234
1235         [FrameView::layout cleanup] Remove InPreLayoutStyleUpdate.
1236         https://bugs.webkit.org/show_bug.cgi?id=178483
1237         <rdar://problem/35058800>
1238
1239         Reviewed by Simon Fraser.
1240
1241         Its client, updateCompositingLayersAfterStyleChange only needs to know if there's a upcoming
1242         layer update (part of FrameView::layout()).
1243
1244         No change in functionality.
1245
1246         * page/FrameView.cpp:
1247         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
1248         (WebCore::FrameView::layout):
1249         * page/FrameView.h:
1250
1251 2017-10-18  Chris Dumez  <cdumez@apple.com>
1252
1253         Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface
1254         https://bugs.webkit.org/show_bug.cgi?id=178482
1255
1256         Reviewed by Sam Weinig.
1257
1258         Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface,
1259         not the ServiceWorker interface.
1260
1261         * bindings/scripts/preprocess-idls.pl:
1262
1263 2017-10-17  Ryosuke Niwa  <rniwa@webkit.org>
1264
1265         Add an argument indicating the type of insertion to Node::insertedInto
1266         https://bugs.webkit.org/show_bug.cgi?id=178431
1267
1268         Reviewed by Antti Koivisto.
1269
1270         Added InsertionType as the first argument to Node::insertedInto, which contains two booleans indicating
1271         whether the node just become newly connected to a document, and whether node's tree scope had changed or not.
1272
1273         These boolean flags simplifie the logic in insertedInto implementations, and are required to have a better
1274         guarantee about the correctness of node flags during calls to insertedInto. Right now, isConnected() and
1275         isInShadowTree() are both outdated until Node::insertedInto is called.
1276
1277         Also renamed the second argument from insertionPoint to parentOfInsertedTree to make the semantics clear,
1278         and renamed finishedInsertingSubtree to didFinishInsertingNode, and renamed InsertionNotificationRequest
1279         to InsertedIntoResult using enum class.
1280
1281         Note that in some implementations of insertedInto, we check whether isConnected() was false to decide whether
1282         the node is newly connected to a document. This extra check is no longer necessary since no node will be inserted
1283         into a document without first being completely removed after r223458.
1284
1285         No new tests since there should be no behavioral changes.
1286
1287         * dom/ContainerNode.cpp:
1288         (WebCore::ContainerNode::notifyChildInserted):
1289         * dom/ContainerNodeAlgorithms.cpp:
1290         (WebCore::notifyNodeInsertedIntoDocument): Replaced the check that the node had not been disconnected by scripts
1291         by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
1292         (WebCore::notifyNodeInsertedIntoTree): Removed NoEventDispatchAssertion since notifyChildNodeInserted has it
1293         already since r223458.
1294         (WebCore::notifyChildNodeInserted): Made this function return NodeVector (copy elision).
1295         * dom/ContainerNodeAlgorithms.h:
1296         * dom/Element.cpp:
1297         (WebCore::Element::insertedInto): Use insertionType.connectedToDocument to detect when this element had become
1298         connected to some document. Similarly, use insertionType.treeScopeChanged to detect when this element had been
1299         inserted into a new tree scope. Removed the comment which became obsolete due to this cleanup.
1300         (WebCore::Element::addShadowRoot): Simplified the code here since we never attach a ShadowRoot with children.
1301         * dom/Element.h:
1302         * dom/Node.cpp:
1303         (WebCore::Node::insertedInto):
1304         * dom/Node.h:
1305         (WebCore::Node::InsertedIntoResult): Renamed from InsertionNotificationRequest, and turned into an enum class.
1306         (WebCore::Node::InsertionType): Added. We pass this object by value to insertedInto as a performance optimization
1307         as passing two booleans by value is faster than passing a pointer and then de-referencing it in a virtual callee.
1308         (WebCore::Node::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1309         * dom/ProcessingInstruction.cpp:
1310         (WebCore::ProcessingInstruction::insertedInto):
1311         (WebCore::ProcessingInstruction::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1312         * dom/ProcessingInstruction.h:
1313         * dom/ScriptElement.cpp:
1314         (WebCore::ScriptElement::shouldCallFinishedInsertingSubtree): Deleted.
1315         (WebCore::ScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1316         * dom/ScriptElement.h:
1317         (WebCore::ScriptElement::insertedInto const): Added. Extracted from shouldCallFinishedInsertingSubtree.
1318         * dom/ShadowRoot.cpp:
1319         (WebCore::ShadowRoot::insertedInto): The extra isConnected() check is no longer needed. See the description above.
1320         * dom/ShadowRoot.h:
1321         * html/FormAssociatedElement.cpp:
1322         (WebCore::FormAssociatedElement::insertedInto):
1323         * html/FormAssociatedElement.h:
1324         * html/HTMLBaseElement.cpp:
1325         (WebCore::HTMLBaseElement::insertedInto):
1326         * html/HTMLBaseElement.h:
1327         * html/HTMLBodyElement.cpp:
1328         (WebCore::HTMLBodyElement::insertedInto):
1329         (WebCore::HTMLBodyElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1330         * html/HTMLBodyElement.h:
1331         * html/HTMLFormControlElement.cpp:
1332         (WebCore::HTMLFormControlElement::insertedInto):
1333         (WebCore::HTMLFormControlElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1334         * html/HTMLFormControlElement.h:
1335         * html/HTMLFormControlElementWithState.cpp:
1336         (WebCore::HTMLFormControlElementWithState::insertedInto):
1337         * html/HTMLFormControlElementWithState.h:
1338         * html/HTMLFormElement.cpp:
1339         (WebCore::HTMLFormElement::insertedInto):
1340         * html/HTMLFormElement.h:
1341         * html/HTMLFrameElementBase.cpp:
1342         (WebCore::HTMLFrameElementBase::insertedInto):
1343         (WebCore::HTMLFrameElementBase::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1344         * html/HTMLFrameElementBase.h:
1345         * html/HTMLFrameSetElement.cpp:
1346         (WebCore::HTMLFrameSetElement::insertedInto):
1347         * html/HTMLFrameSetElement.h:
1348         * html/HTMLImageElement.cpp:
1349         (WebCore::HTMLImageElement::insertedInto):
1350         * html/HTMLImageElement.h:
1351         * html/HTMLInputElement.cpp:
1352         (WebCore::HTMLInputElement::insertedInto):
1353         (WebCore::HTMLInputElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1354         * html/HTMLInputElement.h:
1355         * html/HTMLLinkElement.cpp:
1356         (WebCore::HTMLLinkElement::insertedInto): The extra isConnected() check is no longer needed. See above.
1357         (WebCore::HTMLLinkElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1358         * html/HTMLLinkElement.h:
1359         * html/HTMLMapElement.cpp:
1360         (WebCore::HTMLMapElement::insertedInto):
1361         * html/HTMLMapElement.h:
1362         * html/HTMLMediaElement.cpp:
1363         (WebCore::HTMLMediaElement::insertedInto):
1364         (WebCore::HTMLMediaElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1365         * html/HTMLMediaElement.h:
1366         * html/HTMLMetaElement.cpp:
1367         (WebCore::HTMLMetaElement::insertedInto):
1368         * html/HTMLMetaElement.h:
1369         * html/HTMLObjectElement.cpp:
1370         (WebCore::HTMLObjectElement::insertedInto):
1371         (WebCore::HTMLObjectElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1372         * html/HTMLObjectElement.h:
1373         * html/HTMLOptionElement.cpp:
1374         (WebCore::HTMLOptionElement::insertedInto):
1375         * html/HTMLOptionElement.h:
1376         * html/HTMLScriptElement.cpp:
1377         (WebCore::HTMLScriptElement::insertedInto):
1378         (WebCore::HTMLScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1379         * html/HTMLScriptElement.h:
1380         * html/HTMLSelectElement.cpp:
1381         (WebCore::HTMLSelectElement::insertedInto):
1382         * html/HTMLSelectElement.h:
1383         * html/HTMLSlotElement.cpp:
1384         (WebCore::HTMLSlotElement::insertedInto): Replaced a cumbersome condition by a boolean check on insertionType's
1385         treeScopeChanged and removed the accompanying comment which is no longer needed.
1386         * html/HTMLSlotElement.h:
1387         * html/HTMLSourceElement.cpp:
1388         (WebCore::HTMLSourceElement::insertedInto):
1389         * html/HTMLSourceElement.h:
1390         * html/HTMLStyleElement.cpp:
1391         (WebCore::HTMLStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above.
1392         * html/HTMLStyleElement.h:
1393         * html/HTMLTextFormControlElement.cpp:
1394         (WebCore::HTMLTextFormControlElement::insertedInto):
1395         * html/HTMLTextFormControlElement.h:
1396         * html/HTMLTitleElement.cpp:
1397         (WebCore::HTMLTitleElement::insertedInto):
1398         * html/HTMLTitleElement.h:
1399         * html/HTMLTrackElement.cpp:
1400         (WebCore::HTMLTrackElement::insertedInto): Added a FIXME since this code is clearly wrong.
1401         * html/HTMLTrackElement.h:
1402         * svg/SVGElement.cpp:
1403         (WebCore::SVGElement::insertedInto):
1404         * svg/SVGElement.h:
1405         * svg/SVGFEImageElement.cpp:
1406         (WebCore::SVGFEImageElement::insertedInto):
1407         (WebCore::SVGFEImageElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1408         * svg/SVGFEImageElement.h:
1409         * svg/SVGFontFaceElement.cpp:
1410         (WebCore::SVGFontFaceElement::insertedInto):
1411         * svg/SVGFontFaceElement.h:
1412         * svg/SVGFontFaceUriElement.cpp:
1413         (WebCore::SVGFontFaceUriElement::insertedInto):
1414         * svg/SVGFontFaceUriElement.h:
1415         * svg/SVGImageElement.cpp:
1416         (WebCore::SVGImageElement::insertedInto):
1417         * svg/SVGImageElement.h:
1418         * svg/SVGMPathElement.cpp:
1419         (WebCore::SVGMPathElement::insertedInto):
1420         (WebCore::SVGMPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1421         * svg/SVGMPathElement.h:
1422         * svg/SVGPathElement.cpp:
1423         (WebCore::SVGPathElement::insertedInto):
1424         * svg/SVGPathElement.h:
1425         * svg/SVGSVGElement.cpp:
1426         (WebCore::SVGSVGElement::insertedInto):
1427         * svg/SVGSVGElement.h:
1428         * svg/SVGScriptElement.cpp:
1429         (WebCore::SVGScriptElement::insertedInto):
1430         (WebCore::SVGScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1431         * svg/SVGScriptElement.h:
1432         * svg/SVGStyleElement.cpp:
1433         (WebCore::SVGStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above description.
1434         * svg/SVGStyleElement.h:
1435         * svg/SVGTRefElement.cpp:
1436         (WebCore::SVGTRefElement::insertedInto):
1437         (WebCore::SVGTRefElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1438         * svg/SVGTRefElement.h:
1439         * svg/SVGTextPathElement.cpp:
1440         (WebCore::SVGTextPathElement::insertedInto):
1441         (WebCore::SVGTextPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1442         * svg/SVGTextPathElement.h:
1443         * svg/SVGTitleElement.cpp:
1444         (WebCore::SVGTitleElement::insertedInto):
1445         * svg/SVGTitleElement.h:
1446         * svg/SVGUseElement.cpp:
1447         (WebCore::SVGUseElement::insertedInto):
1448         * svg/SVGUseElement.h:
1449         * svg/animation/SVGSMILElement.cpp:
1450         (WebCore::SVGSMILElement::insertedInto):
1451         (WebCore::SVGSMILElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
1452         * svg/animation/SVGSMILElement.h:
1453
1454 2017-10-18  Eric Carlson  <eric.carlson@apple.com>
1455
1456         Key events should not update Document.lastHandledUserGestureTimestamp unless key event is handled
1457         https://bugs.webkit.org/show_bug.cgi?id=178473
1458         <rdar://problem/34869935>
1459
1460         Reviewed by Brent Fulgham.
1461
1462         No new tests, updated media/restricted-audio-playback-with-document-gesture.html for this change.
1463
1464         * page/EventHandler.cpp:
1465         (WebCore::EventHandler::keyEvent): Restore the current Document's "lastHandledUserGestureTimestamp"
1466         if the key event was not handled.
1467
1468 2017-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1469
1470         Unreviewed, rolling out r223291.
1471
1472         After further investigation, this removed codepath is
1473         something Mail may want to re-adopt. Additionally, the
1474         original breaking change was rolled out in r223408, so
1475         this test once again passes on ToT.
1476
1477         Reverted changeset:
1478
1479         "Remove Editor::simplifyMarkup"
1480         https://bugs.webkit.org/show_bug.cgi?id=178271
1481         https://trac.webkit.org/changeset/223291
1482
1483 2017-10-18  Sam Weinig  <sam@webkit.org>
1484
1485         [Settings] Move remaining simple settings to Settings.in
1486         https://bugs.webkit.org/show_bug.cgi?id=177730
1487         <rdar://problem/34763346>
1488
1489         Reviewed by Daniel Bates.
1490
1491         * Scripts/GenerateSettings/Settings.py:
1492         (Setting.__init__):
1493         (Setting.__str__):
1494         (Setting.getterFunctionName):
1495         (parseInput):
1496
1497             Add support for parsing the 'getter' option.
1498
1499         * page/Settings.in:
1500         
1501             Migrate simple settings from SettingsBase to here.
1502         
1503         * page/SettingsBase.cpp:
1504         (WebCore::SettingsBase::SettingsBase):
1505         (WebCore::SettingsBase::setJavaEnabled): Deleted.
1506         (WebCore::SettingsBase::setJavaEnabledForLocalFiles): Deleted.
1507         (WebCore::SettingsBase::setPreferMIMETypeForImages): Deleted.
1508         (WebCore::SettingsBase::setForcePendingWebGLPolicy): Deleted.
1509         (WebCore::SettingsBase::setNeedsAdobeFrameReloadingQuirk): Deleted.
1510         (WebCore::SettingsBase::setFontRenderingMode): Deleted.
1511         (WebCore::SettingsBase::fontRenderingMode const): Deleted.
1512         (WebCore::SettingsBase::setShowTiledScrollingIndicator): Deleted.
1513         (WebCore::SettingsBase::setFontFallbackPrefersPictographs): Deleted.
1514         * page/SettingsBase.h:
1515         (WebCore::SettingsBase::isJavaEnabled const): Deleted.
1516         (WebCore::SettingsBase::isJavaEnabledForLocalFiles const): Deleted.
1517         (WebCore::SettingsBase::preferMIMETypeForImages const): Deleted.
1518         (WebCore::SettingsBase::needsAcrobatFrameReloadingQuirk const): Deleted.
1519         (WebCore::SettingsBase::showTiledScrollingIndicator const): Deleted.
1520         (WebCore::SettingsBase::setTouchEventEmulationEnabled): Deleted.
1521         (WebCore::SettingsBase::isTouchEventEmulationEnabled const): Deleted.
1522         (WebCore::SettingsBase::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
1523         (WebCore::SettingsBase::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
1524         (WebCore::SettingsBase::fontFallbackPrefersPictographs const): Deleted.
1525         (WebCore::SettingsBase::setMediaKeysStorageDirectory): Deleted.
1526         (WebCore::SettingsBase::mediaKeysStorageDirectory const): Deleted.
1527         (WebCore::SettingsBase::setMediaDeviceIdentifierStorageDirectory): Deleted.
1528         (WebCore::SettingsBase::mediaDeviceIdentifierStorageDirectory const): Deleted.
1529         (WebCore::SettingsBase::applePayEnabled const): Deleted.
1530         (WebCore::SettingsBase::setApplePayEnabled): Deleted.
1531         (WebCore::SettingsBase::applePayCapabilityDisclosureAllowed const): Deleted.
1532         (WebCore::SettingsBase::setApplePayCapabilityDisclosureAllowed): Deleted.
1533         (WebCore::SettingsBase::isForcePendingWebGLPolicy const): Deleted.
1534         
1535             Remove simple settings.
1536
1537 2017-10-18  Zalan Bujtas  <zalan@apple.com>
1538
1539         [FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
1540         https://bugs.webkit.org/show_bug.cgi?id=178477
1541         <rdar://problem/35056478>
1542
1543         Reviewed by Simon Fraser.
1544
1545         No change in functionality.
1546
1547         * page/FrameView.cpp:
1548         (WebCore::FrameView::markRootOrBodyRendererDirty const):
1549         (WebCore::FrameView::layout):
1550         * page/FrameView.h:
1551
1552 2017-10-18  Keith Miller  <keith_miller@apple.com>
1553
1554         Setup WebCore build to start using unified sources.
1555         https://bugs.webkit.org/show_bug.cgi?id=178362
1556
1557         Reviewed by Tim Horton.
1558
1559         This patch adds all the long tooling needed to start adding
1560         unified sources to WebCore. Most of the source list files
1561         are empty to start but will be filled over the next few days.
1562
1563         I started by moving all the non-derived bindings code to
1564         unified sources to make sure everything worked correctly.
1565
1566         * CMakeLists.txt:
1567         * Configurations/GenerateUnifiedSources.xcconfig: Added.
1568         * Configurations/WebCore.xcconfig:
1569         * PlatformMac.cmake:
1570         * Sources.txt: Added.
1571         * SourcesCocoa.txt: Added.
1572         * SourcesIOS.txt: Added.
1573         * SourcesMac.txt: Added.
1574         * WebCore.xcodeproj/project.pbxproj:
1575         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Removed. No one seems to use this...
1576
1577 2017-10-18  Commit Queue  <commit-queue@webkit.org>
1578
1579         Unreviewed, rolling out r223321.
1580         https://bugs.webkit.org/show_bug.cgi?id=178476
1581
1582         This protocol change broke some internal builds (Requested by
1583         brrian__ on #webkit).
1584
1585         Reverted changeset:
1586
1587         "Web Inspector: provide a way to enable/disable event
1588         listeners"
1589         https://bugs.webkit.org/show_bug.cgi?id=177451
1590         https://trac.webkit.org/changeset/223321
1591
1592 2017-10-18  Sam Weinig  <sam@webkit.org>
1593
1594         [Settings] Miscellaneous cleanup of the settings generation scripts
1595         https://bugs.webkit.org/show_bug.cgi?id=178462
1596
1597         Reviewed by Daniel Bates.
1598
1599         - Stop generating and remove now unused SettingsMacros.h
1600         - Make functions operating on the python Setting object member functions
1601         - Add predicate to determine if a Setting's type is a value type, allowing
1602           us to exclude those from using const references.
1603
1604         * CMakeLists.txt:
1605         * DerivedSources.make:
1606         * Scripts/GenerateSettings.py:
1607         * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py:
1608         * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py:
1609         * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
1610         * Scripts/GenerateSettings/GenerateSettings.py:
1611         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
1612         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
1613         * Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
1614         * Scripts/GenerateSettings/Settings.py:
1615         * WebCoreMacros.cmake:
1616         * WebCore.xcodeproj/project.pbxproj:
1617
1618 2017-10-18  Chris Dumez  <cdumez@apple.com>
1619
1620         Align ImageData constructor with the specification
1621         https://bugs.webkit.org/show_bug.cgi?id=178406
1622
1623         Reviewed by Youenn Fablet.
1624
1625         Align ImageData constructor with the specification:
1626         - https://html.spec.whatwg.org/multipage/canvas.html#dom-imagedata
1627
1628         It sometimes throws the wrong exception.
1629
1630         No new tests, rebaselined existing test.
1631
1632         * html/ImageData.cpp:
1633         (WebCore::ImageData::create):
1634         * html/ImageData.h:
1635         * html/ImageData.idl:
1636
1637 2017-10-18  Chris Dumez  <cdumez@apple.com>
1638
1639         Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
1640         https://bugs.webkit.org/show_bug.cgi?id=177876
1641         <rdar://problem/34813129>
1642
1643         Reviewed by Ryosuke Niwa.
1644
1645         No new tests, updatdd existing test.
1646
1647         * dom/Document.h:
1648         * testing/Internals.cpp:
1649         (WebCore::Internals::hasServiceWorkerRegisteredForOrigin):
1650         * testing/Internals.h:
1651         * testing/Internals.idl:
1652         * workers/service/ServiceWorkerProvider.h:
1653         * workers/service/context/SWContextManager.cpp:
1654         (WebCore::SWContextManager::startServiceWorkerContext):
1655         * workers/service/server/SWClientConnection.h:
1656         * workers/service/server/SWServer.cpp:
1657         (WebCore::SWServer::Connection::scriptContextStarted):
1658         (WebCore::SWServer::scriptContextStarted):
1659         * workers/service/server/SWServer.h:
1660         * workers/service/server/SWServerRegistration.cpp:
1661         (WebCore::SWServerRegistration::scriptContextFailedToStart):
1662         (WebCore::SWServerRegistration::scriptContextStarted):
1663         * workers/service/server/SWServerRegistration.h:
1664
1665 2017-10-18  Sam Weinig  <sam@webkit.org>
1666
1667         [Settings] Replace macros in Settings.h/cpp with generated code
1668         https://bugs.webkit.org/show_bug.cgi?id=178419
1669
1670         Reviewed by Antti Koivisto.
1671
1672         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
1673         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
1674
1675             Rather than use macros in the generated Settings class, generate the code the macros
1676             would expand to.
1677
1678 2017-10-18  Zalan Bujtas  <zalan@apple.com>
1679
1680         [FrameView::layout cleanup] Move frame flattening layout logic to a separate function
1681         https://bugs.webkit.org/show_bug.cgi?id=178425
1682         <rdar://problem/35045836>
1683
1684         Reviewed by Antti Koivisto.
1685
1686         No change in functionality.
1687
1688         * page/FrameView.cpp:
1689         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
1690         (WebCore::FrameView::layout):
1691         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
1692         * page/FrameView.h:
1693
1694 2017-10-18  Antti Koivisto  <antti@apple.com>
1695
1696         Resolve ::before and ::after pseudo elements during style resolution
1697         https://bugs.webkit.org/show_bug.cgi?id=178339
1698
1699         Reviewed by Ryosuke Niwa.
1700
1701         They are currently resolved during render tree building which creates problems with display:contents and animations.
1702
1703         * dom/PseudoElement.cpp:
1704         (WebCore::PseudoElement::PseudoElement):
1705
1706             Call InspectorInstrumentation from constructor.
1707
1708         * style/RenderTreeUpdater.cpp:
1709         (WebCore::RenderTreeUpdater::Parent::Parent):
1710         (WebCore::RenderTreeUpdater::updateRenderTree):
1711         (WebCore::RenderTreeUpdater::pushParent):
1712
1713             Push the full update to the parent stack.
1714
1715         (WebCore::RenderTreeUpdater::popParent):
1716         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
1717         (WebCore::RenderTreeUpdater::updateAfterDescendants):
1718         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
1719         * style/RenderTreeUpdater.h:
1720         * style/RenderTreeUpdaterGeneratedContent.cpp:
1721         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1722
1723             No need to resolve pseudo style, we have it already.
1724
1725         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
1726         (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
1727         (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
1728         * style/RenderTreeUpdaterGeneratedContent.h:
1729         * style/StyleTreeResolver.cpp:
1730         (WebCore::Style::TreeResolver::resolveElement):
1731         (WebCore::Style::TreeResolver::resolvePseudoStyle):
1732
1733             Resolve pseudos.
1734
1735         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1736
1737             Make a private member function.
1738
1739         (WebCore::Style::TreeResolver::resolveComposedTree):
1740         * style/StyleTreeResolver.h:
1741         * style/StyleUpdate.cpp:
1742         (WebCore::Style::Update::elementUpdates const):
1743         (WebCore::Style::Update::elementUpdates):
1744
1745             Bundle the style update for an element and the associated before/after pseudos.
1746
1747         (WebCore::Style::Update::elementStyle const):
1748         (WebCore::Style::Update::elementStyle):
1749         (WebCore::Style::Update::addElement):
1750         (WebCore::Style::Update::elementUpdate const): Deleted.
1751         (WebCore::Style::Update::elementUpdate): Deleted.
1752         * style/StyleUpdate.h:
1753
1754 2017-10-18  Ms2ger  <Ms2ger@igalia.com>
1755
1756         Update the signatures of texSubImage3D.
1757         https://bugs.webkit.org/show_bug.cgi?id=178435
1758
1759         Reviewed by Sam Weinig.
1760
1761         Update the signatures of texSubImage3D.
1762
1763         No new tests: not much point in adding tests now; this method doesn't
1764         do anything anyway.
1765
1766         * html/canvas/WebGL2RenderingContext.cpp:
1767         (WebCore::WebGL2RenderingContext::texSubImage3D):
1768         * html/canvas/WebGL2RenderingContext.h:
1769         * html/canvas/WebGL2RenderingContext.idl:
1770
1771 2017-10-18  Fujii Hironori  <Hironori.Fujii@sony.com>
1772
1773         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
1774         https://bugs.webkit.org/show_bug.cgi?id=175106
1775
1776         Reviewed by Yusuke Suzuki.
1777
1778         No new tests because there is no behavior change.
1779
1780         * css/CSSFontFaceSet.cpp:
1781         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Call get() method of LazyNeverDestroyed.
1782         * dom/make_names.pl: Use LazyNeverDestroyed for font names.
1783
1784 2017-10-18  Zan Dobersek  <zdobersek@igalia.com>
1785
1786         [MSE] Move SourceBuffer's pending append data into the platform implementations
1787         https://bugs.webkit.org/show_bug.cgi?id=178003
1788
1789         Reviewed by Jer Noble.
1790
1791         In SourceBuffer::appendBufferTimerFired(), we can use move semantics to
1792         pass the pending append data into the platform layer, where it can then
1793         be used more efficiently.
1794
1795         Resources in the m_pendingAppendData member are moved into the append()
1796         call on the SourceBufferPrivate object. The m_pendingAppendData is still
1797         cleared out manually in case the underlying implementation doesn't clear
1798         it out through a move operation. The SourceBufferPrivate interface is
1799         updated to accept a Vector rvalue reference as the only parameter of the
1800         append() method.
1801
1802         For the GStreamer implementation, signature of the append() method in
1803         MediaSourceClientGStreamerMSE class is also updated. The implementation
1804         now moves the Vector resources over to a on-heap Vector object that is
1805         then wrapped into a GstBuffer object by using the
1806         gst_buffer_new_wrapped_full() API and specifying the custom deleter.
1807
1808         The AVFoundation implementation of SourceBufferPrivate is only updated
1809         to reflect the changes in the interface. The Vector data that is passed
1810         in is still copied into the NSData allocation.
1811
1812         MockSourceBufferPrivate is also updated, with the append data still
1813         being copied into the m_inputBuffer Vector.
1814
1815         No new tests -- no change in behavior.
1816
1817         * Modules/mediasource/SourceBuffer.cpp:
1818         (WebCore::SourceBuffer::appendBufferTimerFired):
1819         * platform/graphics/SourceBufferPrivate.h:
1820         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1821         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1822         (WebCore::SourceBufferPrivateAVFObjC::append):
1823         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1824         (WebCore::MediaSourceClientGStreamerMSE::append):
1825         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
1826         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
1827         (WebCore::SourceBufferPrivateGStreamer::append):
1828         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
1829         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1830         (WebCore::MockSourceBufferPrivate::append):
1831         * platform/mock/mediasource/MockSourceBufferPrivate.h:
1832
1833 2017-10-17  Zalan Bujtas  <zalan@apple.com>
1834
1835         [FrameView::layout cleanup] Remove redundant body->renderer()->setChildNeedsLayout() call
1836         https://bugs.webkit.org/show_bug.cgi?id=178414
1837         <rdar://problem/35040876>
1838
1839         Reviewed by Simon Fraser.
1840
1841         Since m_size always equals to layoutSize() at this point, we never call setChildNeedsLayout() on the body's renderer.
1842         However a few lines below, when we adjust the frame size and check if oldSize != m_size, we actually
1843         dirty the body's renderer.
1844
1845         Covered by existing tests.
1846
1847         * page/FrameView.cpp:
1848         (WebCore::FrameView::layout):
1849
1850 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
1851
1852         [Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
1853         https://bugs.webkit.org/show_bug.cgi?id=177345
1854         <rdar://problem/32975942>
1855
1856         Reviewed by Jon Lee.
1857
1858         This bug has a fairly insideous cause. In particular, the system font fallback path follows
1859         system conventions, which are not the same as the CSS fallback path. For example, the Chinese
1860         fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
1861         assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
1862         However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
1863         Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
1864         and expected, and we shouldn't synthesize bold in this situation.
1865
1866         Test: fast/text/system-ui-chinese-bold-fallback.html
1867
1868         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
1869         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
1870
1871 2017-10-17  Chelsea Pugh  <cpugh@apple.com>
1872
1873         [iOS] Don't turn fields yellow after filling credentials
1874         https://bugs.webkit.org/show_bug.cgi?id=178411
1875
1876         Reviewed by Wenson Hsieh.
1877
1878         * editing/ios/AutofillElements.cpp:
1879         (WebCore::AutofillElements::autofill): We don't want to turn fields yellow when filling the user name
1880         and password. Remove the code that was causing that to happen.
1881
1882 2017-10-16  Andy Estes  <aestes@apple.com>
1883
1884         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
1885         https://bugs.webkit.org/show_bug.cgi?id=178191
1886         <rdar://problem/34906367>
1887
1888         Reviewed by Tim Horton.
1889
1890         Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
1891
1892         * Modules/applepay/ApplePayError.idl:
1893         * Modules/applepay/ApplePayPaymentContact.h:
1894         * Modules/applepay/ApplePayPaymentContact.idl:
1895         * Modules/applepay/ApplePaySessionPaymentRequest.h:
1896         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1897         (WebCore::subLocality):
1898         (WebCore::setSubLocality):
1899         (WebCore::subAdministrativeArea):
1900         (WebCore::setSubAdministrativeArea):
1901         (WebCore::convert):
1902
1903 2017-10-17  Commit Queue  <commit-queue@webkit.org>
1904
1905         Unreviewed, rolling out r223500.
1906         https://bugs.webkit.org/show_bug.cgi?id=178408
1907
1908         Introduced a crash in CSSAnimationController::updateAnimations
1909         (Requested by rniwa on #webkit).
1910
1911         Reverted changeset:
1912
1913         "Resolve ::before and ::after pseudo elements during style
1914         resolution"
1915         https://bugs.webkit.org/show_bug.cgi?id=178339
1916         https://trac.webkit.org/changeset/223500
1917
1918 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
1919
1920         Delete button doesn't fully delete certain emoji
1921         https://bugs.webkit.org/show_bug.cgi?id=178096
1922         <rdar://problem/34785106>
1923
1924         Reviewed by Simon Fraser.
1925
1926         System infrastructure for handling emoji changes every year. Instead of having
1927         custom code to specifically walk over codepoints, we should delegate to the
1928         system handling.
1929
1930         Tests: editing/deleting/delete-emoji.html
1931                editing/deleting/delete-emoji-1.html
1932                editing/deleting/delete-emoji-2.html
1933                editing/deleting/delete-emoji-3.html
1934                editing/deleting/delete-emoji-4.html
1935                editing/deleting/delete-emoji-5.html
1936                editing/deleting/delete-emoji-6.html
1937                editing/deleting/delete-emoji-7.html
1938                editing/deleting/delete-emoji-8.html
1939                editing/deleting/delete-emoji-9.html
1940
1941         * rendering/RenderText.cpp:
1942         (WebCore::RenderText::previousOffset const):
1943         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
1944         (WebCore::RenderText::nextOffset const):
1945         (WebCore::isHangulLVT): Deleted.
1946         (WebCore::isMark): Deleted.
1947         (WebCore::isRegionalIndicator): Deleted.
1948         (WebCore::isInArmenianToLimbuRange): Deleted.
1949
1950 2017-10-17  Youenn Fablet  <youenn@apple.com>
1951
1952         Add preliminary support for fetch event
1953         https://bugs.webkit.org/show_bug.cgi?id=178171
1954
1955         Unreviewed.
1956
1957         * workers/service/FetchEvent.cpp:
1958         (WebCore::FetchEvent::promiseIsSettled): build fix by removing unnecessary captured this at the moment.
1959
1960 2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
1961
1962         [CSS Font Loading] Fonts are erroneously invisible when the policy says they should be visible
1963         https://bugs.webkit.org/show_bug.cgi?id=178238
1964
1965         Reviewed by Simon Fraser.
1966
1967         When implementing font-display, I added testing infrastructure (so we don't have to wait for
1968         3 second timeouts to occur). This testing infrastructure covered up a real bug where the wrong
1969         font would be reported to CSSFontAccessor. This patch reverts the erroneous testing
1970         infrastructure and replaces it with a real fix to the problem. The replacement fix is covered
1971         by the same tests that I wrote when implementing the feature.
1972
1973         Covered by existing tests.
1974
1975         * css/CSSFontFace.cpp:
1976         (WebCore::CSSFontFace::pump):
1977         (WebCore::visibility):
1978         (WebCore::CSSFontFace::font):
1979
1980 2017-10-16  Sam Weinig  <sam@webkit.org>
1981
1982         [Settings] Generate Settings.h/cpp
1983         https://bugs.webkit.org/show_bug.cgi?id=178361
1984
1985         Reviewed by Dean Jackson.
1986
1987         This change generates Settings.h and Settings.cpp exactly as they are,
1988         using SettingsMacros.h and everything. In follow up changes, the use of
1989         SettingsMacros.h will be removed.
1990
1991         * CMakeLists.txt:
1992         * DerivedSources.make:
1993         * Scripts/GenerateSettings.py:
1994         * Scripts/GenerateSettings/GenerateSettings.py:
1995         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
1996         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
1997         * WebCore.xcodeproj/project.pbxproj:
1998         * WebCoreMacros.cmake:
1999         * page/Settings.cpp: Removed.
2000         * page/Settings.h: Removed.
2001
2002 2017-10-17  Ms2ger  <Ms2ger@igalia.com>
2003
2004         Create bindings for WebGL2's versions of texSubImage2D.
2005         https://bugs.webkit.org/show_bug.cgi?id=178382
2006
2007         Reviewed by Ryosuke Niwa.
2008
2009         Create bindings for WebGL2's versions of texSubImage2D.
2010
2011         No new tests: not much point in adding tests now; this method doesn't
2012         do anything anyway.
2013
2014         * html/canvas/WebGL2RenderingContext.cpp:
2015         (WebCore::WebGL2RenderingContext::texSubImage2D):
2016         * html/canvas/WebGL2RenderingContext.h:
2017         * html/canvas/WebGL2RenderingContext.idl:
2018         * html/canvas/WebGLRenderingContext.idl:
2019         * html/canvas/WebGLRenderingContextBase.idl:
2020
2021 2017-10-17  Zalan Bujtas  <zalan@apple.com>
2022
2023         [FrameView::layout cleanup] Subtree should read subtreeLayout.
2024         https://bugs.webkit.org/show_bug.cgi?id=178401
2025
2026         Reviewed by Simon Fraser.
2027
2028         Rename some variables to improve readability.
2029
2030         No change in functionality.
2031
2032         * page/FrameView.cpp:
2033         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
2034         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
2035         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
2036         (WebCore::FrameView::reset):
2037         (WebCore::FrameView::willDestroyRenderTree):
2038         (WebCore::FrameView::didDestroyRenderTree):
2039         (WebCore::FrameView::calculateScrollbarModesForLayout):
2040         (WebCore::FrameView::layout):
2041         (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
2042         (WebCore::FrameView::scheduleRelayout):
2043         (WebCore::FrameView::scheduleRelayoutOfSubtree):
2044         (WebCore::FrameView::needsLayout const):
2045         (WebCore::FrameView::autoSizeIfEnabled):
2046         * page/FrameView.h:
2047
2048 2017-10-16  Dean Jackson  <dino@apple.com>
2049
2050         WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
2051         https://bugs.webkit.org/show_bug.cgi?id=178223
2052         <rdar://problem/34597567>
2053
2054         Reviewed by Antoine Quint.
2055
2056         Remove the limit of 4k on the width/height of the renderbuffer.
2057
2058         Test: fast/canvas/webgl/large-drawing-buffer-resize.html
2059
2060         * html/canvas/WebGLRenderingContextBase.cpp:
2061         (WebCore::WebGLRenderingContextBase::reshape):
2062
2063 2017-10-17  John Wilander  <wilander@apple.com>
2064
2065         Add and remove cookie partition accordingly in intermediary redirect requests
2066         https://bugs.webkit.org/show_bug.cgi?id=178369
2067         <rdar://problem/34467603>
2068
2069         Reviewed by Brent Fulgham.
2070
2071         Tests: http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html
2072                http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html
2073
2074         * loader/ResourceLoadObserver.h:
2075             Now exposes notifyObserver() so that it can be triggered
2076             by the TestRunner.
2077             Removed unimplemented ResourceLoadObserver::setShouldThrottleObserverNotifications().
2078
2079 2017-10-17  Jer Noble  <jer.noble@apple.com>
2080
2081         Corrupted image after looping movie-backed <img>.
2082         https://bugs.webkit.org/show_bug.cgi?id=178398
2083
2084         Reviewed by Eric Carlson.
2085
2086         Use the decode-order sample cursor rather than the destination sample cursor when generating
2087         the CMSampleBuffer to decode.
2088
2089         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2090         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
2091
2092 2017-10-17  Ryan Haddad  <ryanhaddad@apple.com>
2093
2094         Unreviewed, rolling out r223459.
2095
2096         This change introduced LayoutTest failures.
2097
2098         Reverted changeset:
2099
2100         "WebGL clamps drawingBufferWidth to 4096 pixels on a 5120
2101         monitor/canvas"
2102         https://bugs.webkit.org/show_bug.cgi?id=178223
2103         https://trac.webkit.org/changeset/223459
2104
2105 2017-10-17  Youenn Fablet  <youenn@apple.com>
2106
2107         Add preliminary support for fetch event
2108         https://bugs.webkit.org/show_bug.cgi?id=178171
2109
2110         Reviewed by Chris Dumez.
2111
2112         Test: http/wpt/service-workers/fetchEvent.https.html
2113               http/wpt/service-workers/extendableEvent.https.html
2114
2115         Adding support for ExtendableEvent and FetchEvent as per 
2116         https://w3c.github.io/ServiceWorker/v1/#extendableevent-interface and
2117         https://w3c.github.io/ServiceWorker/v1/#fetchevent-interface.
2118
2119         Both events need to handle promises as method parameters.
2120         Beefing up DOMPromise for that purpose by exposing status, result and being able to call then.
2121         Adding a new DOMPromise create method that would be the base for https://heycam.github.io/webidl/#es-promise
2122         which might be implemented in the binding generator as a follow-up.
2123
2124         This patch makes them exposed on Window for test purposes until they can be fully tested on ServiceWorker environment.
2125         It is also adding two internal methods for the same reason. These should be removed once events can be tested in its environment.
2126
2127         * CMakeLists.txt:
2128         * DerivedSources.make:
2129         * Modules/fetch/FetchResponse.idl:
2130         * WebCore.xcodeproj/project.pbxproj:
2131         * bindings/js/JSDOMPromise.cpp: Added.
2132         (WebCore::callFunction):
2133         (WebCore::DOMPromise::create):
2134         (WebCore::DOMPromise::whenSettled):
2135         (WebCore::DOMPromise::result const):
2136         (WebCore::DOMPromise::status const):
2137         * bindings/js/JSDOMPromise.h:
2138         * bindings/js/WebCoreBuiltinNames.h:
2139         * dom/EventNames.in:
2140         * testing/Internals.cpp:
2141         (WebCore::Internals::waitFetchEventToFinish):
2142         (WebCore::Internals::waitExtendableEventToFinish):
2143         * testing/Internals.h:
2144         * testing/Internals.idl:
2145         * workers/service/ExtendableEvent.cpp: Added.
2146         (WebCore::ExtendableEvent::ExtendableEvent):
2147         (WebCore::ExtendableEvent::waitUntil):
2148         (WebCore::ExtendableEvent::addPendingPromise):
2149         * workers/service/ExtendableEvent.h:
2150         (WebCore::ExtendableEvent::onFinishedWaiting):
2151         (WebCore::ExtendableEvent::promiseSettled):
2152         * workers/service/ExtendableEvent.idl: Added.
2153         * workers/service/ExtendableEventInit.h: Added.
2154         * workers/service/ExtendableEventInit.idl: Added.
2155         * workers/service/FetchEvent.cpp: Added.
2156         (WebCore::FetchEvent::FetchEvent):
2157         (WebCore::FetchEvent::respondWith):
2158         (WebCore::FetchEvent::onResponse):
2159         (WebCore::FetchEvent::respondWithError):
2160         (WebCore::FetchEvent::processResponse):
2161         (WebCore::FetchEvent::promiseSettled):
2162         * workers/service/FetchEvent.h:
2163         * workers/service/FetchEvent.idl:
2164
2165 2017-10-17  Jer Noble  <jer.noble@apple.com>
2166
2167         Leak of one AVSampleCursor inside ImageDecoderAVFObjC::createFrameImageAtIndex()
2168         https://bugs.webkit.org/show_bug.cgi?id=178397
2169
2170         Reviewed by Eric Carlson.
2171
2172         Explicitly wrap the return value of -copy in a RetainPtr.
2173
2174         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2175         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
2176
2177 2017-10-17  Youenn Fablet  <youenn@apple.com>
2178
2179         Cache API implementation should be able to compute storage size for WebKit client applications.
2180         https://bugs.webkit.org/show_bug.cgi?id=178350
2181
2182         Reviewed by Chris Dumez.
2183
2184         * page/SecurityOriginData.h:
2185         (WebCore::SecurityOriginData::equals const):
2186
2187 2017-10-17  Daniel Bates  <dabates@apple.com>
2188
2189         ASSERTION FAILED: m_truncation != cFullTruncation in InlineTextBox::clampedOffset()
2190         https://bugs.webkit.org/show_bug.cgi?id=178322
2191
2192         Reviewed by Darin Adler.
2193
2194         It is acceptable for InlineTextBox::clampedOffset() to be called for a fully truncated box,
2195         say a person clicks on the ellipsis in a truncated text run. Restore the behavior prior to
2196         r223259 and return the clamped offset.
2197
2198         Test: fast/text/click-ellipsis-assertion-failure.html
2199
2200         * rendering/InlineTextBox.cpp:
2201         (WebCore::InlineTextBox::clampedOffset const):
2202
2203 2017-10-17  Daniel Bates  <dabates@apple.com>
2204
2205         REGRESSION (r222670 and r222732): RTL truncated text may not be drawn
2206         https://bugs.webkit.org/show_bug.cgi?id=178278
2207         <rdar://problem/34982818>
2208
2209         Reviewed by Darin Adler.
2210
2211         Revert r222732 and partially revert r222670. The underlying font rendering machinery implements
2212         text truncation by taking a TextRun object that represents all of the text in the line fragment
2213         and a subrange of the glyphs to render from this fragment. Only the glyphs in this subrange are
2214         drawn and they are drawn in the same position they would be in had the entire line fragment been
2215         drawn. Following r222670 InlineTextBox applies the truncation to the TextRun in InlineTextBox::text().
2216         Together with r222732, which assumed that the number of glyphs to draw is equal to the length of
2217         the TextRun, a truncated text run would be drawn at the wrong position on screen and could give
2218         the impression that the text is not drawn. Instead InlineTextBox::text() should always return
2219         the text for the entire line fragment without considering truncation and when calling TextPainter::paint()
2220         we need to pass the truncated length of the line fragment.
2221
2222         Test: fast/text/ellipsis-text-rtl.html
2223
2224         * rendering/InlineTextBox.cpp:
2225         (WebCore::InlineTextBox::paint): Compute the truncated length (number of glyphs) and pass this
2226         to TextPainter::paint()
2227         (WebCore::InlineTextBox::text const): Do not apply truncation to the text run. Truncation is
2228         implemented by telling the underlying font rendering machinery to paint the subrange of the
2229         text run that represents the non-truncated (visible) text.
2230         * rendering/InlineTextBox.h:
2231         * rendering/SimpleLineLayoutFunctions.cpp:
2232         (WebCore::SimpleLineLayout::paintFlow): Pass the entire length of the text run as we did prior
2233         to r222732.
2234         * rendering/TextPainter.cpp:
2235         (WebCore::TextPainter::paint): Take a length that represents the number of glyphs to draw from
2236         the text run as we use to take prior to r222732.
2237         * rendering/TextPainter.h:
2238
2239 2017-10-17  Zalan Bujtas  <zalan@apple.com>
2240
2241         [FrameView::layout cleanup] Move text auto sizing logic to a separate function
2242         https://bugs.webkit.org/show_bug.cgi?id=178391
2243         <rdar://problem/35030264>
2244
2245         Reviewed by Antti Koivisto.
2246
2247         No change in functionality.
2248
2249         * page/FrameView.cpp:
2250         (WebCore::applyTextSizingIfNeeded):
2251         (WebCore::FrameView::layout):
2252
2253 2017-10-17  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2254
2255         [Curl] Forward declaration "class Cookie;" in CookieJarCurl.h should be "struct Cookie;"
2256         https://bugs.webkit.org/show_bug.cgi?id=178378
2257
2258         Reviewed by Per Arne Vollan.
2259
2260         No new tests. No change in behaviors.
2261
2262         * platform/network/curl/CookieJarCurl.h:
2263
2264 2017-10-17  Zalan Bujtas  <zalan@apple.com>
2265
2266         [FrameView::layout cleanup] Merge InPreLayout blocks
2267         https://bugs.webkit.org/show_bug.cgi?id=178373
2268
2269         Reviewed by Antti Koivisto.
2270
2271         Remove redundant comment and scoping.
2272
2273         No change in functionality.
2274
2275         * page/FrameView.cpp:
2276         (WebCore::FrameView::layout):
2277
2278 2017-10-17  Antti Koivisto  <antti@apple.com>
2279
2280         Text nodes with display:contents parent should render as if they were wrapped in an unstyled <span>
2281         https://bugs.webkit.org/show_bug.cgi?id=178332
2282
2283         Reviewed by Ryosuke Niwa.
2284
2285         According to https://github.com/w3c/csswg-drafts/issues/1118
2286
2287             <div style="display:contents;color:green">text</div>
2288
2289         must result in green text even though div doesn't generate a box.
2290
2291         This patch implements the behavior by wrapping text renderers with display:contents parent element
2292         in an anonymous inline box that receives its style by inheriting from the parent element.
2293
2294         * dom/Document.cpp:
2295         (WebCore::Document::updateTextRenderer):
2296         * rendering/RenderElement.cpp:
2297         (WebCore::RenderElement::computeFirstLineStyle const):
2298
2299             Synthesize the first line style in display:contents parent case.
2300
2301         * rendering/RenderObject.cpp:
2302         (WebCore::findDestroyRootIncludingAnonymous):
2303
2304             Factor into a function.
2305
2306         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2307
2308             Get rid of the anonymous wrapper if it exists.
2309
2310         * rendering/RenderText.cpp:
2311         (WebCore::inlineWrapperForDisplayContentsMap):
2312         (WebCore::RenderText::RenderText):
2313         (WebCore::RenderText::willBeDestroyed):
2314         (WebCore::RenderText::inlineWrapperForDisplayContents):
2315         (WebCore::RenderText::setInlineWrapperForDisplayContents):
2316
2317             Add a weak member (implemented as a rare data map) for holding the wrapper pointer.
2318
2319         (WebCore::RenderText::findByDisplayContentsInlineWrapperCandidate):
2320
2321             Helper to get the text renderer for a wrapper.
2322
2323         * rendering/RenderText.h:
2324         * style/RenderTreeUpdater.cpp:
2325         (WebCore::createTextRenderer):
2326         (WebCore::RenderTreeUpdater::updateTextRenderer):
2327
2328             Create the wrapper if needed.
2329
2330         * style/StyleTreeResolver.cpp:
2331         (WebCore::Style::TreeResolver::resolveComposedTree):
2332
2333             Compute the wrapper style by inheriting from the display:contents parent.
2334
2335         * style/StyleUpdate.h:
2336         (WebCore::Style::TextUpdate::TextUpdate):
2337
2338 2017-10-17  Alicia Boya García  <aboya@igalia.com>
2339
2340         [MSE][GStreamer] Insert parser elements in AppendPipeline when demuxing opus or Vorbis
2341         https://bugs.webkit.org/show_bug.cgi?id=178076
2342
2343         Reviewed by Xabier Rodriguez-Calvar.
2344
2345         YouTube does not include durations in the WebM container for files
2346         containing Opus audio, so we need to read them from the contained
2347         stream. Fortunately, GStreamer has an element to do that: opusparse.
2348
2349         The same thing happens with Vorbis contained in WebM files from the
2350         W3C tests, which should also be fixed by the GStreamer element
2351         vorbisparse.
2352
2353         This patch adds an opusparse or vorbisparse element to the
2354         AppendPipeline at the sinkpad of the demuxer when either is found.
2355
2356         Tests: updated expectations.
2357
2358         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2359         (WebCore::AppendPipeline::appsinkNewSample):
2360         (WebCore::createOptionalParserForFormat):
2361         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2362         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
2363         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2364         * platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp:
2365         (WebCore::GStreamerMediaSample::GStreamerMediaSample):
2366         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2367         (WebCore::PlaybackPipeline::attachTrack):
2368
2369 2017-10-17  Ms2ger  <Ms2ger@igalia.com>
2370
2371         Add WebGL2 texImage3D overloads.
2372         https://bugs.webkit.org/show_bug.cgi?id=178119
2373
2374         Reviewed by Ryosuke Niwa.
2375
2376         No new tests: not much point in adding tests now; this method doesn't
2377         do anything anyway.
2378
2379         * html/canvas/WebGL2RenderingContext.cpp:
2380         (WebCore::WebGL2RenderingContext::texImage3D):
2381         * html/canvas/WebGL2RenderingContext.h:
2382         * html/canvas/WebGL2RenderingContext.idl:
2383
2384 2017-10-17  Antti Koivisto  <antti@apple.com>
2385
2386         Resolve ::before and ::after pseudo elements during style resolution
2387         https://bugs.webkit.org/show_bug.cgi?id=178339
2388
2389         Reviewed by Ryosuke Niwa.
2390
2391         They are currently resolved during render tree building which creates problems with display:contents and animations.
2392
2393         * dom/PseudoElement.cpp:
2394         (WebCore::PseudoElement::PseudoElement):
2395
2396             Call InspectorInstrumentation from constructor.
2397
2398         * style/RenderTreeUpdater.cpp:
2399         (WebCore::RenderTreeUpdater::Parent::Parent):
2400         (WebCore::RenderTreeUpdater::updateRenderTree):
2401         (WebCore::RenderTreeUpdater::pushParent):
2402
2403             Push the full update to the parent stack.
2404
2405         (WebCore::RenderTreeUpdater::popParent):
2406         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
2407         (WebCore::RenderTreeUpdater::updateAfterDescendants):
2408         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
2409         * style/RenderTreeUpdater.h:
2410         * style/RenderTreeUpdaterGeneratedContent.cpp:
2411         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
2412
2413             No need to resolve pseudo style, we have it already.
2414
2415         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
2416         (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
2417         (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
2418         * style/RenderTreeUpdaterGeneratedContent.h:
2419         * style/StyleTreeResolver.cpp:
2420         (WebCore::Style::TreeResolver::resolveElement):
2421         (WebCore::Style::TreeResolver::resolvePseudoStyle):
2422
2423             Resolve pseudos.
2424
2425         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2426
2427             Make a private member function.
2428
2429         (WebCore::Style::TreeResolver::resolveComposedTree):
2430         * style/StyleTreeResolver.h:
2431         * style/StyleUpdate.cpp:
2432         (WebCore::Style::Update::elementUpdates const):
2433         (WebCore::Style::Update::elementUpdates):
2434
2435             Bundle the style update for an element and the associated before/after pseudos.
2436
2437         (WebCore::Style::Update::elementStyle const):
2438         (WebCore::Style::Update::elementStyle):
2439         (WebCore::Style::Update::addElement):
2440         (WebCore::Style::Update::elementUpdate const): Deleted.
2441         (WebCore::Style::Update::elementUpdate): Deleted.
2442         * style/StyleUpdate.h:
2443
2444 2017-10-17  Keith Miller  <keith_miller@apple.com>
2445
2446         Change WebCore sources to work with unified source builds
2447         https://bugs.webkit.org/show_bug.cgi?id=178229
2448
2449         Rubber stamped by Tim Horton.
2450
2451         This patch does the following:
2452
2453         1) Move all “using namespace <name>;” into the WebCore namespace
2454         (They used to go in the global namespace) and change to "using
2455         WebCore::<name>;” in .mm files.
2456
2457         2) Move a bunch of the soft linking library/framework macros out
2458         of the .mm files since those caused name collision problems.
2459
2460         3) Fix minor other naming collisions.
2461
2462         The problem with 1 in a unified source world is generic names
2463         often collide with system header names. For example, WebCore has a
2464         Rect class and that collided with a system header type elsewhere.
2465
2466         This patch shouldn't change behavior so no new tests.
2467
2468         * Configurations/FeatureDefines.xcconfig:
2469         * Modules/cache/CacheStorageConnection.cpp:
2470         * Modules/cache/DOMCache.cpp:
2471         * Modules/cache/DOMCacheStorage.cpp:
2472         * Modules/cache/WorkerCacheStorageConnection.cpp:
2473         * Modules/encryptedmedia/InitDataRegistry.cpp:
2474         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
2475         * Modules/indexeddb/IDBCursor.cpp:
2476         * Modules/indexeddb/IDBFactory.cpp:
2477         * Modules/indexeddb/IDBIndex.cpp:
2478         * Modules/indexeddb/IDBKeyRange.cpp:
2479         * Modules/indexeddb/IDBObjectStore.cpp:
2480         * Modules/indexeddb/IDBRequest.cpp:
2481         * Modules/indexeddb/IDBTransaction.cpp:
2482         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2483         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2484         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2485         * Modules/mediasource/MediaSource.cpp:
2486         (WebCore::MediaSource::setReadyState):
2487         (WebCore::toString): Deleted.
2488         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2489         * Modules/plugins/QuickTimePluginReplacement.mm:
2490         (WebCore::jsValueWithAVMetadataItemInContext):
2491         * Modules/webdriver/NavigatorWebDriver.cpp:
2492         * PlatformAppleWin.cmake:
2493         * PlatformMac.cmake:
2494         * WebCore.xcodeproj/project.pbxproj:
2495         * accessibility/ios/AccessibilityObjectIOS.mm:
2496         (-[WAKView accessibilityIsIgnored]): Deleted.
2497         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
2498         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2499         (-[WAKView accessibilityIsIgnored]):
2500         * accessibility/win/AXObjectCacheWin.cpp:
2501         * bindings/js/CommonVM.cpp:
2502         * bindings/js/DOMWrapperWorld.cpp:
2503         * bindings/js/GCController.cpp:
2504         * bindings/js/IDBBindingUtilities.cpp:
2505         * bindings/js/JSAudioTrackCustom.cpp:
2506         * bindings/js/JSAudioTrackListCustom.cpp:
2507         * bindings/js/JSBlobCustom.cpp:
2508         * bindings/js/JSCSSRuleCustom.cpp:
2509         * bindings/js/JSCSSRuleListCustom.cpp:
2510         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2511         * bindings/js/JSCallbackData.cpp:
2512         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
2513         * bindings/js/JSCustomElementInterface.cpp:
2514         * bindings/js/JSCustomElementRegistryCustom.cpp:
2515         * bindings/js/JSCustomEventCustom.cpp:
2516         * bindings/js/JSDOMBindingSecurity.cpp:
2517         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
2518         * bindings/js/JSDOMConstructorBase.cpp:
2519         * bindings/js/JSDOMConstructorWithDocument.cpp:
2520         * bindings/js/JSDOMConvertDate.cpp:
2521         * bindings/js/JSDOMConvertNumbers.cpp:
2522         * bindings/js/JSDOMConvertStrings.cpp:
2523         * bindings/js/JSDOMConvertWebGL.cpp:
2524         * bindings/js/JSDOMExceptionHandling.cpp:
2525         * bindings/js/JSDOMGlobalObject.cpp:
2526         * bindings/js/JSDOMGlobalObjectTask.cpp:
2527         * bindings/js/JSDOMGuardedObject.cpp:
2528         * bindings/js/JSDOMPromiseDeferred.cpp:
2529         * bindings/js/JSDOMQuadCustom.cpp:
2530         * bindings/js/JSDOMWindowBase.cpp:
2531         * bindings/js/JSDOMWindowCustom.cpp:
2532         * bindings/js/JSDOMWindowProxy.cpp:
2533         * bindings/js/JSDOMWrapper.cpp:
2534         * bindings/js/JSDOMWrapperCache.cpp:
2535         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
2536         * bindings/js/JSDocumentCustom.cpp:
2537         * bindings/js/JSDocumentFragmentCustom.cpp:
2538         * bindings/js/JSElementCustom.cpp:
2539         * bindings/js/JSErrorHandler.cpp:
2540         * bindings/js/JSEventCustom.cpp:
2541         * bindings/js/JSEventListener.cpp:
2542         * bindings/js/JSEventTargetCustom.cpp:
2543         * bindings/js/JSFileSystemEntryCustom.cpp:
2544         * bindings/js/JSHTMLCollectionCustom.cpp:
2545         * bindings/js/JSHTMLDocumentCustom.cpp:
2546         * bindings/js/JSHTMLTemplateElementCustom.cpp:
2547         * bindings/js/JSHistoryCustom.cpp:
2548         * bindings/js/JSIDBCursorCustom.cpp:
2549         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2550         * bindings/js/JSIDBIndexCustom.cpp:
2551         * bindings/js/JSIDBObjectStoreCustom.cpp:
2552         * bindings/js/JSIDBTransactionCustom.cpp:
2553         * bindings/js/JSImageDataCustom.cpp:
2554         * bindings/js/JSLazyEventListener.cpp:
2555         * bindings/js/JSLocationCustom.cpp:
2556         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
2557         * bindings/js/JSMessageEventCustom.cpp:
2558         * bindings/js/JSMessagePortCustom.cpp:
2559         * bindings/js/JSMutationObserverCustom.cpp:
2560         * bindings/js/JSNodeCustom.cpp:
2561         * bindings/js/JSNodeListCustom.cpp:
2562         * bindings/js/JSPerformanceEntryCustom.cpp:
2563         * bindings/js/JSPluginElementFunctions.cpp:
2564         * bindings/js/JSPopStateEventCustom.cpp:
2565         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2566         * bindings/js/JSReadableStreamSourceCustom.cpp:
2567         * bindings/js/JSSVGPathSegCustom.cpp:
2568         * bindings/js/JSTextTrackCueCustom.cpp:
2569         * bindings/js/JSTextTrackCustom.cpp:
2570         * bindings/js/JSTextTrackListCustom.cpp:
2571         * bindings/js/JSTrackCustom.cpp:
2572         * bindings/js/JSVideoTrackCustom.cpp:
2573         * bindings/js/JSVideoTrackListCustom.cpp:
2574         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
2575         * bindings/js/JSWebGLRenderingContextCustom.cpp:
2576         * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
2577         * bindings/js/JSWebGPURenderingContextCustom.cpp:
2578         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2579         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2580         * bindings/js/JSXMLHttpRequestCustom.cpp:
2581         * bindings/js/JSXPathNSResolverCustom.cpp:
2582         * bindings/js/ReadableStream.cpp:
2583         (WebCore::ReadableStream::pipeTo):
2584         (WebCore::ReadableStream::tee):
2585         (WebCore::checkReadableStream):
2586         (WebCore::callFunction): Deleted.
2587         * bindings/js/ScheduledAction.cpp:
2588         * bindings/js/ScriptCachedFrameData.cpp:
2589         * bindings/js/ScriptController.cpp:
2590         * bindings/js/SerializedScriptValue.cpp:
2591         * bindings/js/StructuredClone.cpp:
2592         * bindings/js/WebCoreJSClientData.cpp:
2593         * bindings/js/WorkerScriptController.cpp:
2594         * bindings/scripts/CodeGeneratorJS.pm:
2595         (GenerateEnumerationImplementation):
2596         (GenerateImplementation):
2597         (GenerateDictionaryImplementation):
2598         (GenerateCallbackFunctionImplementation):
2599         (GenerateCallbackInterfaceImplementation):
2600         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2601         * bindings/scripts/test/JS/JSMapLike.cpp:
2602         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2603         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2604         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2605         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2606         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2607         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2608         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
2609         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
2610         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
2611         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2612         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2613         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2614         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2615         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2616         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2617         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2618         * bindings/scripts/test/JS/JSTestException.cpp:
2619         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2620         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2621         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2622         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2623         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2624         * bindings/scripts/test/JS/JSTestInterface.cpp:
2625         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2626         * bindings/scripts/test/JS/JSTestIterable.cpp:
2627         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2628         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2629         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2630         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2631         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2632         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2633         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2634         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2635         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2636         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2637         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2638         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2639         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2640         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2641         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2642         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2643         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2644         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2645         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2646         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2647         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2648         * bindings/scripts/test/JS/JSTestNode.cpp:
2649         * bindings/scripts/test/JS/JSTestObj.cpp:
2650         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2651         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2652         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2653         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2654         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2655         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2656         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2657         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2658         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2659         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2660         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2661         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
2662         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2663         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2664         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2665         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2666         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2667         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2668         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2669         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2670         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
2671         * bridge/IdentifierRep.cpp:
2672         * bridge/NP_jsobject.cpp:
2673         (ObjectMap::get): Deleted.
2674         (ObjectMap::add): Deleted.
2675         (ObjectMap::remove): Deleted.
2676         (objectMap): Deleted.
2677         (ObjectMap::RootObjectInvalidationCallback::operator()): Deleted.
2678         (getListFromVariantArgs): Deleted.
2679         (jsAllocate): Deleted.
2680         (jsDeallocate): Deleted.
2681         (_NPN_CreateNoScriptObject): Deleted.
2682         (_NPN_InvokeDefault): Deleted.
2683         (_NPN_Invoke): Deleted.
2684         (_NPN_Evaluate): Deleted.
2685         (_NPN_GetProperty): Deleted.
2686         (_NPN_SetProperty): Deleted.
2687         (_NPN_RemoveProperty): Deleted.
2688         (_NPN_HasProperty): Deleted.
2689         (_NPN_HasMethod): Deleted.
2690         (_NPN_SetException): Deleted.
2691         (_NPN_Enumerate): Deleted.
2692         (_NPN_Construct): Deleted.
2693         * bridge/NP_jsobject.h:
2694         * contentextensions/ContentExtensionParser.cpp:
2695         * crypto/SubtleCrypto.cpp:
2696         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2697         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2698         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2699         (WebCore::CryptoAlgorithmAES_CBC::importKey):
2700         (WebCore::CryptoAlgorithmAES_CBC::exportKey):
2701         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2702         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2703         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2704         (WebCore::CryptoAlgorithmAES_CFB::importKey):
2705         (WebCore::CryptoAlgorithmAES_CFB::exportKey):
2706         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2707         (WebCore::parametersAreValid):
2708         (WebCore::CryptoAlgorithmAES_CTR::importKey):
2709         (WebCore::CryptoAlgorithmAES_CTR::exportKey):
2710         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2711         (WebCore::tagLengthIsValid):
2712         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2713         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2714         (WebCore::CryptoAlgorithmAES_GCM::importKey):
2715         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
2716         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2717         (WebCore::CryptoAlgorithmAES_KW::importKey):
2718         (WebCore::CryptoAlgorithmAES_KW::exportKey):
2719         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2720         (WebCore::CryptoAlgorithmHMAC::importKey):
2721         (WebCore::CryptoAlgorithmHMAC::exportKey):
2722         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2723         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
2724         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
2725         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2726         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2727         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
2728         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2729         (WebCore::CryptoAlgorithmRSA_PSS::importKey):
2730         (WebCore::CryptoAlgorithmRSA_PSS::exportKey):
2731         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2732         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2733         (WebCore::commonCryptoHMACAlgorithm): Deleted.
2734         * css/CSSBasicShapes.cpp:
2735         * css/CSSPrimitiveValue.cpp:
2736         * css/parser/CSSParser.cpp:
2737         * css/parser/CSSPropertyParser.cpp:
2738         * css/parser/CSSPropertyParserHelpers.cpp:
2739         (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues):
2740         (WebCore::CSSPropertyParserHelpers::consumePosition):
2741         (WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair): Deleted.
2742         * dom/DOMQuad.cpp:
2743         * dom/Document.cpp:
2744         * dom/ErrorEvent.cpp:
2745         * dom/EventListenerMap.cpp:
2746         * dom/EventTarget.cpp:
2747         * dom/PromiseRejectionEvent.cpp:
2748         * dom/RejectedPromiseTracker.cpp:
2749         * dom/ScriptExecutionContext.cpp:
2750         * domjit/JSDocumentDOMJIT.cpp:
2751         * domjit/JSDocumentFragmentDOMJIT.cpp:
2752         * domjit/JSElementDOMJIT.cpp:
2753         * domjit/JSEventDOMJIT.cpp:
2754         * domjit/JSNodeDOMJIT.cpp:
2755         * editing/TextIterator.cpp:
2756         * editing/cocoa/HTMLConverter.mm:
2757         * history/CachedPage.cpp:
2758         * html/HTMLCanvasElement.cpp:
2759         * html/HTMLFontElement.cpp:
2760         * html/HTMLMediaElement.cpp:
2761         * html/HTMLSelectElement.cpp:
2762         * html/TypeAhead.cpp:
2763         * html/parser/HTMLSrcsetParser.cpp:
2764         (WebCore::tokenizeDescriptors):
2765         * html/parser/HTMLTokenizer.cpp:
2766         * html/parser/ParsingUtilities.h:
2767         (WebCore::isNotASCIISpace):
2768         * html/parser/XSSAuditorDelegate.cpp:
2769         * html/track/DataCue.cpp:
2770         * inspector/CommandLineAPIHost.cpp:
2771         * inspector/CommandLineAPIModule.cpp:
2772         * inspector/InspectorApplicationCacheAgent.cpp:
2773         * inspector/InspectorCSSAgent.cpp:
2774         * inspector/InspectorCanvas.cpp:
2775         * inspector/InspectorCanvasAgent.cpp:
2776         * inspector/InspectorClient.cpp:
2777         * inspector/InspectorController.cpp:
2778         * inspector/InspectorDOMAgent.cpp:
2779         * inspector/InspectorDOMDebuggerAgent.cpp:
2780         * inspector/InspectorDOMStorageAgent.cpp:
2781         * inspector/InspectorDatabaseAgent.cpp:
2782         * inspector/InspectorDatabaseResource.cpp:
2783         * inspector/InspectorFrontendClientLocal.cpp:
2784         * inspector/InspectorFrontendHost.cpp:
2785         * inspector/InspectorIndexedDBAgent.cpp:
2786         * inspector/InspectorInstrumentation.cpp:
2787         * inspector/InspectorLayerTreeAgent.cpp:
2788         * inspector/InspectorMemoryAgent.cpp:
2789         * inspector/InspectorNetworkAgent.cpp:
2790         * inspector/InspectorOverlay.cpp:
2791         * inspector/InspectorPageAgent.cpp:
2792         * inspector/InspectorShaderProgram.cpp:
2793         * inspector/InspectorStyleSheet.cpp:
2794         * inspector/InspectorTimelineAgent.cpp:
2795         * inspector/InspectorWorkerAgent.cpp:
2796         * inspector/InstrumentingAgents.cpp:
2797         * inspector/NetworkResourcesData.cpp:
2798         * inspector/PageConsoleAgent.cpp:
2799         * inspector/PageDebuggerAgent.cpp:
2800         * inspector/PageHeapAgent.cpp:
2801         * inspector/PageRuntimeAgent.cpp:
2802         * inspector/PageScriptDebugServer.cpp:
2803         * inspector/TimelineRecordFactory.cpp:
2804         * inspector/WebConsoleAgent.cpp:
2805         * inspector/WebDebuggerAgent.cpp:
2806         * inspector/WebHeapAgent.cpp:
2807         * inspector/WebInjectedScriptHost.cpp:
2808         * inspector/WebInjectedScriptManager.cpp:
2809         * inspector/WorkerConsoleAgent.cpp:
2810         * inspector/WorkerDebuggerAgent.cpp:
2811         * inspector/WorkerInspectorController.cpp:
2812         * inspector/WorkerRuntimeAgent.cpp:
2813         * inspector/WorkerScriptDebugServer.cpp:
2814         * loader/FTPDirectoryParser.cpp:
2815         * loader/TextResourceDecoder.cpp:
2816         * loader/cache/CachedResource.cpp:
2817         * loader/cache/CachedResourceLoader.cpp:
2818         * page/ContextMenuController.cpp:
2819         * page/DOMWindow.cpp:
2820         * page/Navigator.cpp:
2821         * page/PageConsoleClient.cpp:
2822         * page/PageDebuggable.cpp:
2823         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2824         * page/csp/ContentSecurityPolicy.cpp:
2825         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2826         (WebCore::isNotASCIISpace): Deleted.
2827         * page/csp/ContentSecurityPolicyMediaListDirective.cpp:
2828         (WebCore::isNotASCIISpace): Deleted.
2829         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2830         * page/scrolling/ios/ScrollingTreeIOS.h:
2831         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2832         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
2833         (WebCore::operator*): Deleted.
2834         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2835         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
2836         (WebCore::operator*): Deleted.
2837         * platform/Length.cpp:
2838         * platform/URL.cpp:
2839         (WebCore::isSchemeFirstChar):
2840         (WebCore::isSchemeChar):
2841         (WebCore::isBadChar):
2842         (WebCore::isTabNewline):
2843         * platform/audio/WebAudioBufferList.cpp:
2844         (WebCore::WebAudioBufferList::WebAudioBufferList):
2845         * platform/audio/mac/AudioSampleDataSource.mm:
2846         (WebCore::AudioSampleDataSource::pushSamples):
2847         * platform/cf/CoreMediaSoftLink.cpp: Removed.
2848         * platform/cf/CoreMediaSoftLink.h: Removed.
2849         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2850         * platform/graphics/FloatPolygon.cpp:
2851         (WebCore::areCollinearPoints):
2852         (WebCore::FloatPolygon::FloatPolygon):
2853         (WebCore::VertexPair::intersection const):
2854         (WebCore::determinant): Deleted.
2855         * platform/graphics/FontCache.cpp:
2856         * platform/graphics/FontCascade.cpp:
2857         * platform/graphics/GraphicsContext3DPrivate.cpp:
2858         * platform/graphics/WidthIterator.cpp:
2859         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2860         (WebCore::AudioSourceProviderAVFObjC::process):
2861         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2862         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
2863         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
2864         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
2865         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2866         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
2867         (WebCore::assetTrackMeetsHardwareDecodeRequirements):
2868         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
2869         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2870         (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
2871         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
2872         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
2873         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2874         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
2875         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2876         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2877         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2878         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2879         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2880         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
2881         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2882         * platform/graphics/cairo/ImageBufferCairo.cpp:
2883         * platform/graphics/cg/ImageBufferCG.cpp:
2884         (WebCore::ImageBuffer::ImageBuffer):
2885         (WebCore::releaseImageData): Deleted.
2886         * platform/graphics/cg/ImageBufferDataCG.h:
2887         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2888         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
2889         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2890         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2891         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
2892         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2893         * platform/graphics/opentype/OpenTypeMathData.cpp:
2894         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
2895         * platform/graphics/transforms/MatrixTransformOperation.cpp:
2896         (WebCore::MatrixTransformOperation::blend):
2897         (WebCore::createOperation): Deleted.
2898         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2899         * platform/graphics/win/FontWin.cpp:
2900         * platform/graphics/win/GraphicsContextCGWin.cpp:
2901         * platform/graphics/win/GraphicsContextCairoWin.cpp:
2902         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2903         * platform/graphics/win/GraphicsContextWin.cpp:
2904         * platform/graphics/win/UniscribeController.cpp:
2905         * platform/image-decoders/ScalableImageDecoder.cpp:
2906         (): Deleted.
2907         * platform/ios/LegacyTileLayer.mm:
2908         (-[LegacyTileHostLayer renderInContext:]):
2909         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2910         * platform/ios/ScrollAnimatorIOS.mm:
2911         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2912         * platform/ios/WebAVPlayerController.mm:
2913         (-[WebAVPlayerController skipBackwardThirtySeconds:]):
2914         (-[WebAVPlayerController gotoEndOfSeekableRanges:]):
2915         (-[WebAVPlayerController canSeekToBeginning]):
2916         (-[WebAVPlayerController canSeekToEnd]):
2917         (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
2918         (-[WebAVPlayerController updateMinMaxTiming]):
2919         * platform/ios/WebEvent.mm:
2920         * platform/ios/WebItemProviderPasteboard.mm:
2921         * platform/ios/wak/WKContentObservation.cpp:
2922         * platform/mac/KeyEventMac.mm:
2923         * platform/mac/PlaybackSessionInterfaceMac.mm:
2924         (WebCore::timeRangesToArray):
2925         * platform/mac/ScrollAnimatorMac.mm:
2926         (macScrollbarTheme): Deleted.
2927         (scrollerImpForScrollbar): Deleted.
2928         * platform/mac/ScrollbarThemeMac.mm:
2929         (WebCore::scrollbarMap):
2930         * platform/mac/VideoFullscreenInterfaceMac.mm:
2931         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
2932         * platform/mac/WebCoreNSURLExtras.mm:
2933         (WebCore::dataForURLComponentType):
2934         * platform/mac/WebPlaybackControlsManager.mm:
2935         * platform/mac/WebVideoFullscreenController.mm:
2936         (SOFT_LINK_CLASS): Deleted.
2937         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
2938         * platform/mac/WebWindowAnimation.mm:
2939         (WebWindowAnimationDurationFromDuration): Deleted.
2940         (scaledRect): Deleted.
2941         (squaredDistance): Deleted.
2942         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2943         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2944         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2945         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2946         (WebCore::AVVideoCaptureSource::applyFrameRate):
2947         (WebCore::AVVideoCaptureSource::processNewFrame):
2948         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2949         * platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
2950         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
2951         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2952         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2953         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2954         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
2955         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
2956         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
2957         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2958         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2959         * platform/network/HTTPParsers.cpp:
2960         * platform/text/LocaleICU.cpp:
2961         * platform/text/TextCodecLatin1.cpp:
2962         * platform/text/TextCodecUTF8.cpp:
2963         * platform/text/TextEncodingRegistry.cpp:
2964         * platform/text/win/LocaleWin.cpp:
2965         * platform/win/BString.cpp:
2966         * platform/win/KeyEventWin.cpp:
2967         * platform/win/ScrollbarThemeWin.cpp:
2968         * rendering/BidiRun.cpp:
2969         * rendering/FloatingObjects.cpp:
2970         * rendering/RenderBlock.cpp:
2971         * rendering/RenderListMarker.cpp:
2972         * rendering/RenderQuote.cpp:
2973         * rendering/RenderText.cpp:
2974         * rendering/RenderThemeWin.cpp:
2975         * testing/Internals.cpp:
2976         * testing/js/WebCoreTestSupport.cpp:
2977         * workers/WorkerConsoleClient.cpp:
2978         * workers/WorkerGlobalScope.cpp:
2979         * workers/WorkerInspectorProxy.cpp:
2980         * xml/SoftLinkLibxslt.cpp: Added.
2981         * xml/SoftLinkLibxslt.h: Added.
2982         * xml/XPathGrammar.cpp:
2983         * xml/XPathParser.cpp:
2984         * xml/XSLStyleSheetLibxslt.cpp:
2985         * xml/XSLTExtensions.cpp:
2986         * xml/XSLTProcessorLibxslt.cpp:
2987         * xml/XSLTUnicodeSort.cpp:
2988         (xsltTransformErrorTrampoline):
2989         (WebCore::xsltUnicodeSortFunction):
2990         * xml/parser/XMLDocumentParser.cpp:
2991         (WebCore::XMLDocumentParser::updateLeafTextNode):
2992         (WebCore::toString): Deleted.
2993
2994 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2995
2996         Allow reading data and blob URLs via DataTransfer when the pasteboard contains files
2997         https://bugs.webkit.org/show_bug.cgi?id=178377
2998
2999         Reviewed by Ryosuke Niwa.
3000
3001         Adds data and blob URLs, alongside http(s), as URL protocols safe to expose to bindings.
3002
3003         Test: editing/pasteboard/drag-drop-href-as-url.html
3004
3005         * platform/Pasteboard.cpp:
3006         (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):
3007
3008 2017-10-16  Ryosuke Niwa  <rniwa@webkit.org>
3009
3010         Strip away event handlers and JavaScript URLs when copying
3011         https://bugs.webkit.org/show_bug.cgi?id=178375
3012
3013         Reviewed by Wenson Hsieh.
3014
3015         Don't serialize event handlers and URLs with javascript protocol when serializing HTML
3016         since they're not safe to be pasted elsewhere.
3017
3018         Test: editing/pasteboard/copying-html-strips-javascript-url-and-event-handler.html
3019
3020         * dom/Element.cpp:
3021         (WebCore::Element::isEventHandlerAttribute const):
3022         (WebCore::isEventHandlerAttribute): Deleted.
3023         * dom/Element.h:
3024         * editing/markup.cpp:
3025         (WebCore::StyledMarkupAccumulator::appendElement):
3026
3027 2017-10-16  Dean Jackson  <dino@apple.com>
3028
3029         WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
3030         https://bugs.webkit.org/show_bug.cgi?id=178223
3031         <rdar://problem/34597567>
3032
3033         Reviewed by Antoine Quint.
3034
3035         Remove the limit of 4k on the width/height of the renderbuffer.
3036
3037         Test: fast/canvas/webgl/large-drawing-buffer-resize.html
3038
3039         * html/canvas/WebGLRenderingContextBase.cpp:
3040         (WebCore::WebGLRenderingContextBase::reshape):
3041
3042 2017-10-16  Ryosuke Niwa  <rniwa@webkit.org>
3043
3044         Assert that Node::insertedInto doesn't fire an event
3045         https://bugs.webkit.org/show_bug.cgi?id=178376
3046         <rdar://problem/35022857>
3047
3048         Reviewed by Daniel Bates.
3049
3050         Fixed the assertion in notifyChildNodeInserted since this function MUST NOT dispatch an event,
3051         and moved a bunch of event-dispatching code from Node::insertedInto into Node::finishedInsertingSubtree.
3052
3053         No new tests since the existing tests cover the behavioral change.
3054
3055         * dom/ContainerNodeAlgorithms.cpp:
3056         (WebCore::notifyChildNodeInserted): Fixed the assertion.
3057         * dom/ProcessingInstruction.cpp:
3058         (WebCore::ProcessingInstruction::insertedInto):
3059         (WebCore::ProcessingInstruction::finishedInsertingSubtree): Extracted from insertedInto since
3060         checkStyleSheet can dispatch an event.
3061         * dom/ProcessingInstruction.h:
3062         * html/HTMLBodyElement.cpp:
3063         (WebCore::HTMLBodyElement::insertedInto):
3064         (WebCore::HTMLBodyElement::finishedInsertingSubtree): Extracted from insertedInto since
3065         setIntegralAttribute could dispatch DOMAttrModified synchronously.
3066         * html/HTMLBodyElement.h:
3067
3068 2017-10-16  Chris Dumez  <cdumez@apple.com>
3069
3070         ServiceWorkerRegistration should subclass RefCounted<>
3071         https://bugs.webkit.org/show_bug.cgi?id=178374
3072
3073         Reviewed by Ryosuke Niwa.
3074
3075         ServiceWorkerRegistration should subclass RefCounted<> or we end up with an infinite recursion
3076         when constructing such object. This is because ServiceWorkerRegistration subclasses
3077         EventTargetWithInlineData which implements ref() / deref() by calling refEventTarget() /
3078         derefEventTarget(). refEventTarget() / derefEventTarget() are implemented in
3079         ServiceWorkerRegistration so that they call ref() / deref() (which ends up being EventTarget's
3080         methods).
3081
3082         * workers/service/ServiceWorkerRegistration.h:
3083
3084 2017-10-16  Jer Noble  <jer.noble@apple.com>
3085
3086         ImageDecoderAVFObjC fails to create more CMSampleBuffers after creating about 32MB worth.
3087         https://bugs.webkit.org/show_bug.cgi?id=178360
3088
3089         Reviewed by Eric Carlson.
3090
3091         AVSampleBufferGenerator has a constrained memory pool of about 32MB in size. Once
3092         CMSampleBuffers representing about 32MB of memory are allocated, no more can be created
3093         until previously created ones are released. So rather than (only) creating the sample
3094         buffers up front in readSampleMetadata(), also create them dynamically, if missing, in
3095         createFrameImageAtIndex(...) and release them in storeSampleBuffer(...) after they have been
3096         decoded.
3097
3098         Drive-by fix: the expected content length was never actually set by the owner of ImageDecoderAVFObjC.
3099         Now that the expected content length is available, we don't have to wait until the data is complete
3100         to respond to requests.
3101
3102         * platform/graphics/ImageSource.cpp:
3103         (WebCore::ImageSource::ensureDecoderAvailable):
3104         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
3105         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3106         (SOFT_LINK_POINTER_OPTIONAL):
3107         (-[WebCoreSharedBufferResourceLoaderDelegate canFulfillRequest:]):
3108         (-[WebCoreSharedBufferResourceLoaderDelegate fulfillRequest:]):
3109         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
3110         (WebCore::imageDecoderAssetOptions):
3111         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
3112         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
3113         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
3114         (WebCore::ImageDecoderAVFObjC::setExpectedContentSize):
3115
3116 2017-10-12  Matt Rajca  <mrajca@apple.com>
3117
3118         Add API support for quirk that lets an arbitrary click allow auto-play.
3119         https://bugs.webkit.org/show_bug.cgi?id=178227
3120
3121         Reviewed by Alex Christensen.
3122
3123         Added API test.
3124         
3125         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
3126         an arbitrary click allow auto-play via website policies.
3127
3128         * html/MediaElementSession.cpp:
3129         (WebCore::needsArbitraryUserGestureAutoplayQuirk):
3130         * loader/DocumentLoader.h:
3131
3132 2017-10-16  Chris Dumez  <cdumez@apple.com>
3133
3134         DOMQuad.p1 / p2 / p3 / p4 should behave as [SameObject]
3135         https://bugs.webkit.org/show_bug.cgi?id=178366
3136
3137         Reviewed by Youenn Fablet.
3138
3139         DOMQuad.p1 / p2 / p3 / p4 should behave as [SameObject]. We attempted to do so using JSDOMQuad::visitAdditionalChildren()
3140         but the code did not work because we failed to generate a "isReachableFromOpaqueRoots()" function for JSDOMPoint.
3141
3142         Test: fast/css/DOMQuad-points-SameObject.html
3143
3144         * dom/DOMPoint.idl:
3145
3146 2017-10-16  Andy Estes  <aestes@apple.com>
3147
3148         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
3149         https://bugs.webkit.org/show_bug.cgi?id=178191
3150         <rdar://problem/34906367>
3151
3152         Reviewed by Tim Horton.
3153
3154         Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
3155
3156         * Modules/applepay/ApplePayError.idl:
3157         * Modules/applepay/ApplePayPaymentContact.h:
3158         * Modules/applepay/ApplePayPaymentContact.idl:
3159         * Modules/applepay/ApplePaySessionPaymentRequest.h:
3160         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3161         (WebCore::subLocality):
3162         (WebCore::setSubLocality):
3163         (WebCore::subAdministrativeArea):
3164         (WebCore::setSubAdministrativeArea):
3165         (WebCore::convert):
3166
3167 2017-10-16  Alex Christensen  <achristensen@webkit.org>
3168
3169         Allow modern decoding of URLs
3170         https://bugs.webkit.org/show_bug.cgi?id=178265
3171
3172         Reviewed by Chris Dumez.
3173
3174         * platform/URL.h:
3175         (WebCore::URL::decode):
3176
3177 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
3178
3179         Unreviewed, rolling out r223425.
3180
3181         This change broke internal builds.
3182
3183         Reverted changeset:
3184
3185         "Remove unnecessary include from Document.h"
3186         https://bugs.webkit.org/show_bug.cgi?id=178247
3187         https://trac.webkit.org/changeset/223425
3188
3189 2017-10-16  Maureen Daum  <mdaum@apple.com>
3190
3191         If an origin doesn't have databases in the Databases table we should still remove its information from disk in DatabaseTracker::deleteOrigin()
3192         https://bugs.webkit.org/show_bug.cgi?id=178281
3193         <rdar://problem/34576132>
3194
3195         Reviewed by Brent Fulgham.
3196
3197         New test:
3198         DatabaseTracker.DeleteOriginWithMissingEntryInDatabasesTable
3199
3200         * Modules/webdatabase/DatabaseTracker.cpp:
3201         (WebCore::DatabaseTracker::deleteOrigin):
3202         If databaseNames is empty, don't bail early. Instead, delete everything in the directory
3203         containing the databases for this origin. This condition indicates that we previously
3204         tried to remove the origin but didn't get all of the way through the deletion process.
3205         Because we have lost track of the databases for this origin, we can assume that no
3206         other process is accessing them. This means it should be safe to delete them outright.
3207
3208 2017-10-16  Youenn Fablet  <youenn@apple.com>
3209
3210         [FETCH] Remove Request.type getter
3211         https://bugs.webkit.org/show_bug.cgi?id=177798
3212
3213         Reviewed by Chris Dumez.
3214
3215         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-type-attribute-historical.html
3216                imported/w3c/web-platform-tests/fetch/api/request/url-encoding.html
3217
3218         Removing FetchRequest type getter.
3219         Merging Type and Destination as per https://fetch.spec.whatwg.org/#concept-request-destination.
3220         Setting destination of request within CachedResourceLoader as this will be useful to Service Workers.
3221
3222         * Modules/fetch/FetchRequest.h:
3223         * Modules/fetch/FetchRequest.idl:
3224         * loader/FetchOptions.h:
3225         (WebCore::FetchOptions::isolatedCopy const):
3226         (WebCore::FetchOptions::FetchOptions):
3227         (WebCore::FetchOptions::encode const):
3228         (WebCore::FetchOptions::decode):
3229         * loader/ThreadableLoader.cpp:
3230         (WebCore::ThreadableLoaderOptions::isolatedCopy const):
3231         * loader/cache/CachedResourceLoader.cpp:
3232         (WebCore::CachedResourceLoader::requestImage):
3233         (WebCore::CachedResourceLoader::requestFont):
3234         (WebCore::CachedResourceLoader::requestTextTrack):
3235         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
3236         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3237         (WebCore::CachedResourceLoader::requestScript):
3238         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
3239         (WebCore::CachedResourceLoader::requestMedia):
3240         (WebCore::CachedResourceLoader::requestIcon):
3241         (WebCore::CachedResourceLoader::requestRawResource):
3242         (WebCore::CachedResourceLoader::requestBeaconResource):
3243         (WebCore::CachedResourceLoader::requestMainResource):
3244         * loader/cache/CachedResourceRequest.cpp:
3245         (WebCore::CachedResourceRequest::setDestinationIfNotSet):
3246         * loader/cache/CachedResourceRequest.h:
3247
3248 2017-10-15  Ryosuke Niwa  <rniwa@webkit.org>
3249
3250         Cannot access images included in the content pasted from Microsoft Word
3251         https://bugs.webkit.org/show_bug.cgi?id=124391
3252         <rdar://problem/26862741>
3253
3254         Reviewed by Antti Koivisto.
3255
3256         The bug is caused by the fact Microsoft Word generates HTML content which references an image using file URL.
3257         Because the websites don't have access to arbtirary file URLs, this prevents editors such as TinyMCE to save
3258         those images.
3259
3260         This patch fixes the problem by converting file URLs for images and all other subresources in the web archive
3261         generated by Microsoft Word by blob URLs like r222839 for RTF/RTFD and r222119 for images.
3262
3263         To avoid revealing privacy sensitive information such as the absolute local file path to the user's home directory
3264         Microsoft Word and other applications in the system includes in the web archive placed in the system pasteboard,
3265         this patch also introduces the mechanism to sanitize when the HTML content is read by DataTransfer's getData.
3266
3267         This patch also introduces the sanitization for when writing HTML into the pasteboard since other applications
3268         in the syste which is capable to processing web archives are not necessarily equipped to pretect itself and the
3269         rest of the system from potentially dangerous JavaScript included in the web archive placed in the system pasteboard.
3270
3271         Finally, this patch expands the list of clipboard types that are exposed as "text/html" to the Web platform by
3272         adding the capability to convert RTF, RTFD, and web archive into HTML markup by introducing WebContentMarkupReader,
3273         a new subclass of PasteboardWebContentReader which creates a HTML markup instead of a document fragment. Most of
3274         the sanitization process happens in this new class, and will be expanded to WebContentReader to make pasting safer.
3275
3276         Tests: editing/pasteboard/data-transfer-get-data-on-pasting-html-uses-blob-url.html
3277                editing/pasteboard/data-transfer-set-data-sanitizes-html-when-copying-in-null-origin.html
3278                editing/pasteboard/data-transfer-set-data-sanitizes-html-when-copying.html
3279                editing/pasteboard/data-transfer-set-data-sanitlize-html-when-dragging-in-null-origin.html
3280                http/tests/security/clipboard/copy-paste-html-across-origin-sanitizes-html.html
3281                CopyHTML.Sanitizes
3282                DataInteractionTests.DataTransferSanitizeHTML
3283                PasteRTF.ExposesHTMLTypeInDataTransfer
3284                PasteRTFD.ExposesHTMLTypeInDataTransfer
3285                PasteRTFD.ImageElementUsesBlobURLInHTML
3286                PasteWebArchive.ExposesHTMLTypeInDataTransfer
3287
3288         * dom/DataTransfer.cpp:
3289         (WebCore::originIdentifierForDocument): Moved to Document::originIdentifierForPasteboard.
3290         (WebCore::DataTransfer::createForCopyAndPaste):
3291         (WebCore::DataTransfer::getDataForItem const): Use WebContentMarkupReader read HTMl content so that we can read
3292         web arhive, RTF, and RTFD as text/html.
3293         (WebCore::DataTransfer::getData const):
3294         (WebCore::DataTransfer::setData):
3295         (WebCore::DataTransfer::setDataFromItemList): Sanitize the HTML before placing into the system pasteboard.
3296         (WebCore::DataTransfer::createForDragStartEvent):
3297         (WebCore::DataTransfer::createForDrop):
3298         (WebCore::DataTransfer::createForUpdatingDropTarget):
3299         * dom/DataTransfer.h:
3300         * dom/DataTransfer.idl:
3301         * dom/DataTransferItem.cpp:
3302         (WebCore::DataTransferItem::getAsString const):
3303         * dom/Document.cpp:
3304         (WebCore::Document::originIdentifierForPasteboard): Renamed from uniqueIdentifier. Moved the code to use the origin
3305         string and then falling back to the UUID here from originIdentifierForDocument in DataTransfer.cpp.
3306         * dom/Document.h:
3307         * editing/WebContentReader.cpp:
3308         (WebCore::WebContentMarkupReader::shouldSanitize const): Added.
3309         * editing/WebContentReader.h:
3310         (WebCore::WebContentMarkupReader): Added.
3311         (WebCore::WebContentMarkupReader::WebContentMarkupReader):
3312         * editing/cocoa/WebContentReaderCocoa.mm:
3313         (WebCore::createFragmentFromWebArchive): Extracted out of WebContentReader::readWebArchive to share code.
3314         (WebCore::WebContentReader::readWebArchive):
3315         (WebCore::WebContentMarkupReader::readWebArchive): Added. Reads the web archive, replace all subresource URLs by
3316         blob URLs, and re-generate the markup using our copy & paste code. The last step is requied to strip away any privacy
3317         sensitive information as well as potentially dangerous JavaScript code.
3318         (WebCore::stripMicrosoftPrefix): Extracted out of WebContentReader::readHTML to share code.
3319         (WebCore::WebContentReader::readHTML):
3320         (WebCore::WebContentMarkupReader::readHTML): Added. Only sanitize the markup when it comes from a different origin.
3321         (WebCore::WebContentReader::readRTFD): Added a nullity check for frame.document().
3322         (WebCore::WebContentMarkupReader::readRTFD): Added.
3323         (WebCore::WebContentMarkupReader::readRTF): Added.
3324         * editing/markup.h:
3325         * editing/markup.cpp:
3326         (WebCore::createPageForSanitizingWebContent): Added.
3327         (WebCore::sanitizeMarkup): Added. This function "pastes" the markup into a new isolated document then reserializes
3328         using our serialization code for copy. It strips away all invisible information such as comments, and strips away
3329         event handlers and script elements to remove potentially dangerous scripts.
3330         * platform/Pasteboard.h:
3331         * platform/ios/PasteboardIOS.mm:
3332         (WebCore::Pasteboard::readPasteboardWebContentDataForType): Now that this code can be called by DataTransfer, added
3333         the checks for the change count to make sure we stop letting web content read if the pasteboard had been changed by
3334         some other applications. To do this, turned this function into a member of Pasteboard. Also changed the return type
3335         to an enum with tri-state to exist the loop early in the call sites.
3336         (WebCore::Pasteboard::read):
3337         (WebCore::Pasteboard::readRespectingUTIFidelities):
3338         * platform/ios/PlatformPasteboardIOS.mm:
3339         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Treat RTF, RTFD, and web archive as HTML.
3340         * platform/mac/PasteboardMac.mm:
3341         (WebCore::Pasteboard::read): Add the change count checks now that this code can be called by DataTransfer.
3342         * platform/mac/PlatformPasteboardMac.mm:
3343         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Treat RTF, RTFD, and web archive as HTML.
3344
3345 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
3346
3347         Unreviewed attempt to fix the Windows debug build.
3348
3349         * Modules/webdatabase/DatabaseTracker.cpp:
3350         (WebCore::DatabaseTracker::deleteOrigin):
3351
3352 2017-10-16  Chris Dumez  <cdumez@apple.com>
3353
3354         Log using differential privacy domains where the WebContent process crashes
3355         https://bugs.webkit.org/show_bug.cgi?id=178346
3356         <rdar://problem/33293830>
3357
3358         Reviewed by Alex Christensen.
3359
3360         Add new diagnostic logging key for domain causing crashes.
3361
3362         * page/DiagnosticLoggingKeys.cpp:
3363         (WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
3364         * page/DiagnosticLoggingKeys.h:
3365
3366 2017-10-16  Sam Weinig  <sam@webkit.org>
3367
3368         [Settings] Remove all custom code from Settings.h/cpp
3369         https://bugs.webkit.org/show_bug.cgi?id=178330
3370
3371         Reviewed by Simon Fraser.
3372
3373         Removes the two remaining functions out of Settings paving the way
3374         for the file to be generated.
3375         
3376         - pageDestroyed was moved down into SettingsBase.
3377         - effectiveFrameFlattening was moved to FrameView (to reduce the need
3378           for additional includes, the FrameFlattening enum was converted to
3379           an enum class to allow it to be forward declared).
3380           
3381         Also moves default values into SettingsDefaultValues.h
3382
3383         * WebCore.xcodeproj/project.pbxproj:
3384         
3385             Add new files.
3386         
3387         * page/FrameView.cpp:
3388         * page/FrameView.h:
3389
3390             Move effectiveFrameFlattening function here from Settings.
3391
3392         * page/Settings.cpp:
3393         * page/Settings.h:
3394