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