785a6ab902481474cf5b27e2081d0d790950bd42
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-31  Devin Rousso  <webkit@devinrousso.com>
2
3         Web Inspector: replace Canvas stack iteration with createScriptCallStack
4         https://bugs.webkit.org/show_bug.cgi?id=178980
5
6         Reviewed by Joseph Pecoraro.
7
8         No new tests, updated existing tests.
9
10         * inspector/InspectorCanvas.cpp:
11         (WebCore::InspectorCanvas::buildObjectForCanvas):
12         (WebCore::InspectorCanvas::buildAction):
13         (WebCore::iterateCallFrames): Deleted.
14
15 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
16
17         [FreeType] Simple and complex paths are not applied consistently
18         https://bugs.webkit.org/show_bug.cgi?id=177601
19
20         Reviewed by Michael Catanzaro.
21
22         Due to bug #100050, when rendering text, the complex path is forced in case kerning or shaping is enabled and
23         only part of the run is going to be rendered. This happens in the GTK+ port when selecting text (except when
24         selecting the whole run, of course). The text is initially rendered using the simple path as returned by
25         FontCascade::codePath() and then the selection is rendered using the complex path, overriding what
26         FontCascade::codePath() returned in that case. This doesn't happen in mac, because the selection is rendered
27         differently, so FontCascade::drawText always renders the full run (simple path) when selecting text. Selecting
28         text is the most noticeable inconsistency, but it's not the only one. Similar exceptions are applied when
29         calculating the text width, or getting the offset of a given position. The rendered text is the simple one, but
30         the calculations are performed using the complex path, so depending on the kerning and ligatures we might end up
31         with wrong results. If the text has been rendered using the simple path, the selections and all other
32         calculations should be performed with the simple path too. This patch moves the condition to force complex text
33         to FontCascade::codePath(), and only for non Freetype ports. This ensures that all callers to
34         FontCascade::codePath() will get a consistent result.
35
36         * platform/graphics/FontCascade.cpp:
37         (WebCore::FontCascade::drawText const): Use the mode returned by codePath().
38         (WebCore::FontCascade::drawEmphasisMarks const): Ditto.
39         (WebCore::FontCascade::adjustSelectionRectForText const): Use the mode returned by codePath().
40         (WebCore::FontCascade::offsetForPosition const): Ditto.
41         (WebCore::FontCascade::codePath const): Force complex text for partial runs for ports not enabling advance text
42         rendering mode by default.
43         * platform/graphics/FontCascade.h: Add to and from optional parameters to codePath().
44
45 2017-10-30  Chris Dumez  <cdumez@apple.com>
46
47         Fire updatefound event after resolving the registration promise
48         https://bugs.webkit.org/show_bug.cgi?id=178985
49
50         Reviewed by Youenn Fablet.
51
52         Fake series of events that are supposed to happen after registering a service worker
53         that notify the page of the service worker's installation and activation.
54
55         Also make sure that registration.installing / waiting / active return proper values.
56         Make sure that serviceWorker.scriptURL returns a proper value.
57
58         This unblocks a lot of web-platform-tests since they were blocked shortly after
59         registration due to missing events or registration.installing being null.
60
61         * dom/ScriptExecutionContext.cpp:
62         (WebCore::ScriptExecutionContext::activeServiceWorker const):
63         (WebCore::ScriptExecutionContext::setActiveServiceWorker):
64         * dom/ScriptExecutionContext.h:
65         * loader/WorkerThreadableLoader.cpp:
66         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
67         * loader/cache/CachedResourceLoader.cpp:
68         (WebCore::CachedResourceLoader::prepareFetch):
69         * workers/WorkerScriptLoader.cpp:
70         (WebCore::WorkerScriptLoader::loadSynchronously):
71         (WebCore::WorkerScriptLoader::loadAsynchronously):
72         * workers/service/ServiceWorker.cpp:
73         (WebCore::ServiceWorker::ServiceWorker):
74         (WebCore::ServiceWorker::setState):
75         * workers/service/ServiceWorker.h:
76         * workers/service/ServiceWorkerContainer.cpp:
77         (WebCore::ServiceWorkerContainer::controller const):
78         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
79         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
80         * workers/service/ServiceWorkerContainer.h:
81         * workers/service/ServiceWorkerRegistration.cpp:
82         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
83         (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
84         (WebCore::ServiceWorkerRegistration::installing):
85         (WebCore::ServiceWorkerRegistration::waiting):
86         (WebCore::ServiceWorkerRegistration::active):
87         * workers/service/ServiceWorkerRegistration.h:
88         * workers/service/ServiceWorkerRegistrationData.cpp:
89         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
90         * workers/service/ServiceWorkerRegistrationData.h:
91         (WebCore::ServiceWorkerRegistrationData::encode const):
92         (WebCore::ServiceWorkerRegistrationData::decode):
93         * workers/service/server/SWClientConnection.cpp:
94         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
95         * workers/service/server/SWServerRegistration.cpp:
96         (WebCore::SWServerRegistration::scriptContextStarted):
97         (WebCore::SWServerRegistration::runRegisterJob):
98         (WebCore::SWServerRegistration::data const):
99         * workers/service/server/SWServerRegistration.h:
100
101 2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>
102
103         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
104         https://bugs.webkit.org/show_bug.cgi?id=175118
105
106         Reviewed by Alex Christensen.
107
108         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
109
110         No new tests since there should be no behavioral change.
111
112         * dom/make_names.pl:
113         (printConstructors):
114         (printNamesHeaderFile):
115         (printNamesCppFile):
116         (printDefinitions):
117         * accessibility/AccessibilityRenderObject.cpp:
118         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
119         * css/StyleResolver.cpp:
120         (WebCore::hasEffectiveDisplayNoneForDisplayContents):
121         * dom/CustomElementReactionQueue.cpp:
122         (WebCore::CustomElementReactionQueue::observesStyleAttribute const):
123         * dom/Document.cpp:
124         (WebCore::Document::validateCustomElementName):
125         * dom/Element.cpp:
126         (WebCore::isStyleAttribute):
127         (WebCore::canAttachAuthorShadowRoot):
128         * dom/ElementData.cpp:
129         (WebCore::ElementData::findLanguageAttribute const):
130         * domjit/JSDocumentDOMJIT.cpp:
131         (WebCore::compileDocumentBodyAttribute):
132         * editing/Editor.cpp:
133         (WebCore::Editor::applyEditingStyleToBodyElement const):
134         * editing/EditorCommand.cpp:
135         (WebCore::valueDefaultParagraphSeparator):
136         * editing/MarkupAccumulator.cpp:
137         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
138         (WebCore::MarkupAccumulator::appendNamespace):
139         (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
140         * editing/ReplaceSelectionCommand.cpp:
141         (WebCore::isProhibitedParagraphChild):
142         * html/HTMLBodyElement.cpp:
143         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
144         * html/HTMLDocument.cpp:
145         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
146         * html/HTMLElement.cpp:
147         (WebCore::HTMLElement::createEventHandlerNameMap):
148         * html/parser/HTMLConstructionSite.cpp:
149         (WebCore::HTMLConstructionSite::findFosterSite):
150         * html/parser/HTMLElementStack.cpp:
151         (WebCore::HTMLElementStack::hasTemplateInHTMLScope const):
152         * html/parser/HTMLPreloadScanner.cpp:
153         (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
154         * html/parser/HTMLTreeBuilder.cpp:
155         (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
156         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
157         (WebCore::HTMLTreeBuilder::processTemplateEndTag):
158         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
159         (WebCore::HTMLTreeBuilder::processStartTag):
160         (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
161         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
162         (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption):
163         (WebCore::HTMLTreeBuilder::processTableEndTagForInTable):
164         (WebCore::HTMLTreeBuilder::processEndTag):
165         (WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
166         (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
167         (WebCore::HTMLTreeBuilder::defaultForBeforeHead):
168         (WebCore::HTMLTreeBuilder::defaultForInHead):
169         (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
170         (WebCore::HTMLTreeBuilder::defaultForAfterHead):
171         * html/parser/TextDocumentParser.cpp:
172         (WebCore::TextDocumentParser::insertFakePreElement):
173         * rendering/svg/SVGPathData.cpp:
174         (WebCore::pathFromGraphicsElement):
175         * rendering/svg/SVGResources.cpp:
176         (WebCore::clipperFilterMaskerTags):
177         (WebCore::markerTags):
178         (WebCore::fillAndStrokeTags):
179         (WebCore::chainableResourceTags):
180         * svg/SVGAnimatedBoolean.h:
181         * svg/SVGAnimatedEnumeration.h:
182         * svg/SVGAnimatedInteger.h:
183         * svg/SVGAnimatedLength.h:
184         * svg/SVGAnimatedLengthList.h:
185         * svg/SVGAnimatedNumber.h:
186         * svg/SVGAnimatedNumberList.h:
187         * svg/SVGAnimatedPreserveAspectRatio.h:
188         * svg/SVGAnimatedRect.h:
189         * svg/SVGAnimatedString.h:
190         * svg/SVGAnimatedTransformList.h:
191         * svg/SVGAnimationElement.cpp:
192         (WebCore::SVGAnimationElement::isSupportedAttribute):
193         * svg/SVGCursorElement.cpp:
194         (WebCore::SVGCursorElement::isSupportedAttribute):
195         * svg/SVGElement.cpp:
196         (WebCore::createAttributeNameToCSSPropertyIDMap):
197         (WebCore::SVGElement::childShouldCreateRenderer const):
198         (WebCore::SVGElement::animatableAttributeForName):
199         * svg/SVGFilterElement.cpp:
200         (WebCore::SVGFilterElement::isSupportedAttribute):
201         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
202         (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute):
203         * svg/SVGForeignObjectElement.cpp:
204         (WebCore::SVGForeignObjectElement::isSupportedAttribute):
205         * svg/SVGGradientElement.cpp:
206         (WebCore::SVGGradientElement::isSupportedAttribute):
207         * svg/SVGImageElement.cpp:
208         (WebCore::SVGImageElement::isSupportedAttribute):
209         * svg/SVGLineElement.cpp:
210         (WebCore::SVGLineElement::isSupportedAttribute):
211         * svg/SVGMarkerElement.cpp:
212         (WebCore::SVGMarkerElement::isSupportedAttribute):
213         * svg/SVGMaskElement.cpp:
214         (WebCore::SVGMaskElement::isSupportedAttribute):
215         * svg/SVGPathElement.cpp:
216         (WebCore::SVGPathElement::dPropertyInfo):
217         (WebCore::SVGPathElement::isSupportedAttribute):
218         * svg/SVGPatternElement.cpp:
219         (WebCore::SVGPatternElement::isSupportedAttribute):
220         * svg/SVGPolyElement.cpp:
221         (WebCore::SVGPolyElement::pointsPropertyInfo):
222         * svg/SVGRadialGradientElement.cpp:
223         (WebCore::SVGRadialGradientElement::isSupportedAttribute):
224         * svg/SVGTextContentElement.cpp:
225         (WebCore::SVGTextContentElement::textLengthPropertyInfo):
226         (WebCore::SVGTextContentElement::isSupportedAttribute):
227         * svg/SVGTextPathElement.cpp:
228         (WebCore::SVGTextPathElement::isSupportedAttribute):
229         * svg/SVGUseElement.cpp:
230         (WebCore::createAllowedElementSet):
231         * xml/NativeXPathNSResolver.cpp:
232         (WebCore::NativeXPathNSResolver::lookupNamespaceURI):
233         * xml/parser/XMLDocumentParser.cpp:
234         (WebCore::XMLDocumentParser::parseDocumentFragment):
235
236 2017-10-30  Jer Noble  <jer.noble@apple.com>
237
238         [WebGL] Optimization to skip painting if texture and source surface hasn't changed isn't working; re-optimize.
239         https://bugs.webkit.org/show_bug.cgi?id=178953
240
241         Reviewed by Dean Jackson.
242
243         The "seed" value of the current bound texture never matches the last saved value in
244         VideoTextureCopierCV::copyImageToPlatformTexture(). The value is modified by the function
245         itself, so a fresh value needs to be re-queried after the image's surface is attached to the
246         texture.
247
248         Once this fix is in, however, the <canvas> being painted will flash when no new image is
249         available. This is because the wrong texture target is being restored by the GC3DStateSaver
250         at the end of copyImageToPlatformTexture(). While we're fixing that, we may as well use the
251         texture state saved by the GraphicsContext3D itself to restore the correct texture unit,
252         texture target, and texture.
253
254         * platform/graphics/GraphicsContext3D.h:
255         (WebCore::GraphicsContext3D::activeTextureUnit const):
256         (WebCore::GraphicsContext3D::currentBoundTexture const):
257         (WebCore::GraphicsContext3D::currentBoundTarget const):
258         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture const):
259         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture const):
260         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTarget const):
261         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget const):
262         (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture): Deleted.
263         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture): Deleted.
264         (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget): Deleted.
265         * platform/graphics/cv/VideoTextureCopierCV.cpp:
266         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
267         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
268         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
269         * platform/graphics/cv/VideoTextureCopierCV.h:
270         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
271         (WebCore::GraphicsContext3D::prepareTexture):
272         (WebCore::GraphicsContext3D::activeTexture):
273         (WebCore::GraphicsContext3D::bindTexture):
274
275 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
276
277         WKBundlePageWillSendSubmitEventCallback is called with incorrect frame parameter
278         https://bugs.webkit.org/show_bug.cgi?id=176719
279
280         Reviewed by Chris Dumez.
281
282         WKBundlePageWillSendSubmitEventCallback is clearly intended to parallel
283         WKBundlePageWillSubmitFormCallback, since almost all the parameters are the same. Now, in
284         WKBundlePageWillSubmitFormCallback, the first WKBundleFrameRef, "frame", is the frame of the
285         form target, and the second WKBundleFrameRef, sourceFrame, is the frame containing the form.
286         That's correct. But in WKBundlePageWillSendSubmitEventCallback, both frame and sourceFrame
287         are always identical. The problem is that the FrameLoaderClient delegate is called on the
288         wrong FrameLoaderClient. It should be called on the FrameLoaderClient of the target frame,
289         but HTMLFormElement calls it on the FrameLoaderClient of the source frame instead.
290
291         Fix this by factoring the target frame computation out of FormSubmission into some helpers.
292
293         * html/HTMLFormElement.cpp:
294         (WebCore::HTMLFormElement::prepareForSubmission):
295         (WebCore::HTMLFormElement::effectiveTarget const):
296         (WebCore::HTMLFormElement::findSubmitButton const):
297         * html/HTMLFormElement.h:
298         * loader/FormSubmission.cpp:
299         (WebCore::FormSubmission::create):
300
301 2017-10-30  Alex Christensen  <achristensen@webkit.org>
302
303         ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
304         https://bugs.webkit.org/show_bug.cgi?id=178861
305
306         Reviewed by Tim Horton.
307
308         This is a dark corner of the URL spec that has wildly different behavior in different browsers.
309         The assertion fired when we have a file URL with a ? or a # after file:// and it was because
310         m_pathAfterLastSlash was still 0. We definitely shouldn't assert. I'm making us consistent with
311         other cases where we have nothing there and add an implied missing slash.
312         
313         Covered by new API tests.
314
315         * platform/URLParser.cpp:
316         (WebCore::URLParser::parse):
317
318 2017-10-27  Megan Gardner  <megan_gardner@apple.com>
319
320         Correctly determine affinity when inserting text via Keyboard Suggestions
321         https://bugs.webkit.org/show_bug.cgi?id=178969
322
323         Reviewed by Ryosuke Niwa.
324
325         There has been talk about renaming these enums, but in the meantime we should at least have a comment 
326         clarifying what they actually mean.
327
328         No new tests only adding a comment, no tests needed.
329
330         * editing/TextAffinity.h:
331
332 2017-10-27  Ryosuke Niwa  <rniwa@webkit.org>
333
334         Crash in addChildNodesToDeletionQueue
335         https://bugs.webkit.org/show_bug.cgi?id=178974
336         <rdar://problem/35234372>
337
338         Reviewed by Brent Fulgham.
339
340         The bug was caused by HTMLConstructionSite::insertTextNode constructing an ill-formed tree
341         when fostering parent under a template element by adjusting HTMLConstructionSiteTask's parent
342         without clearing nextChild. Fixed the crash by simply removing this code since executeTask
343         already takes care of fostering the parent in static inline insert(HTMLConstructionSiteTask&).
344
345         Test: fast/parser/foster-parent-under-template.html
346
347         * html/parser/HTMLConstructionSite.cpp:
348         (WebCore::HTMLConstructionSite::insertTextNode):
349
350 2017-10-30  Commit Queue  <commit-queue@webkit.org>
351
352         Unreviewed, rolling out r224078.
353         https://bugs.webkit.org/show_bug.cgi?id=179026
354
355         MotionMark regression (Requested by shallawa on #webkit).
356
357         Reverted changeset:
358
359         "When navigating back to a page, compositing layers may not
360         use accelerated drawing"
361         https://bugs.webkit.org/show_bug.cgi?id=178749
362         https://trac.webkit.org/changeset/224078
363
364 2017-10-30  Dean Jackson  <dino@apple.com>
365
366         Implement "bitmaprenderer" CanvasRenderingContext
367         https://bugs.webkit.org/show_bug.cgi?id=178992
368         <rdar://problem/34147157>
369
370         Reviewed by Sam Weinig.
371
372         Implement the "bitmaprenderer" context for HTMLCanvasElement.
373         Use as much of the existing 2d context code as possible, which
374         means that we are painting the ImageBitmap into the backing
375         store. This isn't optimal, but it is good enough to get
376         going while we move buffer ownership from the canvas object
377         into the rendering contexts.
378
379         This patch raised a few issues on the HTML specification:
380         https://github.com/whatwg/html/issues/3164
381         https://github.com/whatwg/html/issues/3165
382         https://github.com/whatwg/html/issues/3166
383         https://github.com/whatwg/html/issues/3167
384
385         Update existing Web Platform Test results.
386
387         * html/HTMLCanvasElement.cpp:
388         (WebCore::HTMLCanvasElement::createContext2d): Drive-by comment fix.
389         (WebCore::HTMLCanvasElement::createContextWebGL): Ditto.
390         (WebCore::HTMLCanvasElement::createContextWebGPU): Ditto.
391         (WebCore::HTMLCanvasElement::createContextBitmapRenderer): We now require
392         a layer/backing store for a bitmap context.
393         (WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer const): Add bitmap-renderer
394         to the type of context that uses the canvas's backing store.
395         (WebCore::HTMLCanvasElement::createImageBuffer const): Comment fix.
396         (WebCore::HTMLCanvasElement::setImageBuffer const): Change parameter to a &&.
397         (WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty): New function to set
398         the backing store efficiently, as well as make it look like we need to repaint
399         the entire canvas.
400         (WebCore::HTMLCanvasElement::drawingContext const): The buffer doesn't actually
401         need to provide a GraphicsContext if we're a bitmap renderer.
402         * html/HTMLCanvasElement.h:
403
404         * html/ImageBitmap.cpp:
405         (WebCore::ImageBitmap::transferOwnershipAndClose): New helper to give the ownership
406         of the ImageBuffer away, and look like close() was called.
407         * html/ImageBitmap.h:
408
409         * html/canvas/ImageBitmapRenderingContext.cpp: Implement the algorithm from the HTML
410         specification.
411         (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
412         (WebCore::ImageBitmapRenderingContext::isAccelerated const):
413         (WebCore::ImageBitmapRenderingContext::setOutputBitmap):
414         (WebCore::ImageBitmapRenderingContext::transferFromImageBitmap):
415         * html/canvas/ImageBitmapRenderingContext.h:
416         * html/canvas/ImageBitmapRenderingContext.idl:
417
418 2017-10-30  Simon Fraser  <simon.fraser@apple.com>
419
420         tab-size: 0px asserts
421         https://bugs.webkit.org/show_bug.cgi?id=176198
422
423         Reviewed by Antti Koivisto.
424
425         Don't claim to support tab-size values with units. We don't, and they would become 0, rather
426         than fall back to the default as should happen.
427
428         Enhanced fast/css/tab-size.html to test.
429
430         * css/parser/CSSPropertyParser.cpp:
431         (WebCore::consumeTabSize):
432
433 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
434
435         [WPE] Fix build warnings
436         https://bugs.webkit.org/show_bug.cgi?id=178899
437
438         Reviewed by Carlos Alberto Lopez Perez.
439
440         These are actually mostly cross-platform issues.
441
442         * html/canvas/WebGL2RenderingContext.cpp:
443         (WebCore::arrayBufferViewElementSize):
444         * platform/Cairo.cmake:
445         * platform/Curl.cmake:
446         * platform/FreeType.cmake:
447         * platform/GCrypt.cmake:
448         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
449         (WebCore::TextureMapperShaderProgram::create):
450         * platform/network/soup/SoupNetworkSession.cpp:
451         (WebCore::SoupNetworkSession::SoupNetworkSession):
452
453 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
454
455         [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
456         https://bugs.webkit.org/show_bug.cgi?id=178964
457
458         Reviewed by Carlos Alberto Lopez Perez.
459
460         This also gets rid of the WebCorePlatformWPE build target to simplify the build. It links to
461         all the same libraries as the WebCore target, so it doesn't seem to have any purpose. Bye.
462
463         Some CMake files under platform are not unified, either because there is not much to gain
464         (e.g. ImageDecoders, where everything is in a separate directory), or because it is complex
465         (e.g. GStreamer, where GObject implementations would be tricky to build unified), and
466         because we're limited to using only features declared in WebKitFeatures.cmake inside the
467         unified sources lists, which makes some of the platform files a bit tricky (notably,
468         anything that needs to go into WebCorePlatformGTK for the GTK port). So it's not perfect.
469
470         * PlatformWPE.cmake:
471         * SourcesWPE.txt: Added.
472         * crypto/gcrypt/GCryptUtilities.h:
473         * platform/Cairo.cmake:
474         * platform/GCrypt.cmake:
475         * platform/SourcesCairo.txt: Added.
476         * platform/SourcesGCrypt.txt: Added.
477         * platform/SourcesGLib.txt: Added.
478         * platform/SourcesSoup.txt: Added.
479
480 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
481
482         Remove more unused ENABLE(GAMEPAD_DEPRECATED) code
483         https://bugs.webkit.org/show_bug.cgi?id=178364
484
485         Reviewed by Carlos Alberto Lopez Perez.
486
487         * Modules/gamepad/deprecated/Gamepad.cpp: Removed.
488         * Modules/gamepad/deprecated/Gamepad.h: Removed.
489         * Modules/gamepad/deprecated/Gamepad.idl: Removed.
490         * Modules/gamepad/deprecated/GamepadList.cpp: Removed.
491         * Modules/gamepad/deprecated/GamepadList.h: Removed.
492         * Modules/gamepad/deprecated/GamepadList.idl: Removed.
493         * Modules/gamepad/deprecated/NavigatorGamepad.cpp: Removed.
494         * Modules/gamepad/deprecated/NavigatorGamepad.h: Removed.
495         * Modules/gamepad/deprecated/NavigatorGamepad.idl: Removed.
496
497 2017-10-30  Daniel Bates  <dabates@apple.com>
498
499         Use if conditional function in DerivedSources.make to reduce duplication
500         https://bugs.webkit.org/show_bug.cgi?id=178989
501
502         Reviewed by Darin Adler.
503
504         In DerivedSources.make we currently duplicate most of the Makefile recipe for generating HTML/SVG
505         tags and attributes to support passing the optional command line option --extraDefines when one
506         or more HTML/SVG compile-time features are enabled. Instead we can make use of a Makefile
507         conditional function in the recipe itself to avoid code duplication.
508
509         * DerivedSources.make:
510
511 2017-10-30  Antoine Quint  <graouts@apple.com>
512
513         [Web Animations] Expose the playbackRate property on Animation
514         https://bugs.webkit.org/show_bug.cgi?id=178931
515
516         Reviewed by Sam Weinig.
517
518         Account for the playback rate when computing and setting an animation's
519         current time, ensuring that we adjust the start time to preserve the
520         current time when setting a new playback rate.
521
522         Test: http/wpt/wk-web-animations/timing-model/animation-playback-rate.html
523
524         * animation/WebAnimation.cpp:
525         (WebCore::WebAnimation::WebAnimation):
526         (WebCore::WebAnimation::currentTime const):
527         (WebCore::WebAnimation::setCurrentTime):
528         (WebCore::WebAnimation::setPlaybackRate):
529         * animation/WebAnimation.h:
530         * animation/WebAnimation.idl:
531
532 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
533
534         [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
535         https://bugs.webkit.org/show_bug.cgi?id=168219
536
537         Reviewed by Ryosuke Niwa.
538
539         Make Editor::canUndo and Editor::canRedo const.
540
541         Also, remove unused allowsCopy from HitTestResult.
542
543         * editing/Editor.cpp:
544         (WebCore::Editor::canUndo const):
545         (WebCore::Editor::canRedo const):
546         (WebCore::Editor::canUndo): Deleted.
547         (WebCore::Editor::canRedo): Deleted.
548         * editing/Editor.h:
549         * rendering/HitTestResult.cpp:
550         (WebCore::HitTestResult::allowsCopy const): Deleted.
551         * rendering/HitTestResult.h:
552         * rendering/SelectionRangeData.cpp:
553
554 2017-10-27  Antti Koivisto  <antti@apple.com>
555
556         Destroy all unneeded anonymous wrappers in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers()
557         https://bugs.webkit.org/show_bug.cgi?id=178933
558
559         Reviewed by Zalan Bujtas.
560
561         Currently it just cleans up table related wrappers.
562
563         * rendering/RenderObject.cpp:
564         (WebCore::findDestroyRootIncludingAnonymous):
565
566         Continuations are left as future work.
567
568 2017-10-30  Zalan Bujtas  <zalan@apple.com>
569
570         Remove reference to RenderTreeInternalMutationScope
571         https://bugs.webkit.org/show_bug.cgi?id=178998
572         <rdar://problem/35246464>
573
574         Reviewed by Antti Koivisto.
575
576         We don't have such class anymore.
577
578         No change in functionality.
579
580         * rendering/RenderView.h:
581
582 2017-10-30  Zan Dobersek  <zdobersek@igalia.com>
583
584         [GCrypt] Add support for P-521 EC curves
585         https://bugs.webkit.org/show_bug.cgi?id=175199
586
587         Reviewed by Jiewen Tan.
588
589         Add support for 521-bit elliptic curves in the libgcrypt-based
590         implementation of WebCrypto API.
591
592         In the CryptoAlgorithmECDH implementation, the bit-size of the key is now
593         rounded up to the next byte boundary and passed to the helper
594         gcryptDerive() function. There the size in bytes is used to zero-pad the
595         derived key data. This is done to properly handle derivation results for
596         the P-521 curves, where the leading zero bit could get clipped, resulting
597         in a derived key that is only 65 byes in length when it is expected to be
598         66 bytes. Further cleanups are done in gcryptDerive() to use the mpiData()
599         function where possible.
600
601         In the CryptoAlgorithmECDSA implementation, the bit-size of the key is
602         again rounded up to the nearest byte boundary before being passed to the
603         helper gcryptSign() and gcryptVerify() functions. This again properly
604         enforces the requirement of 66 bytes to handle P-521 elliptic curves.
605
606         In the CryptoKeyEC implementation, NamedCurve::P521 cases in helper
607         functions operating on NamedCurve values are now implemented to return
608         appropriate values. platformSupportedCurve() now returns true for the
609         NamedCurve::P521 value. Zero-padding of the private key data is used
610         wherever it is necessary to avoid clipping any leading zero bit in the
611         P-521 EC key.
612
613         No new tests -- affected tests have their baselines updated.
614
615         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
616         (WebCore::gcryptDerive):
617         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
618         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
619         (WebCore::CryptoAlgorithmECDSA::platformSign):
620         (WebCore::CryptoAlgorithmECDSA::platformVerify):
621         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
622         (WebCore::curveName):
623         (WebCore::curveIdentifier):
624         (WebCore::curveSize):
625         (WebCore::curveUncompressedFieldElementSize):
626         (WebCore::CryptoKeyEC::platformSupportedCurve):
627         (WebCore::curveForIdentifier):
628         (WebCore::CryptoKeyEC::platformImportPkcs8):
629         (WebCore::CryptoKeyEC::platformAddFieldElements const):
630         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
631
632 2017-10-29  Fujii Hironori  <Hironori.Fujii@sony.com>
633
634         Use of uninitialized value $targetIdlFile in hash element at preprocess-idls.pl line 165.
635         https://bugs.webkit.org/show_bug.cgi?id=177743
636
637         Reviewed by Darin Adler.
638
639         GamepadWebVR.idl supplements Gamepad.idl. But, Gamepad.idl is not
640         processed because ENABLE_GAMEPAD is OFF.
641
642         No new tests since there should be no behavioral change.
643
644         * CMakeLists.txt: Include GamepadWebVR.idl only if ENABLE_GAMEPAD.
645         * Sources.txt: Ditto.
646         * bindings/scripts/preprocess-idls.pl: Die if a supplemented IDL file is not found.
647
648 2017-10-29  Sam Weinig  <sam@webkit.org>
649
650         [Conic Gradients] Add support for parsing conic gradients
651         https://bugs.webkit.org/show_bug.cgi?id=178987
652
653         Reviewed by Dean Jackson.
654
655         Adds initial support, disabled by default, for parsing conic gradients as per
656         CSS 4 Images - https://www.w3.org/TR/css-images-4/#conic-gradients.
657
658         Test: fast/gradients/conic-gradient-parsing.html
659
660         * css/CSSGradientValue.cpp:
661         (WebCore::clone):
662         (WebCore::CSSGradientValue::isCacheable const):
663         (WebCore::CSSConicGradientValue::customCSSText const):
664         (WebCore::CSSConicGradientValue::createGradient):
665         (WebCore::CSSConicGradientValue::equals const):
666         * css/CSSGradientValue.h:
667         
668             Add CSSConicGradientValue as a subclass of CSSGradientValue and implement
669             customCSSText() and equals(). Stub out createGradient() as painting is not
670             yet implemented.
671         
672         * css/CSSImageGeneratorValue.cpp:
673         (WebCore::CSSImageGeneratorValue::image):
674         (WebCore::CSSImageGeneratorValue::isFixedSize const):
675         (WebCore::CSSImageGeneratorValue::fixedSize):
676         (WebCore::CSSImageGeneratorValue::isPending const):
677         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
678         (WebCore::CSSImageGeneratorValue::loadSubimages):
679         * css/CSSValue.cpp:
680         (WebCore::CSSValue::equals const):
681         (WebCore::CSSValue::cssText const):
682         (WebCore::CSSValue::destroy):
683         
684             Dispatch to CSSConicGradientValue as needed.
685         
686         * css/CSSValue.h:
687         (WebCore::CSSValue::isImageGeneratorValue const):
688         (WebCore::CSSValue::isGradientValue const):
689         (WebCore::CSSValue::isConicGradientValue const):
690         
691             Add conic gradient predicate support and update isImageGeneratorValue and 
692             isGradientValue to include conic gradient.
693         
694         * css/CSSValueKeywords.in:
695         
696             Add conic-gradient and repeating-conic-gradient.
697         
698         * css/parser/CSSParser.cpp:
699         (WebCore::CSSParserContext::CSSParserContext):
700         (WebCore::operator==):
701         * css/parser/CSSParserMode.h:
702         (WebCore::CSSParserContextHash::hash):
703         
704             Add runtime flags to enable conic gradients.
705         
706         * css/parser/CSSPropertyParserHelpers.cpp:
707         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
708         
709             Helper, similar to consumeLengthOrPercent, for consumeGradientColorStops. 
710             Corresponds to https://drafts.csswg.org/css-values-4/#typedef-angle-percentage
711         
712         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
713         
714             Convert to take CSSGradientValue by reference.
715         
716         (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):
717         
718             Helper, similar to consumeGradientColorStops, but for angular color stops
719             used in conic gradients. Corresponds to https://www.w3.org/TR/css-images-4/#typedef-angular-color-stop-list
720             but does not yet support double position syntax.
721         
722         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
723         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
724         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
725         
726             Pass CSSGradientValue by reference.
727         
728         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
729         
730             Parse conic gradient.
731         
732         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
733         
734             Dispatch to consumeConicGradient for repeating and non-repeating
735             conic gradients.
736         
737         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
738         
739             Put each value on its own line to make it more readable and add CSSValueConicGradient
740             and CSSValueRepeatingConicGradient.
741         
742         * page/Settings.yaml:
743         
744             Add a setting to enable conic gradients. Disabled by default.
745
746         * features.json:
747         
748             Move conic gradients to "In Development".
749
750 2017-10-29  Antoine Quint  <graouts@apple.com>
751
752         [Web Animations] Expose the currentTime property on Animation
753         https://bugs.webkit.org/show_bug.cgi?id=178988
754
755         Unreviewed.
756
757         Style fixes missed in previous patch.
758
759         * animation/WebAnimation.cpp:
760         (WebCore::WebAnimation::setCurrentTime):
761
762 2017-10-29  Antoine Quint  <graouts@apple.com>
763
764         [Web Animations] Expose the currentTime property on Animation
765         https://bugs.webkit.org/show_bug.cgi?id=178988
766
767         Reviewed by Dean Jackson.
768
769         We now expose the currentTime property on Animation objects, our first
770         step in implementing the Web Animations timing model, specifically section
771         3.5.4. "The current time of an animation" and section 3.5.5. "Setting the
772         current time of an animation". Setting the startTime has implications on
773         currentTime and vice-versa.
774
775         Test: webanimations/animation-current-time.html
776
777         * animation/WebAnimation.cpp:
778         (WebCore::WebAnimation::setBindingsStartTime):
779         (WebCore::WebAnimation::startTime const):
780         (WebCore::WebAnimation::setStartTime):
781         (WebCore::WebAnimation::bindingsCurrentTime const):
782         (WebCore::WebAnimation::setBindingsCurrentTime):
783         (WebCore::WebAnimation::currentTime const):
784         (WebCore::WebAnimation::setCurrentTime):
785         * animation/WebAnimation.h:
786         * animation/WebAnimation.idl:
787
788 2017-10-29  Ryosuke Niwa  <rniwa@webkit.org>
789
790         Assert that no script is executed during style recalc
791         https://bugs.webkit.org/show_bug.cgi?id=178845
792         <rdar://problem/35106129>
793
794         Reviewed by Antti Koivisto.
795
796         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
797         to make sure we don't start mutating DOM in the middle of a style update.
798
799         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
800         shadow tree since that happens while updating the style.
801
802         No new tests since there should be no behavioral change.
803
804         * dom/Document.cpp:
805         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
806         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
807         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
808         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
809         scripts which in turn trigger another (recursive) style recalc.
810         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
811         NoEventDispatchAssertion.
812         * dom/Element.cpp:
813         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
814         newly cloned element for SVG use element's shadow tree.
815         (WebCore::Element::cloneElementWithoutChildren): Ditto.
816         * dom/EventDispatcher.cpp:
817         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
818         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
819         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
820         pushing or popoing the stack frame.
821         * svg/SVGUseElement.cpp:
822         (WebCore::SVGUseElement::clearShadowTree):
823         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
824         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
825         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
826         (WebCore::SVGUseElement::cloneTarget const): Ditto.
827         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
828         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
829         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
830
831 2017-10-28  Dean Jackson  <dino@apple.com>
832
833         createImageBitmap with HTMLCanvasElement
834         https://bugs.webkit.org/show_bug.cgi?id=178984
835         <rdar://problem/35238440>
836
837         Reviewed by Sam Weinig.
838
839         Implement createImageBitmap(HTMLCanvasElement).
840
841         While here, explicitly reject the promises for the
842         methods we haven't yet implemented. I was hoping this
843         would avoid a lengthy timeout in one of the imported
844         WPT tests but, alas, it doesn't. However, it's still
845         a good idea.
846
847         Extend internal WPT proposals to cover canvas creation.
848
849         * html/ImageBitmap.cpp:
850         (WebCore::ImageBitmap::createPromise): Get the image from
851         the canvas and draw it into a new ImageBitmap buffer.
852
853 2017-10-28  Myles C. Maxfield  <mmaxfield@apple.com>
854
855         [iOS] Unify Font::platformCharWidthInit() with macOS
856         https://bugs.webkit.org/show_bug.cgi?id=178951
857         <rdar://problem/7848198>
858
859         Reviewed by Zalan Bujtas.
860
861         The only reason these codepaths are different is because historically this codepath
862         didn't work with GS fonts (which we don't use anymore).
863
864         Tests: fast/forms/search-styled.html
865                fast/forms/text-control-intrinsic-widths.html
866                fast/forms/textarea-width.html
867
868         * platform/graphics/cocoa/FontCocoa.mm:
869         (WebCore::Font::platformCharWidthInit):
870
871 2017-10-28  Chris Dumez  <cdumez@apple.com>
872
873         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
874         https://bugs.webkit.org/show_bug.cgi?id=178976
875
876         Reviewed by Sam Weinig.
877
878         Test: http/tests/workers/service/ServiceWorkerGlobalScope-properties.html
879
880         * workers/service/ExtendableEvent.idl:
881         * workers/service/FetchEvent.idl:
882         Drop [Exposed=Worker] as there is already [Exposed=ServiceWorker] and
883         ServiceWorkerGlobalScope inherits from WorkerGlobalScope. This is redundant
884         and we would hit assertions and adding the global constructors at runtime
885         when the feature is enabled, because the property already exists.
886
887 2017-10-28  Zalan Bujtas  <zalan@apple.com>
888
889         [FrameView::layout cleanup] Move core layout logic to a separate class.
890         https://bugs.webkit.org/show_bug.cgi?id=178771
891         <rdar://problem/35166542>
892
893         Reviewed by Simon Fraser.
894
895         Move layout code out from FrameView to LayoutContext.
896
897         LayoutContext holds all the layout related logic (scheduling, needsLayout, handling layout states),
898         while scrolling, view sizing methods stay in FrameView.
899         Having a dedicated LayoutContext allows to structure the code better.   
900
901         Covered by existing tests.
902
903         * Sources.txt:
904         * WebCore.xcodeproj/project.pbxproj:
905         * accessibility/AXObjectCache.cpp:
906         (WebCore::rendererNeedsDeferredUpdate):
907         * accessibility/AccessibilityObject.cpp:
908         (WebCore::AccessibilityObject::updateBackingStore):
909         * accessibility/AccessibilityRenderObject.cpp:
910         (WebCore::AccessibilityRenderObject::textUnderElement const):
911         (WebCore::AccessibilityRenderObject::layoutCount const):
912         * dom/Document.cpp:
913         (WebCore::Document::setVisualUpdatesAllowed):
914         (WebCore::Document::resolveStyle):
915         (WebCore::Document::updateStyleIfNeeded):
916         (WebCore::Document::updateLayout):
917         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
918         (WebCore::Document::implicitClose):
919         (WebCore::Document::isLayoutTimerActive):
920         * dom/Element.cpp:
921         (WebCore::Element::absoluteEventHandlerBounds):
922         * editing/FrameSelection.cpp:
923         (WebCore::FrameSelection::setSelection):
924         * html/HTMLEmbedElement.cpp:
925         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
926         * html/HTMLFormControlElement.cpp:
927         (WebCore::HTMLFormControlElement::didAttachRenderers):
928         * inspector/InspectorOverlay.cpp:
929         (WebCore::InspectorOverlay::update):
930         * loader/FrameLoader.cpp:
931         (WebCore::FrameLoader::stopForUserCancel):
932         * page/Frame.cpp:
933         (WebCore::Frame::setView):
934         (WebCore::Frame::clearTimers):
935         (WebCore::Frame::setPageAndTextZoomFactors):
936         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
937         * page/FrameView.cpp:
938         (WebCore::FrameView::FrameView):
939         (WebCore::FrameView::~FrameView):
940         (WebCore::FrameView::reset):
941         (WebCore::FrameView::resetScrollbars):
942         (WebCore::FrameView::didFirstLayout const):
943         (WebCore::FrameView::willDestroyRenderTree):
944         (WebCore::FrameView::didDestroyRenderTree):
945         (WebCore::FrameView::setContentsSize):
946         (WebCore::FrameView::calculateScrollbarModesForLayout):
947         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
948         (WebCore::FrameView::topContentInsetDidChange):
949         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
950         (WebCore::FrameView::adjustScrollbarsForLayout):
951         (WebCore::FrameView::willDoLayout): This takes care of the view related task right before entering render tree layout.
952         (WebCore::FrameView::didLayout): post layout tasks.
953         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
954         (WebCore::FrameView::updateLayoutViewport):
955         (WebCore::FrameView::maintainScrollPositionAtAnchor):
956         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
957         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
958         (WebCore::FrameView::availableContentSizeChanged):
959         (WebCore::FrameView::updateContentsSize):
960         (WebCore::FrameView::needsLayout const):
961         (WebCore::FrameView::setNeedsLayout):
962         (WebCore::FrameView::scheduleSelectionUpdate):
963         (WebCore::FrameView::updateEmbeddedObjects):
964         (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
965         (WebCore::FrameView::flushPostLayoutTasksQueue):
966         (WebCore::FrameView::performPostLayoutTasks):
967         (WebCore::FrameView::sendResizeEventIfNeeded):
968         (WebCore::FrameView::autoSizeIfEnabled):
969         (WebCore::FrameView::paintControlTints):
970         (WebCore::FrameView::paintContents):
971         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
972         (WebCore::FrameView::enableAutoSizeMode):
973         (WebCore::FrameView::forceLayout):
974         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
975         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
976         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
977         (): Deleted.
978         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker): Deleted.
979         (WebCore::applyTextSizingIfNeeded): Deleted.
980         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
981         (WebCore::FrameView::updateStyleForLayout): Deleted.
982         (WebCore::FrameView::canPerformLayout const): Deleted.
983         (WebCore::FrameView::layout): Deleted.
984         (WebCore::FrameView::runOrSchedulePostLayoutTasks): Deleted.
985         (WebCore::FrameView::convertSubtreeLayoutToFullLayout): Deleted.
986         (WebCore::FrameView::layoutTimerFired): Deleted.
987         (WebCore::FrameView::scheduleRelayout): Deleted.
988         (WebCore::isObjectAncestorContainerOf): Deleted.
989         (WebCore::FrameView::scheduleRelayoutOfSubtree): Deleted.
990         (WebCore::FrameView::layoutPending const): Deleted.
991         (WebCore::FrameView::unscheduleRelayout): Deleted.
992         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted.
993         * page/FrameView.h:
994         * page/LayoutContext.cpp: Added.
995         (WebCore::isObjectAncestorContainerOf):
996         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
997         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
998         (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
999         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
1000         (WebCore::LayoutScope::LayoutScope):
1001         (WebCore::LayoutScope::~LayoutScope):
1002         (WebCore::LayoutContext::LayoutContext):
1003         (WebCore::LayoutContext::layout):
1004         (WebCore::LayoutContext::runOrScheduleAsynchronousTasks):
1005         (WebCore::LayoutContext::runAsynchronousTasks):
1006         (WebCore::LayoutContext::flushAsynchronousTasks):
1007         (WebCore::LayoutContext::reset):
1008         (WebCore::LayoutContext::needsLayout const):
1009         (WebCore::LayoutContext::setNeedsLayout):
1010         (WebCore::LayoutContext::enableSetNeedsLayout):
1011         (WebCore::LayoutContext::disableSetNeedsLayout):
1012         (WebCore::LayoutContext::scheduleLayout):
1013         (WebCore::LayoutContext::unscheduleLayout):
1014         (WebCore::LayoutContext::scheduleSubtreeLayout):
1015         (WebCore::LayoutContext::layoutTimerFired):
1016         (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout):
1017         (WebCore::LayoutContext::setSubtreeLayoutRoot):
1018         (WebCore::LayoutContext::canPerformLayout const):
1019         (WebCore::LayoutContext::applyTextSizingIfNeeded):
1020         (WebCore::LayoutContext::updateStyleForLayout):
1021         (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
1022         (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded):
1023         (WebCore::LayoutContext::frame const):
1024         (WebCore::LayoutContext::view const):
1025         (WebCore::LayoutContext::renderView const):
1026         (WebCore::LayoutContext::document const):
1027         * page/LayoutContext.h: Added.
1028         (WebCore::LayoutContext::startDisallowingLayout):
1029         (WebCore::LayoutContext::endDisallowingLayout):
1030         (WebCore::LayoutContext::layoutPhase const):
1031         (WebCore::LayoutContext::isLayoutNested const):
1032         (WebCore::LayoutContext::layoutCount const):
1033         (WebCore::LayoutContext::isLayoutPending const):
1034         (WebCore::LayoutContext::isInLayout const):
1035         (WebCore::LayoutContext::isInRenderTreeLayout const):
1036         (WebCore::LayoutContext::inPaintableState const):
1037         (WebCore::LayoutContext::subtreeLayoutRoot const):
1038         (WebCore::LayoutContext::clearSubtreeLayoutRoot):
1039         (WebCore::LayoutContext::resetFirstLayoutFlag):
1040         (WebCore::LayoutContext::didFirstLayout const):
1041         (WebCore::LayoutContext::setNeedsFullRepaint):
1042         (WebCore::LayoutContext::needsFullRepaint const):
1043         (WebCore::LayoutContext::layoutDisallowed const):
1044         (WebCore::LayoutContext::isLayoutSchedulingEnabled const):
1045         (WebCore::LayoutContext::inAsynchronousTasks const):
1046         * page/Page.cpp:
1047         (WebCore::Page::setPageScaleFactor):
1048         * rendering/RenderBlock.cpp:
1049         (WebCore::RenderBlock::insertPositionedObject):
1050         * rendering/RenderBox.cpp:
1051         (WebCore::RenderBox::imageChanged):
1052         (WebCore::RenderBox::computeLogicalWidthInFragment const):
1053         * rendering/RenderElement.cpp:
1054         (WebCore::RenderElement::clearSubtreeLayoutRootIfNeeded const):
1055         (WebCore::RenderElement::checkForRepaintDuringLayout const):
1056         * rendering/RenderFrameBase.cpp:
1057         (WebCore::RenderFrameBase::performLayoutWithFlattening):
1058         * rendering/RenderLayer.cpp:
1059         (WebCore::RenderLayer::scrollTo):
1060         * rendering/RenderObject.cpp:
1061         (WebCore::scheduleRelayoutForSubtree):
1062         * rendering/RenderTreeAsText.cpp:
1063         (WebCore::write):
1064         * rendering/RenderVideo.cpp:
1065         (WebCore::RenderVideo::updatePlayer):
1066         * rendering/RenderView.h:
1067         * rendering/RenderWidget.cpp:
1068         (WebCore::RenderWidget::updateWidgetPosition):
1069         * svg/graphics/SVGImage.cpp:
1070         (WebCore::SVGImage::draw):
1071         * testing/Internals.cpp:
1072         (WebCore::Internals::layoutCount const):
1073         
1074 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1075
1076         Cleanup PageDebuggable
1077         https://bugs.webkit.org/show_bug.cgi?id=178972
1078
1079         Reviewed by Sam Weinig.
1080
1081         * page/PageDebuggable.cpp:
1082         (WebCore::PageDebuggable::PageDebuggable):
1083         * page/PageDebuggable.h:
1084
1085 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1086
1087         Extract a WorkerDebuggerProxy interface out of WorkerReportingProxy
1088         https://bugs.webkit.org/show_bug.cgi?id=178975
1089
1090         Reviewed by Sam Weinig.
1091
1092         No new tests, just refactoring.
1093
1094         * workers/WorkerDebuggerProxy.h:
1095         * workers/WorkerReportingProxy.h:
1096         * WebCore.xcodeproj/project.pbxproj:
1097         Extract a method from WorkerReportingProxy to WorkerDebuggerProxy and
1098         rename it to be more general.
1099
1100         * inspector/WorkerToPageFrontendChannel.h:
1101         (WebCore::WorkerToPageFrontendChannel::sendMessageToFrontend):
1102         * workers/DedicatedWorkerThread.cpp:
1103         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1104         * workers/DedicatedWorkerThread.h:
1105         * workers/WorkerMessagingProxy.cpp:
1106         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1107         (WebCore::WorkerMessagingProxy::postMessageToDebugger):
1108         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
1109         * workers/WorkerMessagingProxy.h:
1110         * workers/WorkerThread.cpp:
1111         (WebCore::WorkerThread::WorkerThread):
1112         * workers/WorkerThread.h:
1113         (WebCore::WorkerThread::workerDebuggerProxy const):
1114         * workers/service/context/ServiceWorkerThread.cpp:
1115         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1116         * workers/service/context/ServiceWorkerThread.h:
1117         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1118         (WebCore::ServiceWorkerThreadProxy::create):
1119         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1120         Include a WorkerDebuggerProxy alongside the other proxies.
1121         Use the renamed debugger proxy method.
1122
1123 2017-10-28  Ryosuke Niwa  <rniwa@webkit.org>
1124
1125         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
1126         https://bugs.webkit.org/show_bug.cgi?id=178715
1127         <rdar://problem/35144665>
1128
1129         Reviewed by Brent Fulgham.
1130
1131         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
1132         instead of in the middle of collecting a list of stylesheets.
1133
1134         * dom/Document.cpp:
1135         (WebCore::Document::Document): Initialize the newly added timer.
1136         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
1137         handlers may be expecting to see the document after XSLT had been applied.
1138         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
1139         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
1140         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
1141         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
1142         (WebCore::Document::applyXSLTransform): Deleted.
1143         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
1144         inline XSLT and it happens much earlier than implicitClose.
1145         (WebCore::Document::suspendScheduledTasks): Suspend the XSLT timer.
1146         (WebCore::Document::resumeScheduledTasks): Reschedule the XSLT timer if m_hasPendingXSLTransforms is set.
1147         * dom/Document.h:
1148         * dom/ProcessingInstruction.cpp:
1149         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
1150         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
1151         function can be called from a non-script-resilient call stack.
1152         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
1153         * style/StyleScope.cpp:
1154         (WebCore::Style::Scope::collectXSLTransforms): Added.
1155         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
1156         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
1157         * style/StyleScope.h:
1158         * xml/parser/XMLDocumentParserLibxml2.cpp:
1159         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
1160
1161 2017-10-27  Devin Rousso  <webkit@devinrousso.com>
1162
1163         Web Inspector: Canvas Tab: no way to see backtrace of where a canvas context was created
1164         https://bugs.webkit.org/show_bug.cgi?id=178799
1165         <rdar://problem/35175805>
1166
1167         Reviewed by Brian Burg.
1168
1169         No new tests, updated existing tests.
1170
1171         * inspector/InspectorCanvas.h:
1172         * inspector/InspectorCanvas.cpp:
1173         (iterateCallFrames):
1174         (WebCore::InspectorCanvas::buildObjectForCanvas):
1175         (WebCore::InspectorCanvas::buildAction):
1176
1177         * inspector/InspectorCanvasAgent.cpp:
1178         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1179         If the Canvas agent is enabled, generate a backtrace and send it to the frontend with the canvas.
1180         We do not do this for canvases created before the agent is enabled for performance reasons.
1181
1182 2017-10-27  Keith Miller  <keith_miller@apple.com>
1183
1184         Add unified source list files and build scripts to Xcode project navigator
1185         https://bugs.webkit.org/show_bug.cgi?id=178959
1186
1187         Reviewed by Andy Estes.
1188
1189         * WebCore.xcodeproj/project.pbxproj:
1190
1191 2017-10-27  Daniel Bates  <dabates@apple.com>
1192
1193         Only allow non-mixed content protected subresources to ask for credentials
1194         https://bugs.webkit.org/show_bug.cgi?id=178919
1195         <rdar://problem/35015245>
1196
1197         Reviewed by Alex Christensen.
1198
1199         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
1200         to allow protected mixed-content subresources to ask for credentials.
1201
1202         Tests: http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html
1203                http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html
1204                http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html
1205                http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html
1206                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html
1207                http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html
1208
1209         * loader/ResourceLoader.cpp:
1210         (WebCore::ResourceLoader::ResourceLoader): Initialize m_canAskClientForCredentials based on the
1211         specified resource loader options.
1212         (WebCore::ResourceLoader::init): Update m_canAskClientForCredentials based on the URL of the initial
1213         request.
1214         (WebCore::ResourceLoader::isMixedContent const): Helper function to check if the specified URL
1215         represents a mixed content resource.
1216         (WebCore::ResourceLoader::willSendRequestInternal): If the original request or the redirect request
1217         is mixed content then update state such that we will disallow asking for credentials.
1218         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified to use m_canAskClientForCredentials
1219         when determining whether the request is allowed to ask for credentials.
1220         * loader/ResourceLoader.h:
1221
1222 2017-10-27  Chris Dumez  <cdumez@apple.com>
1223
1224         Unskip more Service Workers tests
1225         https://bugs.webkit.org/show_bug.cgi?id=178944
1226
1227         Reviewed by Sam Weinig.
1228
1229         Drop bad assertion that was causing the Service Worker WebProcess to crash and causing
1230         tests to fail as a result.
1231
1232         * workers/service/ServiceWorkerGlobalScope.cpp:
1233         (WebCore::ServiceWorkerGlobalScope::registration):
1234         * workers/service/ServiceWorkerGlobalScope.h:
1235
1236 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
1237
1238         Unreviewed, rolling out r224011.
1239
1240         xsl LayoutTests hit an assertion added with this change since
1241         r223999 was rolled out.
1242
1243         Reverted changeset:
1244
1245         "Assert that no script is executed during style recalc"
1246         https://bugs.webkit.org/show_bug.cgi?id=178845
1247         https://trac.webkit.org/changeset/224011
1248
1249 2017-10-27  Antoine Quint  <graouts@apple.com>
1250
1251         [Web Animations] Expose the currentTime property on AnimationTimeline
1252         https://bugs.webkit.org/show_bug.cgi?id=178928
1253
1254         Reviewed by Dean Jackson.
1255
1256         We add the currentTime property on AnimationTimeline and add an internals method
1257         to set it in a test which will allow us to validate the timing model state for
1258         a given time.
1259
1260         Test: webanimations/timeline-current-time.html
1261
1262         * animation/AnimationTimeline.cpp:
1263         (WebCore::AnimationTimeline::bindingsCurrentTime const):
1264         (WebCore::AnimationTimeline::setCurrentTime):
1265         * animation/AnimationTimeline.h:
1266         (WebCore::AnimationTimeline::currentTime const):
1267         * animation/AnimationTimeline.idl:
1268         * testing/Internals.cpp:
1269         (WebCore::Internals::setTimelineCurrentTime):
1270         * testing/Internals.h:
1271         * testing/Internals.idl:
1272
1273 2017-10-27  Antoine Quint  <graouts@apple.com>
1274
1275         [Web Animations] Use Seconds vs. MonotonicTime to represent times
1276         https://bugs.webkit.org/show_bug.cgi?id=178950
1277
1278         Reviewed by Dean Jackson.
1279
1280         Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
1281         originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
1282         sense to use Seconds to represent them as opposed to a MonotonicTime.
1283
1284         * animation/WebAnimation.cpp:
1285         (WebCore::WebAnimation::bindingsStartTime const):
1286         (WebCore::WebAnimation::setBindingsStartTime):
1287         * animation/WebAnimation.h:
1288
1289 2017-10-27  Chris Dumez  <cdumez@apple.com>
1290
1291         DOMWindow::dispatchEvent() does not reset the event's dispatch flag
1292         https://bugs.webkit.org/show_bug.cgi?id=178897
1293
1294         Reviewed by Darin Adler.
1295
1296         Make sure we reset the currentTarget, dispatch flag, phase and propagation flags
1297         after dispatching an event on a Window, as per:
1298         - https://dom.spec.whatwg.org/#concept-event-dispatch
1299
1300         This behavior is consistent with Firefox.
1301
1302         Test: fast/events/window-load-initEvent.html
1303
1304         * page/DOMWindow.cpp:
1305         (WebCore::DOMWindow::dispatchEvent):
1306
1307 2017-10-27  Keith Miller  <keith_miller@apple.com>
1308
1309         Move iOS specific sources to unified sources
1310         https://bugs.webkit.org/show_bug.cgi?id=178915
1311
1312         Rubber-stamped by Tim Horton.
1313
1314         * SourcesCocoa.txt:
1315         * SourcesIOS.txt:
1316         * SourcesMac.txt:
1317         * WebCore.xcodeproj/project.pbxproj:
1318
1319 2017-10-27  Eric Carlson  <eric.carlson@apple.com>
1320
1321         NowPlayingInfo should contain a unique identifier
1322         https://bugs.webkit.org/show_bug.cgi?id=178872
1323         <rdar://problem/34924012>
1324
1325         Unreviewed, build fix.
1326
1327         * platform/audio/ios/MediaSessionManagerIOS.mm:
1328         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Call string.impl().hash() instead of
1329         string.existingHash() because the later will assert in a debug build if the hash hasn't
1330         been calculated yet.
1331         * platform/audio/mac/MediaSessionManagerMac.mm:
1332         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto.
1333
1334 2017-10-27  Alex Christensen  <achristensen@webkit.org>
1335
1336         Fix accessibility/mac/aria-label-on-label-element.html after r224074
1337         https://bugs.webkit.org/show_bug.cgi?id=178892
1338
1339         * accessibility/AccessibilityNodeObject.cpp:
1340         (WebCore::AccessibilityNodeObject::titleElementText const):
1341         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
1342         * accessibility/AccessibilityObject.h:
1343         (WebCore::AccessibilityText::AccessibilityText):
1344         Turns out my null checks changed behavior.  This undoes them.
1345
1346 2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>
1347
1348         Unreviewed, rolling out r223999.
1349
1350         Caused xsl LayoutTest flakiness.
1351
1352         Reverted changeset:
1353
1354         "Style::Scope::flushPendingUpdate() can replace the entire
1355         document in XSLTProcessor::createDocumentFromSource"
1356         https://bugs.webkit.org/show_bug.cgi?id=178715
1357         https://trac.webkit.org/changeset/223999
1358
1359 2017-10-27  Chris Dumez  <cdumez@apple.com>
1360
1361         Audit init*Event() method to make sure they reset internal data members
1362         https://bugs.webkit.org/show_bug.cgi?id=178886
1363
1364         Reviewed by Ryosuke Niwa.
1365
1366         Audit init*Event() method to make sure they reset internal data members.
1367
1368         * dom/Event.cpp:
1369         (WebCore::Event::initEvent):
1370         * dom/KeyboardEvent.cpp:
1371         (WebCore::KeyboardEvent::initKeyboardEvent):
1372         * dom/MessageEvent.cpp:
1373         (WebCore::MessageEvent::initMessageEvent):
1374         * dom/MouseEvent.cpp:
1375         (WebCore::MouseEvent::initMouseEvent):
1376         * dom/MouseRelatedEvent.h:
1377         (WebCore::MouseRelatedEvent::setIsSimulated):
1378         * dom/TextEvent.cpp:
1379         (WebCore::TextEvent::initTextEvent):
1380         * dom/WheelEvent.cpp:
1381         (WebCore::WheelEvent::initWheelEvent):
1382
1383 2017-10-27  Chris Dumez  <cdumez@apple.com>
1384
1385         Add initial support for serviceWorkerClient.postMessage()
1386         https://bugs.webkit.org/show_bug.cgi?id=178794
1387
1388         Reviewed by Youenn Fablet.
1389
1390         Add initial support for serviceWorkerClient.postMessage():
1391         - https://w3c.github.io/ServiceWorker/#client-postmessage
1392
1393         It is now possible to do bi-directional communication with a service worker
1394         via postMessage().
1395
1396         No new tests, updated existing test.
1397
1398         * WebCore.xcodeproj/project.pbxproj:
1399         * dom/Document.cpp:
1400         (WebCore::generateDocumentIdentifier):
1401         (WebCore::Document::allDocumentsMap):
1402         (WebCore::Document::allDocuments):
1403         (WebCore::m_identifier):
1404         (WebCore::Document::~Document):
1405         * dom/Document.h:
1406         (WebCore::Document::identifier const):
1407         * dom/ScriptExecutionContext.cpp:
1408         (WebCore::ScriptExecutionContext::serviceWorkerContainer):
1409         * dom/ScriptExecutionContext.h:
1410         * workers/service/ServiceWorker.cpp:
1411         (WebCore::ServiceWorker::postMessage):
1412         * workers/service/ServiceWorkerClient.cpp:
1413         (WebCore::ServiceWorkerClient::ServiceWorkerClient):
1414         (WebCore::ServiceWorkerClient::~ServiceWorkerClient):
1415         (WebCore::ServiceWorkerClient::id const):
1416         (WebCore::ServiceWorkerClient::postMessage):
1417         * workers/service/ServiceWorkerClient.h:
1418         (WebCore::ServiceWorkerClient::create):
1419         * workers/service/ServiceWorkerClient.idl:
1420         * workers/service/ServiceWorkerClientIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
1421         (WebCore::ServiceWorkerClientIdentifier::toString const):
1422         * workers/service/ServiceWorkerRegistration.cpp:
1423         (WebCore::ServiceWorkerRegistration::unregister):
1424         * workers/service/ServiceWorkerWindowClient.cpp:
1425         (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
1426         * workers/service/ServiceWorkerWindowClient.h:
1427         * workers/service/context/SWContextManager.cpp:
1428         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
1429         * workers/service/context/SWContextManager.h:
1430         * workers/service/context/ServiceWorkerThread.cpp:
1431         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
1432         * workers/service/context/ServiceWorkerThread.h:
1433         * workers/service/server/SWClientConnection.cpp:
1434         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
1435         * workers/service/server/SWClientConnection.h:
1436
1437 2017-10-27  Frederic Wang  <fwang@igalia.com>
1438
1439         Use auto for some variables in RenderLayerCompositor/Backing
1440         https://bugs.webkit.org/show_bug.cgi?id=178570
1441
1442         Reviewed by Darin Adler.
1443
1444         No new tests, behavior unchanged.
1445
1446         * rendering/RenderLayerBacking.cpp:
1447         (WebCore::canvasCompositingStrategy):
1448         (WebCore::RenderLayerBacking::RenderLayerBacking):
1449         (WebCore::computePageTiledBackingCoverage):
1450         (WebCore::RenderLayerBacking::layerWillBeDestroyed):
1451         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
1452         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
1453         (WebCore::RenderLayerBacking::updateCompositedBounds):
1454         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
1455         (WebCore::RenderLayerBacking::updateAfterLayout):
1456         (WebCore::RenderLayerBacking::updateConfiguration):
1457         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
1458         (WebCore::RenderLayerBacking::updateGeometry):
1459         (WebCore::RenderLayerBacking::updateInternalHierarchy):
1460         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
1461         (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const):
1462         (WebCore::RenderLayerBacking::compositingOpacity const):
1463         (WebCore::isRestartedPlugin):
1464         (WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
1465         (WebCore::RenderLayerBacking::updateImageContents):
1466         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
1467         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1468         (WebCore::RenderLayerBacking::getCurrentTransform const):
1469         (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
1470         (WebCore::RenderLayerBacking::startAnimation):
1471         (WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const):
1472         * rendering/RenderLayerCompositor.cpp:
1473         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1474         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):
1475         (WebCore::updateScrollingLayerWithClient):
1476         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
1477         (WebCore::RenderLayerCompositor::didPaintBacking):
1478         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
1479         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const):
1480         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1481         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1482         (WebCore::RenderLayerCompositor::logLayerInfo):
1483         (WebCore::checkIfDescendantClippingContextNeedsUpdate):
1484         (WebCore::styleChangeRequiresLayerRebuild):
1485         (WebCore::RenderLayerCompositor::canCompositeClipPath):
1486         (WebCore::rendererForCompositingTests):
1487         (WebCore::RenderLayerCompositor::updateBacking):
1488         (WebCore::RenderLayerCompositor::repaintOnCompositingChange):
1489         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
1490         (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
1491         (WebCore::RenderLayerCompositor::setCompositingParent):
1492         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1493         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling const):
1494         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
1495         (WebCore::RenderLayerCompositor::positionForClipLayer const):
1496         (WebCore::RenderLayerCompositor::frameViewDidLayout):
1497         (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
1498         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
1499         (WebCore::RenderLayerCompositor::frameContentsCompositor):
1500         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1501         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
1502         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
1503         (WebCore::RenderLayerCompositor::setIsInWindow):
1504         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
1505         (WebCore::RenderLayerCompositor::clippedByAncestor const):
1506         (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
1507         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
1508         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
1509         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1510         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1511         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
1512         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
1513         (WebCore::RenderLayerCompositor::requiresScrollLayer const):
1514         (WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const):
1515         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const):
1516         (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
1517         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
1518         (WebCore::RenderLayerCompositor::documentUsesTiledBacking const):
1519         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
1520         (WebCore::RenderLayerCompositor::updateLayerForHeader):
1521         (WebCore::RenderLayerCompositor::updateLayerForFooter):
1522         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1523         (WebCore::RenderLayerCompositor::ensureRootLayer):
1524         (WebCore::RenderLayerCompositor::destroyRootLayer):
1525         (WebCore::RenderLayerCompositor::attachRootLayer):
1526         (WebCore::RenderLayerCompositor::detachRootLayer):
1527         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
1528         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
1529         (WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):
1530         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints const):
1531         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
1532         (WebCore::enclosingScrollingNodeID):
1533         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
1534         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
1535         (WebCore::RenderLayerCompositor::attachScrollingNode):
1536         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1537         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
1538         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1539         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
1540         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
1541         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
1542         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView):
1543
1544 2017-10-27  Alicia Boya García  <aboya@igalia.com>
1545
1546         [GStreamer][MSE] Trim space between codecs
1547         https://bugs.webkit.org/show_bug.cgi?id=178160
1548
1549         Reviewed by Xabier Rodriguez-Calvar.
1550
1551         Modify supportsCodecs() to accept a Vector<String> instead of
1552         receiving a string and parsing itself.
1553
1554         This improves passrate for `mediasource-is-type-supported` as it
1555         ensures that whitespace between codecs is now trimmed and codec
1556         strings such as `video/webm;codecs="opus, vp9"` are matched as a valid
1557         type, as required by the spec.
1558
1559         This patch also renames supportCodecs() to supportAllCodecs() and adds
1560         a new variant, supportCodec(), that checks for support of an
1561         individual codec.
1562
1563         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1564         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1565         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1566         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec):
1567         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs):
1568         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
1569         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1570
1571 2017-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1572
1573         [GTK] Crash in WebCore::SelectionRangeData::apply
1574         https://bugs.webkit.org/show_bug.cgi?id=177808
1575
1576         Reviewed by Carlos Garcia Campos.
1577
1578         The problem appears to be a name collision between WebCore::SelectionData and
1579         WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
1580         Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
1581         Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
1582         poor linker for not being magic?
1583
1584         This fixes crashes in approximately one bajillion tests.
1585
1586         * rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.
1587
1588 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1589
1590         [WinCairo] Fix build after WebCore moves to unified source.
1591         https://bugs.webkit.org/show_bug.cgi?id=178920
1592
1593         Added empty implementations to fix link error.
1594
1595         Reviewed by Ryosuke Niwa.
1596
1597         * platform/network/curl/DNSCurl.cpp:
1598         (WebCore::DNSResolveQueue::updateIsUsingProxy):
1599         (WebCore::DNSResolveQueue::platformResolve):
1600
1601 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
1602
1603         Implement seek tolerance methods in WebAVPlayerController.
1604         https://bugs.webkit.org/show_bug.cgi?id=178838
1605         rdar://problem/33781777
1606
1607         Reviewed by Eric Carlson.
1608
1609         No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.
1610
1611         * html/HTMLMediaElement.cpp:
1612         (WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
1613         * html/HTMLMediaElement.h:
1614         * platform/cocoa/PlaybackSessionModel.h:
1615         * platform/cocoa/PlaybackSessionModelMediaElement.h:
1616         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1617         (WebCore::PlaybackSessionModelMediaElement::seekToTime):
1618         * platform/ios/WebAVPlayerController.mm:
1619         (-[WebAVPlayerController seekToTime:]):
1620         (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
1621         (-[WebAVPlayerController seekByTimeInterval:]):
1622         (-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
1623         (-[WebAVPlayerController seekToBeginning:]):
1624         (-[WebAVPlayerController seekToEnd:]):
1625         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1626         (VideoFullscreenControllerContext::seekToTime):
1627
1628 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1629
1630         Unreviewed, fix WPE build after r224074
1631         https://bugs.webkit.org/show_bug.cgi?id=178892
1632
1633         * accessibility/wpe/AccessibilityObjectWPE.cpp:
1634         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1635
1636 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
1637
1638         When navigating back to a page, compositing layers may not use accelerated drawing
1639         https://bugs.webkit.org/show_bug.cgi?id=178749
1640         rdar://problem/35158946
1641
1642         Reviewed by Dean Jackson.
1643
1644         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
1645         occurred on back navigation, related to the ordering of style recalcs and layout.
1646
1647         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
1648         its cacheAcceleratedCompositingFlags(), so any layers created during style update
1649         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
1650         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
1651
1652         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
1653         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
1654         the TileController.
1655
1656         Test: compositing/accelerated-layers-after-back.html
1657
1658         * page/FrameView.cpp:
1659         (WebCore::FrameView::updateCompositingLayersAfterLayout):
1660         * platform/graphics/ca/GraphicsLayerCA.cpp:
1661         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1662         * rendering/RenderLayerCompositor.cpp:
1663         (WebCore::RenderLayerCompositor::willRecalcStyle):
1664         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
1665         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1666         * rendering/RenderLayerCompositor.h:
1667
1668 2017-10-26  Alex Christensen  <achristensen@webkit.org>
1669
1670         Fix Windows build
1671         https://bugs.webkit.org/show_bug.cgi?id=178892
1672
1673         * accessibility/win/AccessibilityObjectWin.cpp:
1674         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1675
1676 2017-10-26  Alex Christensen  <achristensen@webkit.org>
1677
1678         Modernize AccessibilityObject.h
1679         https://bugs.webkit.org/show_bug.cgi?id=178892
1680
1681         Reviewed by Tim Horton.
1682
1683         The enums in AccessibilityObject.h are causing naming collisions with unified builds.
1684         This is what enum classes are for.
1685         HashMaps of enum classes still need a few casts to/from int.
1686         
1687         I also made some RefPtr's Ref's, use some initializer lists instead of values in the constructor implementation, and indentation fixing.
1688         
1689         No change in behavior.
1690
1691         * accessibility/AXObjectCache.cpp:
1692         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
1693         (WebCore::AXObjectCache::~AXObjectCache):
1694         (WebCore::AXObjectCache::getOrCreate):
1695         (WebCore::AXObjectCache::remove):
1696         (WebCore::AXObjectCache::notificationPostTimerFired):
1697         * accessibility/AXObjectCache.h:
1698         (WebCore::AXComputedObjectAttributeCache::CachedAXObjectAttributes::CachedAXObjectAttributes):
1699         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
1700         * accessibility/AccessibilityARIAGrid.cpp:
1701         (WebCore::AccessibilityARIAGrid::addChildren):
1702         * accessibility/AccessibilityARIAGridCell.cpp:
1703         (WebCore::AccessibilityARIAGridCell::parentRowGroup const):
1704         * accessibility/AccessibilityARIAGridRow.cpp:
1705         (WebCore::AccessibilityARIAGridRow::headerObject):
1706         * accessibility/AccessibilityAttachment.cpp:
1707         (WebCore::AccessibilityAttachment::accessibilityText):
1708         * accessibility/AccessibilityAttachment.h:
1709         * accessibility/AccessibilityImageMapLink.cpp:
1710         (WebCore::AccessibilityImageMapLink::roleValue const):
1711         (WebCore::AccessibilityImageMapLink::accessibilityText):
1712         * accessibility/AccessibilityLabel.cpp:
1713         (WebCore::childrenContainOnlyStaticText):
1714         * accessibility/AccessibilityLabel.h:
1715         * accessibility/AccessibilityList.cpp:
1716         (WebCore::AccessibilityList::isUnorderedList const):
1717         (WebCore::AccessibilityList::isOrderedList const):
1718         (WebCore::AccessibilityList::determineAccessibilityRole):
1719         (WebCore::AccessibilityList::roleValue const):
1720         * accessibility/AccessibilityListBox.cpp:
1721         (WebCore::AccessibilityListBox::setSelectedChildren):
1722         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const):
1723         * accessibility/AccessibilityListBox.h:
1724         * accessibility/AccessibilityListBoxOption.h:
1725         * accessibility/AccessibilityMathMLElement.cpp:
1726         (WebCore::AccessibilityMathMLElement::determineAccessibilityRole):
1727         (WebCore::AccessibilityMathMLElement::isMathScriptObject const):
1728         (WebCore::AccessibilityMathMLElement::isMathMultiscriptObject const):
1729         * accessibility/AccessibilityMediaControls.cpp:
1730         (WebCore::AccessibilityMediaControl::accessibilityText):
1731         (WebCore::AccessibilityMediaControl::roleValue const):
1732         * accessibility/AccessibilityMediaControls.h:
1733         * accessibility/AccessibilityMenuList.cpp:
1734         (WebCore::AccessibilityMenuList::addChildren):
1735         * accessibility/AccessibilityMenuList.h:
1736         * accessibility/AccessibilityMenuListOption.h:
1737         * accessibility/AccessibilityMenuListPopup.cpp:
1738         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const):
1739         * accessibility/AccessibilityMenuListPopup.h:
1740         * accessibility/AccessibilityNodeObject.cpp:
1741         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
1742         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
1743         (WebCore::AccessibilityNodeObject::canHaveChildren const):
1744         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
1745         (WebCore::AccessibilityNodeObject::isSearchField const):
1746         (WebCore::AccessibilityNodeObject::isImage const):
1747         (WebCore::AccessibilityNodeObject::isPasswordField const):
1748         (WebCore::AccessibilityNodeObject::isInputImage const):
1749         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
1750         (WebCore::AccessibilityNodeObject::isSlider const):
1751         (WebCore::AccessibilityNodeObject::isMenuRelated const):
1752         (WebCore::AccessibilityNodeObject::isMenu const):
1753         (WebCore::AccessibilityNodeObject::isMenuBar const):
1754         (WebCore::AccessibilityNodeObject::isMenuButton const):
1755         (WebCore::AccessibilityNodeObject::isMenuItem const):
1756         (WebCore::AccessibilityNodeObject::isEnabled const):
1757         (WebCore::AccessibilityNodeObject::isChecked const):
1758         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute const):
1759         (WebCore::AccessibilityNodeObject::headingLevel const):
1760         (WebCore::AccessibilityNodeObject::isHeading const):
1761         (WebCore::AccessibilityNodeObject::isLink const):
1762         (WebCore::AccessibilityNodeObject::isGroup const):
1763         (WebCore::AccessibilityNodeObject::selectedRadioButton):
1764         (WebCore::AccessibilityNodeObject::checkboxOrRadioValue const):
1765         (WebCore::AccessibilityNodeObject::actionElement const):
1766         (WebCore::AccessibilityNodeObject::alterSliderValue):
1767         (WebCore::AccessibilityNodeObject::isGenericFocusableElement const):
1768         (WebCore::AccessibilityNodeObject::menuElementForMenuButton const):
1769         (WebCore::AccessibilityNodeObject::menuItemElementForMenu const):
1770         (WebCore::AccessibilityNodeObject::titleElementText const):
1771         (WebCore::AccessibilityNodeObject::alternativeText const):
1772         (WebCore::AccessibilityNodeObject::visibleText const):
1773         (WebCore::AccessibilityNodeObject::helpText const):
1774         (WebCore::AccessibilityNodeObject::accessibilityText):
1775         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
1776         (WebCore::AccessibilityNodeObject::accessibilityDescription const):
1777         (WebCore::AccessibilityNodeObject::roleIgnoresTitle const):
1778         (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
1779         (WebCore::AccessibilityNodeObject::title const):
1780         (WebCore::AccessibilityNodeObject::text const):
1781         (WebCore::AccessibilityNodeObject::stringValue const):
1782         (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
1783         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const):
1784         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
1785         * accessibility/AccessibilityNodeObject.h:
1786         * accessibility/AccessibilityObject.cpp:
1787         (WebCore::AccessibilityObject::detach):
1788         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
1789         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
1790         (WebCore::AccessibilityObject::isBlockquote const):
1791         (WebCore::AccessibilityObject::isTextControl const):
1792         (WebCore::AccessibilityObject::isARIATextControl const):
1793         (WebCore::AccessibilityObject::isLandmark const):
1794         (WebCore::AccessibilityObject::findMatchingObjects):
1795         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
1796         (WebCore::AccessibilityObject::selectText):
1797         (WebCore::AccessibilityObject::isARIAInput):
1798         (WebCore::AccessibilityObject::isARIAControl):
1799         (WebCore::AccessibilityObject::isRangeControl const):
1800         (WebCore::AccessibilityObject::visiblePositionForBounds const):
1801         (WebCore::AccessibilityObject::supportsARIAReadOnly const):
1802         (WebCore::AccessibilityObject::ariaReadOnlyValue const):
1803         (WebCore::AccessibilityObject::headingElementForNode):
1804         (WebCore::AccessibilityObject::ariaTreeRows):
1805         (WebCore::AccessibilityObject::ariaTreeItemContent):
1806         (WebCore::AccessibilityObject::ariaTreeItemDisclosedRows):
1807         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
1808         (WebCore::AccessibilityObject::actionVerb const):
1809         (WebCore::AccessibilityObject::ariaCurrentState const):
1810         (WebCore::AccessibilityObject::ariaCurrentValue const):
1811         (WebCore::AccessibilityObject::orientation const):
1812         (WebCore::initializeRoleMap):
1813         (WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
1814         (WebCore::AccessibilityObject::computedRoleString const):
1815         (WebCore::AccessibilityObject::supportsPressAction const):
1816         (WebCore::AccessibilityObject::sortDirection const):
1817         (WebCore::AccessibilityObject::supportsExpanded const):
1818         (WebCore::AccessibilityObject::isExpanded const):
1819         (WebCore::AccessibilityObject::supportsChecked const):
1820         (WebCore::AccessibilityObject::checkboxOrRadioValue const):
1821         (WebCore::AccessibilityObject::scrollByPage const):
1822         (WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
1823         (WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
1824         (WebCore::AccessibilityObject::buttonRoleType const):
1825         (WebCore::AccessibilityObject::isButton const):
1826         (WebCore::AccessibilityObject::accessibilityIsIgnoredByDefault const):
1827         (WebCore::AccessibilityObject::defaultObjectInclusion const):
1828         (WebCore::AccessibilityObject::accessibilityIsIgnored const):
1829         (WebCore::AccessibilityObject::isContainedByPasswordField const):
1830         (WebCore::AccessibilityObject::AccessibilityObject): Deleted.
1831         * accessibility/AccessibilityObject.h:
1832         (WebCore::AccessibilityText::AccessibilityText):
1833         (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
1834         (WebCore::AccessibilityObject::isImageMap const):
1835         (WebCore::AccessibilityObject::isWebArea const):
1836         (WebCore::AccessibilityObject::isCheckbox const):
1837         (WebCore::AccessibilityObject::isRadioButton const):
1838         (WebCore::AccessibilityObject::isListBox const):
1839         (WebCore::AccessibilityObject::isSpinButton const):
1840         (WebCore::AccessibilityObject::isSwitch const):
1841         (WebCore::AccessibilityObject::isToggleButton const):
1842         (WebCore::AccessibilityObject::isTabList const):
1843         (WebCore::AccessibilityObject::isTabItem const):
1844         (WebCore::AccessibilityObject::isRadioGroup const):
1845         (WebCore::AccessibilityObject::isComboBox const):
1846         (WebCore::AccessibilityObject::isTree const):
1847         (WebCore::AccessibilityObject::isTreeGrid const):
1848         (WebCore::AccessibilityObject::isTreeItem const):
1849         (WebCore::AccessibilityObject::isScrollbar const):
1850         (WebCore::AccessibilityObject::isListItem const):
1851         (WebCore::AccessibilityObject::isScrollView const):
1852         (WebCore::AccessibilityObject::isCanvas const):
1853         (WebCore::AccessibilityObject::isPopUpButton const):
1854         (WebCore::AccessibilityObject::isColorWell const):
1855         (WebCore::AccessibilityObject::isSplitter const):
1856         (WebCore::AccessibilityObject::isToolbar const):
1857         (WebCore::AccessibilityObject::isSummary const):
1858         (WebCore::AccessibilityObject::isStaticText const):
1859         (WebCore::AccessibilityObject::ariaRoleAttribute const):
1860         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1861         * accessibility/AccessibilityProgressIndicator.h:
1862         * accessibility/AccessibilityRenderObject.cpp:
1863         (WebCore::AccessibilityRenderObject::parentObject const):
1864         (WebCore::AccessibilityRenderObject::isAttachment const):
1865         (WebCore::AccessibilityRenderObject::helpText const):
1866         (WebCore::AccessibilityRenderObject::stringValue const):
1867         (WebCore::AccessibilityRenderObject::addRadioButtonGroupChildren const):
1868         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
1869         (WebCore::AccessibilityRenderObject::linkedUIElements const):
1870         (WebCore::AccessibilityRenderObject::isAllowedChildOfTree const):
1871         (WebCore::objectInclusionFromAltText):
1872         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
1873         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
1874         (WebCore::AccessibilityRenderObject::selectedTextRange const):
1875         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
1876         (WebCore::AccessibilityRenderObject::isFocused const):
1877         (WebCore::AccessibilityRenderObject::setSelectedRows):
1878         (WebCore::AccessibilityRenderObject::getDocumentLinks):
1879         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
1880         (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
1881         (WebCore::AccessibilityRenderObject::supportsExpandedTextValue const):
1882         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1883         (WebCore::AccessibilityRenderObject::orientation const):
1884         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
1885         (WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren const):
1886         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
1887         (WebCore::AccessibilityRenderObject::addImageMapChildren):
1888         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
1889         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
1890         (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const):
1891         (WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
1892         (WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
1893         (WebCore::AccessibilityRenderObject::selectedChildren):
1894         (WebCore::AccessibilityRenderObject::visibleChildren):
1895         (WebCore::AccessibilityRenderObject::tabChildren):
1896         (WebCore::AccessibilityRenderObject::actionVerb const):
1897         (WebCore::msaaRoleForRenderer):
1898         (WebCore::AccessibilityRenderObject::roleValueForMSAA const):
1899         * accessibility/AccessibilitySVGElement.cpp:
1900         (WebCore::AccessibilitySVGElement::accessibilityText):
1901         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
1902         (WebCore::AccessibilitySVGElement::inheritsPresentationalRole const):
1903         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute const):
1904         (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
1905         * accessibility/AccessibilitySVGRoot.h:
1906         * accessibility/AccessibilityScrollView.cpp:
1907         (WebCore::AccessibilityScrollView::scrollBar):
1908         * accessibility/AccessibilityScrollView.h:
1909         * accessibility/AccessibilityScrollbar.cpp:
1910         (WebCore::AccessibilityScrollbar::orientation const):
1911         * accessibility/AccessibilityScrollbar.h:
1912         * accessibility/AccessibilitySlider.cpp:
1913         (WebCore::AccessibilitySlider::orientation const):
1914         (WebCore::AccessibilitySlider::addChildren):
1915         * accessibility/AccessibilitySlider.h:
1916         * accessibility/AccessibilitySpinButton.cpp:
1917         (WebCore::AccessibilitySpinButton::addChildren):
1918         * accessibility/AccessibilitySpinButton.h:
1919         * accessibility/AccessibilityTable.cpp:
1920         (WebCore::AccessibilityTable::hasARIARole const):
1921         (WebCore::AccessibilityTable::addChildren):
1922         (WebCore::AccessibilityTable::headerContainer):
1923         (WebCore::AccessibilityTable::roleValue const):
1924         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
1925         (WebCore::AccessibilityTable::titleElementText const):
1926         * accessibility/AccessibilityTableCell.cpp:
1927         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
1928         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
1929         * accessibility/AccessibilityTableColumn.cpp:
1930         (WebCore::AccessibilityTableColumn::headerObject):
1931         * accessibility/AccessibilityTableColumn.h:
1932         * accessibility/AccessibilityTableHeaderContainer.h:
1933         * accessibility/AccessibilityTableRow.cpp:
1934         (WebCore::AccessibilityTableRow::determineAccessibilityRole):
1935         (WebCore::AccessibilityTableRow::computeAccessibilityIsIgnored const):
1936         * accessibility/AccessibilityTree.cpp:
1937         (WebCore::AccessibilityTree::determineAccessibilityRole):
1938         * accessibility/ios/AccessibilityObjectIOS.mm:
1939         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1940         (WebCore::AccessibilityObject::isInputTypePopupButton const):
1941         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1942         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
1943         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
1944         (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
1945         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
1946         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
1947         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
1948         (-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
1949         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
1950         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1951         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
1952         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
1953         (-[WebAccessibilityObjectWrapper accessibilityValue]):
1954         (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
1955         (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
1956         (-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
1957         (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
1958         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
1959         (-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
1960         * accessibility/mac/AccessibilityObjectMac.mm:
1961         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1962         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1963         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
1964         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
1965         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
1966         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
1967         (createAccessibilitySearchKeyMap):
1968         (accessibilitySearchKeyForString):
1969         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
1970         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1971         (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
1972         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1973         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1974         (createAccessibilityRoleMap):
1975         (roleValueToNSString):
1976         (-[WebAccessibilityObjectWrapper role]):
1977         (-[WebAccessibilityObjectWrapper subrole]):
1978         (-[WebAccessibilityObjectWrapper roleDescription]):
1979         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1980         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
1981         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1982         * inspector/InspectorDOMAgent.cpp:
1983         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1984
1985 2017-10-26  Youenn Fablet  <youenn@apple.com>
1986
1987         importScripts in service worker should use ServiceWorkersMode::None
1988         https://bugs.webkit.org/show_bug.cgi?id=178888
1989
1990         Reviewed by Chris Dumez.
1991
1992         Test: http/tests/workers/service/service-worker-importScript.html
1993
1994         Made sure ServiceWorkersMode::None is used for loading scripts in service workers as we do not support foreign fetch.
1995
1996         * workers/WorkerScriptLoader.cpp:
1997         (WebCore::WorkerScriptLoader::loadSynchronously):
1998
1999 2017-10-26  Keith Miller  <keith_miller@apple.com>
2000
2001         Unreviewed, cleanup changelogs.
2002
2003 2017-10-26  Keith Miller  <keith_miller@apple.com>
2004
2005         Unreviewed, add deprecated declarations pragma to fix macosx.
2006
2007         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2008
2009 2017-10-26  Andy Estes  <aestes@apple.com>
2010
2011         [Payment Request] Restrict API use to secure, same-origin frames
2012         https://bugs.webkit.org/show_bug.cgi?id=178887
2013
2014         Reviewed by Tim Horton.
2015
2016         Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
2017         in the same origin as the main frame.
2018
2019         Progresses active-document-cross-origin.https.sub.html and
2020         active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
2021         since the allowpaymentrequest <iframe> attribute is not yet implemented.
2022
2023         * Modules/applepay/ApplePaySession.cpp:
2024         (WebCore::ApplePaySession::create):
2025         (WebCore::ApplePaySession::supportsVersion):
2026         (WebCore::ApplePaySession::canMakePayments):
2027         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
2028         (WebCore::ApplePaySession::openPaymentSetup):
2029         (WebCore::isSecure): Deleted.
2030         (WebCore::canCallApplePaySessionAPIs): Deleted.
2031         * Modules/applepay/PaymentSession.cpp: Added.
2032         (WebCore::isSecure):
2033         (WebCore::PaymentSession::canCreateSession):
2034         * Modules/applepay/PaymentSession.h:
2035         * Modules/paymentrequest/PaymentHandler.cpp:
2036         (WebCore::PaymentHandler::canCreateSession):
2037         * Modules/paymentrequest/PaymentHandler.h:
2038         * Modules/paymentrequest/PaymentRequest.cpp:
2039         (WebCore::PaymentRequest::create):
2040         * WebCore.xcodeproj/project.pbxproj:
2041
2042 2017-10-26  Youenn Fablet  <youenn@apple.com>
2043
2044         Add service worker handle fetch support for all subresource requests
2045         https://bugs.webkit.org/show_bug.cgi?id=178769
2046
2047         Reviewed by Chris Dumez.
2048
2049         Test: http/tests/workers/service/image-fetch.html
2050
2051         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
2052         Setting the selected service worker identifier for subresource only at the moment.
2053
2054         Testing is limited to images, future wpt tests should cover other subresource cases.
2055
2056         * loader/DocumentThreadableLoader.cpp:
2057         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2058         * loader/cache/CachedResourceLoader.cpp:
2059         (WebCore::CachedResourceLoader::prepareFetch):
2060         * loader/cache/CachedResourceRequest.cpp:
2061         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
2062         * loader/cache/CachedResourceRequest.h:
2063
2064 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
2065
2066         NowPlayingInfo should contain a unique identifier
2067         https://bugs.webkit.org/show_bug.cgi?id=178872
2068
2069         Reviewed by Jer Noble.
2070
2071         Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.
2072
2073         * platform/audio/PlatformMediaSessionManager.h:
2074         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.
2075
2076         * platform/audio/ios/MediaSessionManagerIOS.h:
2077         * platform/audio/ios/MediaSessionManagerIOS.mm:
2078         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.
2079
2080         * platform/audio/mac/MediaSessionManagerMac.h:
2081         * platform/audio/mac/MediaSessionManagerMac.mm:
2082         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.
2083
2084         * platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
2085         * platform/mac/MediaRemoteSoftLink.h:
2086
2087 2017-10-26  Keith Miller  <keith_miller@apple.com>
2088
2089         Unreviewed, iOS build fix.
2090
2091         * SourcesMac.txt:
2092         * WebCore.xcodeproj/project.pbxproj:
2093
2094 2017-10-26  Keith Miller  <keith_miller@apple.com>
2095
2096         Move Mac specific files to unified sources
2097         https://bugs.webkit.org/show_bug.cgi?id=178883
2098
2099         Rubber-stamped by Tim Horton.
2100
2101         * SourcesCocoa.txt:
2102         * SourcesMac.txt:
2103         * WebCore.xcodeproj/project.pbxproj:
2104
2105 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
2106
2107         DidMoveToNewDocumentAssertionScope shouldn't be necessary
2108         https://bugs.webkit.org/show_bug.cgi?id=178836
2109         <rdar://problem/35008876>
2110
2111         Reviewed by Antti Koivisto.
2112
2113         DidMoveToNewDocumentAssertionScope was introduced in r217972 to replace an existing assertion to make sure
2114         Node::didMoveToNewDocument is always called by its overrides in Node's subclasses. However, we can ensure
2115         better Node::didMoveToNewDocument is always called if we called it directly in Node::moveTreeToNewScope.
2116
2117         Because only subclasses of Element and ShadowRoot override Node::didMoveToNewDocument and we already have
2118         a specialized code path to adopt a ShadowRoot to a new document, this refactoring eliminates the need for
2119         having a virtual function on Node at all.
2120
2121         Hence this patch names Node::didMoveToNewDocument to Node::moveToNewDocument and makes it non-virtual,
2122         splits ShadowRoot::didMoveToNewDocument into moveShadowRootToNewParentScope and moveShadowRootToNewDocument,
2123         and removes DidMoveToNewDocumentAssertionScope completely.
2124
2125         No new tests since there should be no behavioral change.
2126
2127         * dom/Document.cpp:
2128         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Renamed from moveNodeIteratorsToNewDocument.
2129         * dom/Document.h:
2130         (WebCore::Document::moveNodeIteratorsToNewDocument): Inlined the check for emptiness of m_nodeIterators to
2131         avoid keep calling moveNodeIteratorsToNewDocumentSlowCase on every single node getting moved.
2132         * dom/Element.cpp:
2133         (WebCore::Element::didMoveToNewDocument): Removed the call to Node::didMoveToNewDocument since this is the
2134         base virtual function now.
2135         * dom/Element.h:
2136         * dom/Node.cpp:
2137         (WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope): Deleted.
2138         (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope): Deleted.
2139         (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall): Deleted.
2140         (WebCore::moveNodeToNewDocument): Deleted.
2141         (WebCore::Node::moveShadowTreeToNewDocument): Made this a member function of Node since it needs to call
2142         moveNodeToNewDocument, which is private to Node.
2143         (WebCore::Node::moveTreeToNewScope): Removed the release assert for the root node since  the same check
2144         exists inside traverseSubtreeToUpdateTreeScope. Also removed the release assertion for checking that
2145         node's old document matches the old document since document() simply calls treeScope().documentScope()
2146         and we're already release-asserting that the old scope of a node matches the old scope we know of.
2147         We release-assert that the old tree scope's document didn't change after the traversal instead. Finally,
2148         replaced a bunch of RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
2149         (WebCore::Node::moveNodeToNewDocument): Renamed from didMoveToNewDocument. Moved the code related to
2150         mutation observers inside hasRareData() check, and moved the the code to move event listeners inside
2151         eventTargetData() check both for clarity, and avoid doing the work for every single node being moved.
2152         Finally, call the old didMoveToNewDocument when "this" is an Element.
2153         * dom/Node.h:
2154         * dom/ShadowRoot.cpp:
2155         (WebCore::ShadowRoot::moveShadowRootToNewParentScope): Added. Extracted from didMoveToNewDocument.
2156         (WebCore::ShadowRoot::moveShadowRootToNewDocument): Renamed from didMoveToNewDocument. We now
2157         release-assert that parent tree scope's document matches the new document if any.
2158         * dom/ShadowRoot.h:
2159
2160 2017-10-26  Youenn Fablet  <youenn@apple.com>
2161
2162         Implement ServiceWorkerContainer getRegistration
2163         https://bugs.webkit.org/show_bug.cgi?id=178882
2164
2165         Reviewed by Chris Dumez.
2166
2167         Replace rejection promise by resolving the promise with a null value.
2168         This helps in running WPT tests as WPT tests usually check for registered service workers before running tests.
2169         For WTR, there should be no registered service worker anyway.
2170
2171         * workers/service/ServiceWorkerContainer.cpp:
2172         (WebCore::ServiceWorkerContainer::getRegistration):
2173         * workers/service/ServiceWorkerContainer.h:
2174
2175 2017-10-26  Dan Bernstein  <mitz@apple.com>
2176
2177         Account for Mail’s WebMessageDocument class being renamed
2178         https://bugs.webkit.org/show_bug.cgi?id=178881
2179
2180         Reviewed by Sam Weinig.
2181
2182         * editing/cocoa/HTMLConverter.mm:
2183         (_WebMessageDocumentClass): Look up the class by its new name. No longer look it up by the
2184           old old name, because TOT WebKit isn’t going to be used by versions of Mail that have that name.
2185
2186 2017-10-26  Antoine Quint  <graouts@apple.com>
2187
2188         Remove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
2189         https://bugs.webkit.org/show_bug.cgi?id=178879
2190
2191         Reviewed by Dean Jackson.
2192
2193         There are no call sites for FrameView::serviceScriptedAnimations() and that method is the
2194         only call site for Document::serviceScriptedAnimations(), so both can go.
2195
2196         * dom/Document.cpp:
2197         (WebCore::Document::serviceScriptedAnimations): Deleted.
2198         * dom/Document.h:
2199         * page/FrameView.cpp:
2200         (WebCore::FrameView::serviceScriptedAnimations): Deleted.
2201         * page/FrameView.h:
2202
2203 2017-10-26  Chris Dumez  <cdumez@apple.com>
2204
2205         Bring back SWContextManager abstraction in WebCore
2206         https://bugs.webkit.org/show_bug.cgi?id=178876
2207
2208         Reviewed by Geoffrey Garen.
2209
2210         Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
2211         is actually useful when the ServiceWorker wants to message the storage process.
2212
2213         * Sources.txt:
2214         * WebCore.xcodeproj/project.pbxproj:
2215         * workers/service/context/SWContextManager.cpp: Added.
2216         (WebCore::SWContextManager::singleton):
2217         (WebCore::SWContextManager::setConnection):
2218         (WebCore::SWContextManager::connection const):
2219         (WebCore::SWContextManager::registerServiceWorkerThread):
2220         (WebCore::SWContextManager::serviceWorkerThreadProxy const):
2221         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
2222         * workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
2223         (WebCore::SWContextManager::Connection::~Connection):
2224
2225 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2226
2227         [Curl] Rename CurlJobManager to CurlRequestScheduler
2228         https://bugs.webkit.org/show_bug.cgi?id=178775
2229
2230         To match the meaning of the class.
2231         It was originally meant to be more generic purpose, but as
2232         other classes was introduced, the objective of the class is
2233         now only to handle the life cycle of curl requests.
2234
2235         The delegate is also renamed to CurlRequestSchedulerClient.
2236
2237         Reviewed by Alex Christensen.
2238
2239         * platform/Curl.cmake:
2240         * platform/network/curl/CurlDownload.cpp:
2241         (WebCore::CurlDownload::~CurlDownload):
2242         (WebCore::CurlDownload::willSendRequest):
2243         * platform/network/curl/CurlDownload.h:
2244         * platform/network/curl/CurlRequest.cpp:
2245         (WebCore::CurlRequest::CurlRequest):
2246         (WebCore::CurlRequest::start):
2247         (WebCore::CurlRequest::startWithJobManager):
2248         (WebCore::CurlRequest::cancel):
2249         (WebCore::CurlRequest::callClient):
2250         (WebCore::CurlRequest::didReceiveData):
2251         (WebCore::CurlRequest::didCompleteTransfer):
2252         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2253         (WebCore::CurlRequest::invokeDidReceiveResponse):
2254         (WebCore::CurlRequest::completeDidReceiveResponse):
2255         (WebCore::CurlRequest::pausedStatusChanged):
2256         (WebCore::CurlRequest::callDelegate): Deleted.
2257         * platform/network/curl/CurlRequest.h:
2258         (WebCore::CurlRequest::create):
2259         (WebCore::CurlRequest::setClient):
2260         (WebCore::CurlRequest::setDelegate): Deleted.
2261         * platform/network/curl/CurlRequestClient.h: Renamed from Source/WebCore/platform/network/curl/CurlRequestDelegate.h.
2262         * platform/network/curl/CurlRequestScheduler.cpp: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.cpp.
2263         (WebCore::CurlJobList::startJobs):
2264         (WebCore::CurlJobList::finishJobs):
2265         (WebCore::CurlRequestScheduler::singleton):
2266         (WebCore::CurlRequestScheduler::add):
2267         (WebCore::CurlRequestScheduler::cancel):
2268         (WebCore::CurlRequestScheduler::callOnWorkerThread):
2269         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
2270         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
2271         (WebCore::CurlRequestScheduler::stopThread):
2272         (WebCore::CurlRequestScheduler::updateJobList):
2273         (WebCore::CurlRequestScheduler::workerThread):
2274         * platform/network/curl/CurlRequestScheduler.h: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.h.
2275         (WebCore::CurlRequestScheduler::~CurlRequestScheduler):
2276         * platform/network/curl/CurlRequestSchedulerClient.h: Added.
2277         (WebCore::CurlRequestSchedulerClient::~CurlRequestSchedulerClient):
2278         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2279         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
2280         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
2281         (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
2282         * platform/network/curl/ResourceHandleCurlDelegate.h:
2283
2284 2017-10-26  Antti Koivisto  <antti@apple.com>
2285
2286         Remove unnecessary whitespace invalidation logic from RenderTreeUpdater
2287         https://bugs.webkit.org/show_bug.cgi?id=178786
2288
2289         Reviewed by Zalan Bujtas.
2290
2291         RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded is a somewhat complex
2292         and confusing function for figuring out if some whitespace-only text node might need to have its
2293         rendering status recomputed. However actually computing if a text renderer is needed is not expensive.
2294         We can simply do it for all whitespace nodes after a sibling mutation.
2295
2296         This also removes a set that could have stale renderer pointers in it (they were never dereferenced).
2297
2298         * rendering/RenderBlock.cpp:
2299         (WebCore::RenderBlock::addChildIgnoringContinuation):
2300
2301             Fix a display:contents bug exposed by this change. With display:contents a text renderer may have an anonymous
2302             inline wrapper and we need to take it into account when the text renderer is the beforeChild.
2303
2304             Tested by imported/w3c/web-platform-tests/css/css-display-3/display-contents-state-change-001.html
2305
2306         * style/RenderTreeUpdater.cpp:
2307         (WebCore::RenderTreeUpdater::updateRenderTree):
2308
2309             Call updateTextRenderer() for all whitespace-only text nodes after a change in siblings.
2310             In normal update case it just figures out quickly (by calling textRendererIsNeeded)
2311             that there are no changes and bails out.
2312
2313         (WebCore::RenderTreeUpdater::updateElementRenderer):
2314         (WebCore::RenderTreeUpdater::updateTextRenderer):
2315         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.
2316
2317             No longer needed. Just mark that there have been changes to siblings instead.
2318
2319         * style/RenderTreeUpdater.h:
2320
2321 2017-10-26  Myles C. Maxfield  <mmaxfield@apple.com>
2322
2323         Mark font palettes as in development
2324         https://bugs.webkit.org/show_bug.cgi?id=178590
2325
2326         Unreviewed.
2327
2328         * features.json:
2329
2330 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2331
2332         Unreviewed, rolling out r223984.
2333
2334         Caused LayoutTest assertion failures.
2335
2336         Reverted changeset:
2337
2338         "When navigating back to a page, compositing layers may not
2339         use accelerated drawing"
2340         https://bugs.webkit.org/show_bug.cgi?id=178749
2341         https://trac.webkit.org/changeset/223984
2342
2343 2017-10-26  Youenn Fablet  <youenn@apple.com>
2344
2345         Add inspector logging for MediaElementSession autoplay
2346         https://bugs.webkit.org/show_bug.cgi?id=178846
2347
2348         Reviewed by Eric Carlson.
2349
2350         No change of behavior.
2351         Making use of pal Logger in MediaElementSession.
2352         This new logging is limited to autoplay/playback for now.
2353
2354         * html/MediaElementSession.cpp:
2355         (WebCore::MediaElementSession::MediaElementSession):
2356         (WebCore::MediaElementSession::playbackPermitted const):
2357         (WebCore::MediaElementSession::autoplayPermitted const):
2358         (WebCore::MediaElementSession::willLog const):
2359         (WebCore::MediaElementSession::logChannel const):
2360         * html/MediaElementSession.h:
2361
2362 2017-10-26  Keith Miller  <keith_miller@apple.com>
2363
2364         Move ApplePay to unified sources
2365         https://bugs.webkit.org/show_bug.cgi?id=178871
2366
2367         Rubber-stamped by Tim Horton.
2368
2369         Also, add some other missing files.
2370
2371         * SourcesCocoa.txt:
2372         * WebCore.xcodeproj/project.pbxproj:
2373
2374 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2375
2376         Unreviewed, rolling out r224019.
2377
2378         This change caused API test WebKit.MSEIsPlayingAudio to time
2379         out.
2380
2381         Reverted changeset:
2382
2383         "XMLHttpRequest should not treat file URLs as same origin"
2384         https://bugs.webkit.org/show_bug.cgi?id=178565
2385         https://trac.webkit.org/changeset/224019
2386
2387 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2388
2389         Unreviewed, rolling out r223994.
2390
2391         The LayoutTest for this change is failing.
2392
2393         Reverted changeset:
2394
2395         "Add service worker handle fetch support for all subresource
2396         requests"
2397         https://bugs.webkit.org/show_bug.cgi?id=178769
2398         https://trac.webkit.org/changeset/223994
2399
2400 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2401
2402         Unreviewed, rolling out r223908.
2403
2404         Causes LayoutTest crashes with newer SDKs.
2405
2406         Reverted changeset:
2407
2408         "Adopt new secure coding APIs"
2409         https://bugs.webkit.org/show_bug.cgi?id=178484
2410         https://trac.webkit.org/changeset/223908
2411
2412 2017-10-25  Brent Fulgham  <bfulgham@apple.com>
2413
2414         XMLHttpRequest should not treat file URLs as same origin
2415         https://bugs.webkit.org/show_bug.cgi?id=178565
2416         <rdar://problem/11115901>
2417
2418         Reviewed by Ryosuke Niwa.
2419
2420         Do not treat file URLs as same-origin for XHR requests.
2421
2422         Test: fast/xmlhttprequest/xmlhttprequest-access-self-as-file.html
2423
2424         * loader/DocumentThreadableLoader.cpp:
2425         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Use new helper method.
2426         * page/SecurityOrigin.cpp:
2427         (WebCore::SecurityOrigin::requestIsSameOrigin): New method to recognize same-origin
2428         requests, with special handling for XHR.
2429         * page/SecurityOrigin.h:
2430
2431 2017-10-26  Christopher Reid  <chris.reid@sony.com>
2432
2433         Remove scopeguard from platform
2434         https://bugs.webkit.org/show_bug.cgi?id=178681
2435
2436         Reviewed by Brady Eidson.
2437
2438         Replacing platform/ScopeGuard with WTF::ScopeExit.
2439         No new tests, no change in behavior.
2440
2441         * Modules/indexeddb/IDBRequest.cpp:
2442         * Modules/indexeddb/IDBRequest.h:
2443         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2444         * WebCore.xcodeproj/project.pbxproj:
2445         * platform/FileSystem.cpp:
2446         * platform/ScopeGuard.h: Removed.
2447         * platform/network/BlobRegistryImpl.cpp:
2448         * workers/service/ServiceWorkerContainer.cpp:
2449
2450 2017-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2451
2452         REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line
2453         https://bugs.webkit.org/show_bug.cgi?id=178625
2454
2455         Reviewed by Michael Catanzaro.
2456
2457         Once we find the first space, which has the COMMON script, we split the run, and the next ones keep using
2458         COMMON instead of ARABIC because we don't update the current script on every loop iteration. This patch
2459         simplifies the script handling by moving the code back to the loop and always breaking in case of different
2460         scripts, correctly handling INHERITED and COMMON cases and updating the current script when needed.
2461
2462         Covered by existing tests. This improves several tests that have been rebaselined.
2463
2464         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2465         (WebCore::findNextRun):
2466         (WebCore::scriptsAreCompatibleForCharacters): Deleted.
2467
2468 2017-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2469
2470         [MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
2471         https://bugs.webkit.org/show_bug.cgi?id=178819
2472
2473         Reviewed by Xabier Rodriguez-Calvar.
2474
2475         The deadlock may occur when UI thread tries to clear pipeline in
2476         AppendPipeline::clearPlayerPrivate() while parser thread tries to change
2477         pipeline state to pause holding the stream lock in
2478         AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread()
2479
2480         This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
2481
2482         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2483         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2484         Return if there's no player private.
2485
2486 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
2487
2488         Assert that no script is executed during style recalc
2489         https://bugs.webkit.org/show_bug.cgi?id=178845
2490         <rdar://problem/35106129>
2491
2492         Reviewed by Antti Koivisto.
2493
2494         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
2495         to make sure we don't start mutating DOM in the middle of a style update.
2496
2497         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
2498         shadow tree since that happens while updating the style.
2499
2500         No new tests since there should be no behavioral change.
2501
2502         * dom/Document.cpp:
2503         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
2504         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
2505         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
2506         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
2507         scripts which in turn trigger another (recursive) style recalc.
2508         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
2509         NoEventDispatchAssertion.
2510         * dom/Element.cpp:
2511         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
2512         newly cloned element for SVG use element's shadow tree.
2513         (WebCore::Element::cloneElementWithoutChildren): Ditto.
2514         * dom/EventDispatcher.cpp:
2515         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
2516         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
2517         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
2518         pushing or popoing the stack frame.
2519         * svg/SVGUseElement.cpp:
2520         (WebCore::SVGUseElement::clearShadowTree):
2521         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
2522         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
2523         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
2524         (WebCore::SVGUseElement::cloneTarget const): Ditto.
2525         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
2526         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
2527         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
2528
2529 2017-10-25  Keith Miller  <keith_miller@apple.com>
2530
2531         Move platform Cocoa sources to unified sources
2532         https://bugs.webkit.org/show_bug.cgi?id=178851
2533
2534         Rubber-stamped by Tim Horton.
2535
2536         * SourcesCocoa.txt:
2537         * WebCore.xcodeproj/project.pbxproj:
2538
2539 2017-10-25  Keith Miller  <keith_miller@apple.com>
2540
2541         Start moving Cocoa specific unified sources
2542         https://bugs.webkit.org/show_bug.cgi?id=178850
2543
2544         Rubber-stamped by Tim Horton.
2545
2546         * PlatformMac.cmake:
2547         * SourcesCocoa.txt:
2548         * WebCore.xcodeproj/project.pbxproj:
2549
2550 2017-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2551
2552         [HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
2553         https://bugs.webkit.org/show_bug.cgi?id=178788
2554
2555         Reviewed by Michael Catanzaro.
2556
2557         Instead of using the TextRun direction. If the TextRun is ltr, but the harfbuzz buffer is rtl, the character
2558         indexes will be swapped in m_coreTextIndices.
2559
2560         * platform/graphics/ComplexTextController.h:
2561         (WebCore::ComplexTextController::ComplexTextRun::create): Remove the ltr parameter.
2562         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2563         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isLTR using hb_buffer_get_direction().
2564         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Do not pass ltr to ComplexTextRun::create().
2565
2566 2017-10-25  Keith Miller  <keith_miller@apple.com>
2567
2568         Move remaining platform independent sources to unified sources
2569         https://bugs.webkit.org/show_bug.cgi?id=178849
2570
2571         Rubber-stamped by Tim Horton.
2572
2573         * CMakeLists.txt:
2574         * Sources.txt:
2575         * WebCore.xcodeproj/project.pbxproj:
2576
2577 2017-10-25  Keith Miller  <keith_miller@apple.com>
2578
2579         Move plugins and rendering to unified sources
2580         https://bugs.webkit.org/show_bug.cgi?id=178848
2581
2582         Rubber-stamped by Tim Horton.
2583
2584         * CMakeLists.txt:
2585         * Sources.txt:
2586         * WebCore.xcodeproj/project.pbxproj:
2587
2588 2017-10-25  Keith Miller  <keith_miller@apple.com>
2589
2590         Unreviewed, add FEMorphology.cpp back to the regular build after r224003.
2591
2592         * WebCore.xcodeproj/project.pbxproj:
2593
2594 2017-10-25  Keith Miller  <keith_miller@apple.com>
2595
2596         Unreviewed, Windows build fix.
2597
2598         * Sources.txt:
2599
2600 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
2601
2602         Web Inspector: provide a way to enable/disable event listeners
2603         https://bugs.webkit.org/show_bug.cgi?id=177451
2604         <rdar://problem/34994925>
2605
2606         Reviewed by Joseph Pecoraro.
2607
2608         Test: inspector/dom/setEventListenerDisabled.html
2609
2610         * dom/EventTarget.cpp:
2611         (WebCore::EventTarget::fireEventListeners):
2612         Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
2613         callback will not be called.
2614
2615         * inspector/InspectorDOMAgent.h:
2616         * inspector/InspectorDOMAgent.cpp:
2617         (WebCore::InspectorDOMAgent::discardBindings):
2618         (WebCore::InspectorDOMAgent::getEventListenersForNode):
2619         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
2620         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2621         (WebCore::InspectorDOMAgent::willRemoveEventListener):
2622         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
2623         Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
2624         identifying event listeners so they can be referenced from the frontend. We only add items
2625         to this mapping when `getEventListenersForNode` is called, as that is when EventListener
2626         data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
2627         for each EventListener until it is needed. Items are removed whenever an event listener is
2628         removed or when the document changes.
2629
2630         * inspector/InspectorInstrumentation.h:
2631         (WebCore::InspectorInstrumentation::isEventListenerDisabled):
2632         * inspector/InspectorInstrumentation.cpp:
2633         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
2634         (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
2635         Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
2636         actually exists. If not, don't dispatch an event to the frontend as nothing will change.
2637
2638 2017-10-25  Keith Miller  <keith_miller@apple.com>
2639
2640         Move Platform to unified sources.
2641         https://bugs.webkit.org/show_bug.cgi?id=178829
2642
2643         Rubber-stamped by Tim Horton.
2644
2645         * CMakeLists.txt:
2646         * Sources.txt:
2647         * WebCore.xcodeproj/project.pbxproj:
2648         * platform/Cursor.cpp:
2649         * platform/sql/SQLiteDatabase.h:
2650
2651 2017-10-25  Chris Dumez  <cdumez@apple.com>
2652
2653         messageEvent.source can also be a ServiceWorker
2654         https://bugs.webkit.org/show_bug.cgi?id=178839
2655
2656         Reviewed by Brady Eidson.
2657
2658         messageEvent.source can also be a ServiceWorker:
2659         - https://html.spec.whatwg.org/multipage/comms.html#messageeventsource
2660
2661         This enables calling postMessage() from a ServiceWorker via Bug 178794.
2662
2663         * dom/MessageEvent.cpp:
2664         (WebCore::MessageEvent::source const): Deleted.
2665         * dom/MessageEvent.h:
2666         * dom/MessageEvent.idl:
2667
2668 2017-10-25  Ryosuke Niwa  <rniwa@webkit.org>
2669
2670         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
2671         https://bugs.webkit.org/show_bug.cgi?id=178715
2672         <rdar://problem/35144665>
2673
2674         Reviewed by Brent Fulgham.
2675
2676         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
2677         instead of in the middle of collecting a list of stylesheets.
2678
2679         * dom/Document.cpp:
2680         (WebCore::Document::Document): Initialize the newly added timer.
2681         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
2682         handlers may be expecting to see the document after XSLT had been applied.
2683         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
2684         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
2685         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
2686         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
2687         (WebCore::Document::applyXSLTransform): Deleted.
2688         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
2689         inline XSLT and it happens much earlier than implicitClose.
2690         * dom/Document.h:
2691         * dom/ProcessingInstruction.cpp:
2692         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
2693         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
2694         function can be called from a non-script-resilient call stack.
2695         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
2696         * style/StyleScope.cpp:
2697         (WebCore::Style::Scope::collectXSLTransforms): Added.
2698         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
2699         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
2700         * style/StyleScope.h:
2701         * xml/parser/XMLDocumentParserLibxml2.cpp:
2702         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
2703
2704 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
2705
2706         Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
2707         https://bugs.webkit.org/show_bug.cgi?id=178805
2708         <rdar://problem/35176303>
2709
2710         Reviewed by Brian Burg.
2711
2712         No new tests, updated existing tests.
2713
2714         * inspector/InspectorCanvasAgent.cpp:
2715         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2716         If the recording was stopped and had no data, reset the CallTracingActive flag to false.
2717
2718 2017-10-25  Keith Miller  <keith_miller@apple.com>
2719
2720         Move html to unified sources
2721         https://bugs.webkit.org/show_bug.cgi?id=178709
2722
2723         Reviewed by Alex Christensen.
2724
2725         * CMakeLists.txt:
2726         * Sources.txt:
2727         * WebCore.xcodeproj/project.pbxproj:
2728
2729 2017-10-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2730
2731         [Curl] Delete temporally downloaded file when it cancelled
2732         https://bugs.webkit.org/show_bug.cgi?id=134393
2733
2734         Reviewed by Alex Christensen.
2735
2736         * platform/network/curl/CurlRequest.cpp:
2737         (WebCore::CurlRequest::didCancelTransfer):
2738         (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
2739         (WebCore::CurlRequest::closeDownloadFile):
2740         (WebCore::CurlRequest::cleanupDownloadFile):
2741         * platform/network/curl/CurlRequest.h:
2742
2743 2017-10-25  Youenn Fablet  <youenn@apple.com>
2744
2745         Add service worker handle fetch support for all subresource requests
2746         https://bugs.webkit.org/show_bug.cgi?id=178769
2747
2748         Reviewed by Chris Dumez.
2749
2750         Test: http/tests/workers/service/image-fetch.https.html
2751
2752         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
2753         Setting the selected service worker identifier for subresource only at the moment.
2754
2755         Testing is limited to images, future wpt tests should cover other subresource cases.
2756
2757         * loader/DocumentThreadableLoader.cpp:
2758         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2759         * loader/cache/CachedResourceLoader.cpp:
2760         (WebCore::CachedResourceLoader::prepareFetch):
2761         * loader/cache/CachedResourceRequest.cpp:
2762         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
2763         * loader/cache/CachedResourceRequest.h:
2764
2765 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2766
2767         Aliasing of text in CSS specs is blocky and ugly
2768         https://bugs.webkit.org/show_bug.cgi?id=174946
2769         rdar://problem/33594542
2770
2771         Reviewed by Dean Jackson.
2772
2773         The PaintedContentRequest relating to subpixel-antialiased text was failing to be
2774         satisfied if the text content in a composited layer was nested inside descendant
2775         RenderLayers, because RenderLayer::isVisuallyNonEmpty() returned early. If this
2776         function is passed a request, we can't return until we've satisfied the request
2777         (which triggers the checking of descendant layers).
2778
2779         Test: compositing/contents-format/subpixel-antialiased-nested-layer.html
2780
2781         * rendering/RenderLayer.cpp:
2782         (WebCore::RenderLayer::calculateClipRects const):
2783
2784 2017-10-25  Chris Dumez  <cdumez@apple.com>
2785
2786         Unreviewed, add missing copyright header to ServiceWorkerClientType.idl.
2787
2788         * workers/service/ServiceWorkerClientType.idl:
2789 =======
2790         * platform/Cursor.cpp: Previously, excluded on iOS now wrapped in #if
2791         * platform/sql/SQLiteDatabase.h: remove debugging data member from release builds.
2792 >>>>>>> build fixes
2793
2794 2017-10-25  Chris Dumez  <cdumez@apple.com>
2795
2796         Make toJS() do the right thing for ServiceWorkerClient
2797         https://bugs.webkit.org/show_bug.cgi?id=178816
2798
2799         Reviewed by Youenn Fablet.
2800
2801         Make toJS() do the right thing for ServiceWorkerClient. In particular,
2802         it needs to construct a JSServiceWorkerWindowClient wrapper if the
2803         implementation object is a ServiceWorkerWindowClient.
2804
2805         Also, ServiceWorkerClient does not need to be an ActiveDOMObject as
2806         it does not have any long-running tasks. Make it a ContextDestructionObject
2807         instead for now.
2808
2809         * CMakeLists.txt:
2810         * DerivedSources.make:
2811         * Sources.txt:
2812         * WebCore.xcodeproj/project.pbxproj:
2813         * workers/service/ServiceWorkerClient.cpp:
2814         (WebCore::ServiceWorkerClient::postMessage):
2815         * workers/service/ServiceWorkerClient.h:
2816         (WebCore::ServiceWorkerClient::create):
2817         * workers/service/ServiceWorkerClient.idl:
2818         * workers/service/ServiceWorkerClientType.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
2819         * workers/service/ServiceWorkerClientType.idl: Added.
2820         * workers/service/ServiceWorkerClients.h:
2821         * workers/service/ServiceWorkerClients.idl:
2822
2823 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2824
2825         When navigating back to a page, compositing layers may not use accelerated drawing
2826         https://bugs.webkit.org/show_bug.cgi?id=178749
2827         rdar://problem/35158946
2828
2829         Reviewed by Dean Jackson.
2830
2831         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
2832         occurred on back navigation, related to the ordering of style recalcs and layout.
2833
2834         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
2835         its cacheAcceleratedCompositingFlags(), so any layers created during style update
2836         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
2837         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
2838
2839         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
2840         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
2841         the TileController.
2842
2843         Test: compositing/accelerated-layers-after-back.html
2844
2845         * page/FrameView.cpp:
2846         (WebCore::FrameView::updateCompositingLayersAfterLayout):
2847         * platform/graphics/ca/GraphicsLayerCA.cpp:
2848         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2849         * rendering/RenderLayerCompositor.cpp:
2850         (WebCore::RenderLayerCompositor::willRecalcStyle):
2851         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2852         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2853         * rendering/RenderLayerCompositor.h:
2854
2855 2017-10-25  Youenn Fablet  <youenn@apple.com>
2856
2857         Enable ServiceWorker to fetch resources
2858         https://bugs.webkit.org/show_bug.cgi?id=178673
2859
2860         Reviewed by Brady Eidson.
2861
2862         Test: http/tests/workers/service/service-worker-fetch.html
2863
2864         Allow reusing of EmptyFrameLoaderClient for network loading in WebKit Service Worker environment.
2865         Allow overriding the creation of a document loader, pageID, frameID and sessionID getters.
2866
2867         Allow the possibility to create synthetic documents for all ports.
2868
2869         Beefing up ServiceWorkerThreadProxy as it owns a Document and a Page that do nothing but server
2870         the purpose of loading resources for a service worker thread.
2871
2872         * WebCore.xcodeproj/project.pbxproj:
2873         * loader/DocumentLoader.h:
2874         (WebCore::DocumentLoader::setResponse):
2875         * loader/EmptyClients.cpp:
2876         (WebCore::EmptyFrameLoaderClient::sessionID const):
2877         (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
2878         (WebCore::createEmptyFrameNetworkingContext):
2879         * loader/EmptyClients.h:
2880         * loader/EmptyFrameLoaderClient.h: Added.
2881         * loader/FrameLoader.cpp:
2882         (WebCore::FrameLoader::initForSynthesizedDocument):
2883         * loader/FrameLoader.h:
2884         * loader/FrameLoaderClient.h:
2885         * workers/service/context/ServiceWorkerThread.cpp:
2886         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2887         (WebCore::m_workerObjectProxy):
2888         * workers/service/context/ServiceWorkerThread.h:
2889         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2890         (WebCore::ServiceWorkerThreadProxy::create):
2891         (WebCore::createPageForServiceWorker):
2892         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
2893         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
2894         * workers/service/context/ServiceWorkerThreadProxy.h:
2895         Test: http/tests/workers/service/service-worker-fetch.html
2896
2897 2017-10-25  Jer Noble  <jer.noble@apple.com>
2898
2899         UNPACK_FLIP_Y is broken for MSE-backed videos
2900         https://bugs.webkit.org/show_bug.cgi?id=178774
2901
2902         Reviewed by Dean Jackson.
2903
2904         The global GLSL variable gl_Position can apparently only be set once, and any modifications
2905         made after that initial set are ignored. So rather than implement flipping by changing
2906         gl_Position.y, flip the texture coordinates instead.
2907
2908         Drive-by fix: some of the constants used in VideoTextureCopierCV are not defined on older
2909         macOS versions, so make them optional.
2910
2911         Tests: fast/canvas/webgl/texImage2D-mse-flipY-false.html
2912                fast/canvas/webgl/texImage2D-mse-flipY-true.html
2913
2914         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2915         (WebCore::transferFunctionFromString):
2916         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
2917         * platform/cocoa/CoreVideoSoftLink.cpp:
2918         * platform/cocoa/CoreVideoSoftLink.h:
2919
2920 2017-10-25  Chris Dumez  <cdumez@apple.com>
2921
2922         [Service Worker] Add stubs for serviceWorkerClient.type
2923         https://bugs.webkit.org/show_bug.cgi?id=178812
2924
2925         Reviewed by Youenn Fablet.
2926
2927         Add stubs for serviceWorkerClient.type to match the latest specification:
2928         - https://w3c.github.io/ServiceWorker/#enumdef-clienttype
2929
2930         * CMakeLists.txt:
2931         * DerivedSources.make:
2932         * Sources.txt:
2933         * WebCore.xcodeproj/project.pbxproj:
2934         * workers/service/ServiceWorkerClient.cpp:
2935         (WebCore::ServiceWorkerClient::type const):
2936         * workers/service/ServiceWorkerClient.h:
2937         * workers/service/ServiceWorkerClient.idl:
2938         * workers/service/ServiceWorkerClientType.h: Added.
2939         * workers/service/ServiceWorkerClientType.idl: Added.
2940         * workers/service/ServiceWorkerClients.h:
2941         * workers/service/ServiceWorkerClients.idl:
2942
2943 2017-10-24  Keith Miller  <keith_miller@apple.com>
2944
2945         Move mathml and page to unified souces
2946         https://bugs.webkit.org/show_bug.cgi?id=178770
2947
2948         Rubber-stamped by Tim Horton.
2949
2950         * CMakeLists.txt:
2951         * Sources.txt:
2952         * WebCore.xcodeproj/project.pbxproj:
2953
2954 2017-10-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2955
2956         fast/images/animated-gif-paint-after-animation.html flaky crash
2957         https://bugs.webkit.org/show_bug.cgi?id=178510
2958
2959         Reviewed by Said Abou-Hallawa.
2960
2961         ScalableImageDecoder was accessed from the main thread and the
2962         image decoding thread without a mutex.
2963
2964         No new tests because there is no behavior change.
2965
2966         * platform/image-decoders/ScalableImageDecoder.h: Add m_mutex. Lock the mutex in setData.
2967         * platform/image-decoders/ScalableImageDecoder.cpp:
2968         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): Lock the mutex.
2969         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): Ditto.
2970         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
2971         (WebCore::ScalableImageDecoder::frameDurationAtIndex const): Ditto.
2972         (WebCore::ScalableImageDecoder::createFrameImageAtIndex): Ditto.
2973
2974 2017-10-25  Chris Dumez  <cdumez@apple.com>
2975
2976         Add support for unregistering a service worker
2977         https://bugs.webkit.org/show_bug.cgi?id=178735
2978
2979         Reviewed by Brady Eidson.
2980
2981         Add support for unregistering a service worker:
2982         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
2983
2984         Test: http/tests/workers/service/basic-unregister.https.html
2985
2986         * workers/service/ServiceWorkerContainer.cpp:
2987         (WebCore::ServiceWorkerContainer::addRegistration):
2988         (WebCore::ServiceWorkerContainer::removeRegistration):
2989         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
2990         * workers/service/ServiceWorkerContainer.h:
2991         * workers/service/ServiceWorkerJob.cpp:
2992         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
2993         * workers/service/ServiceWorkerJob.h:
2994         * workers/service/ServiceWorkerJobClient.h:
2995         * workers/service/ServiceWorkerJobData.h:
2996         (WebCore::ServiceWorkerJobData::encode const):
2997         (WebCore::ServiceWorkerJobData::decode):
2998         * workers/service/ServiceWorkerJobType.h:
2999         * workers/service/ServiceWorkerRegistration.cpp:
3000         (WebCore::containerForScriptExecutionContext):
3001         (WebCore::ServiceWorkerRegistration::unregister):
3002         * workers/service/server/SWClientConnection.cpp:
3003         (WebCore::SWClientConnection::registrationJobResolvedInServer):
3004         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
3005         * workers/service/server/SWClientConnection.h:
3006         * workers/service/server/SWServer.cpp:
3007         (WebCore::SWServer::resolveRegistationJob):
3008         (WebCore::SWServer::resolveUnregistrationJob):
3009         * workers/service/server/SWServer.h:
3010         * workers/service/server/SWServerRegistration.cpp:
3011         (WebCore::SWServerRegistration::scriptContextStarted):
3012         (WebCore::SWServerRegistration::startNextJob):
3013         (WebCore::SWServerRegistration::runUnregisterJob):
3014         (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
3015         (WebCore::SWServerRegistration::resolveWithUnregistrationResultOnMainThread):
3016         (WebCore::SWServerRegistration::resolveCurrentRegistrationJob):
3017         (WebCore::SWServerRegistration::resolveCurrentUnregistrationJob):
3018         * workers/service/server/SWServerRegistration.h:
3019
3020 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
3021
3022         MediaSessionManager* needs to catch Obj-C exceptions
3023         https://bugs.webkit.org/show_bug.cgi?id=178813
3024
3025         Reviewed by Tim Horton.
3026
3027         Wrap all calls out to Objective-C with BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS.
3028
3029         * platform/audio/ios/MediaSessionManagerIOS.mm:
3030         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
3031         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
3032         (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
3033         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
3034         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
3035         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
3036         (-[WebMediaSessionHelper allocateVolumeView]):
3037         (-[WebMediaSessionHelper initWithCallback:]):
3038         * platform/audio/mac/MediaSessionManagerMac.mm:
3039         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
3040
3041 2017-10-25  Andy Estes  <aestes@apple.com>
3042
3043         [Payment Request] Implement the "user aborts the payment request" algorithm
3044         https://bugs.webkit.org/show_bug.cgi?id=178810
3045
3046         Reviewed by Tim Horton.
3047
3048         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3049         (WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
3050         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
3051         * Modules/paymentrequest/PaymentRequest.cpp:
3052         (WebCore::PaymentRequest::cancel):
3053         * Modules/paymentrequest/PaymentRequest.h:
3054         * testing/MockPaymentCoordinator.cpp:
3055         (WebCore::MockPaymentCoordinator::cancelPayment):
3056         * testing/MockPaymentCoordinator.h:
3057         * testing/MockPaymentCoordinator.idl:
3058
3059 2017-10-25  Jer Noble  <jer.noble@apple.com>
3060
3061         Autoplay muted videos still stop playback of other streaming apps in the background
3062         https://bugs.webkit.org/show_bug.cgi?id=177920
3063
3064         Reviewed by Eric Carlson.
3065
3066         When creating a new <video> or <audio> element, the global AudioSession can sometimes have
3067         its sessionCategory() set to "MediaPlayback", even if the element does not yet have a
3068         source. This is because the constructor for the MediaElementSession is called before
3069         m_isPlayingToWirelessTarget is initialized, and so in the MediaElementSession constructor,
3070         the media element's m_isPlayingToWirelessTarget ivar is sometimes (uninitialized) true.
3071
3072         We could move the MediaElementSession ivar to the very end of the header, so it's
3073         initialized last, but that still leaves the possibility of the MediaElementSession et. all
3074         calling into the HTMLMediaElement before it's subclass's constructors have a chance to
3075         initialize their own ivars (much less their vtables). So instead, we'll create and set the
3076         MediaElementSession in a finishInitialization() method called from the HTMLVideoElement and
3077         HTMLAudioElement's create() factory methods.
3078
3079         * html/HTMLAudioElement.cpp:
3080         (WebCore::HTMLAudioElement::create):
3081         * html/HTMLMediaElement.cpp:
3082         (WebCore::HTMLMediaElement::HTMLMediaElement):
3083         (WebCore::HTMLMediaElement::finishInitialization):
3084         * html/HTMLMediaElement.h:
3085         * html/HTMLVideoElement.cpp:
3086         (WebCore::HTMLVideoElement::create):
3087
3088 2017-10-25  Javier Fernandez  <jfernandez@igalia.com>
3089
3090         [css-grid] Avoid clearing the overrideContainingBlockWidth if possible
3091         https://bugs.webkit.org/show_bug.cgi?id=178260
3092
3093         Reviewed by Sergio Villar Senin.
3094
3095         Since the intrinsic width computation uses the same logic than the
3096         track sizing algorithm we are clearing the overrideContainingBlockWidth
3097         of some grid items that are required to laid out them properly.
3098
3099         It's very uncommon that any intrinsic size computation isn't performed
3100         as part of a layout process. However, if it happens, once cleared the
3101         overrideContainingBlockWidth it may lead to an incorrect layout of the
3102         affected grid items.
3103
3104         This change is a defensive approach to avoid the issues caused by
3105         such off-layout preferred size requests, which may imply recomputing
3106         the grid container intrinsic size.
3107
3108         No new tests, because we are only removing some redundant logic.
3109
3110         * rendering/GridTrackSizingAlgorithm.cpp:
3111         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
3112         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
3113         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
3114         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
3115         (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
3116         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
3117         * rendering/GridTrackSizingAlgorithm.h:
3118
3119 2017-10-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3120
3121         Unreviewed follow up changing one more enum value as discussed in the bug
3122         https://bugs.webkit.org/show_bug.cgi?id=177810
3123
3124         * platform/glib/LowPowerModeNotifierGLib.cpp:
3125         (WebCore::LowPowerModeNotifier::updateState): use NONE instead of DISCHARGING, to ensure
3126         it will build even with older upower.
3127
3128 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
3129
3130         Make SERVICE_WORKER feature buildable on GTK, WPE
3131         https://bugs.webkit.org/show_bug.cgi?id=178574
3132
3133         Reviewed by Carlos Garcia Campos.
3134
3135         * CMakeLists.txt: Add missing include paths and files to the build.
3136         * Sources.txt: Add missing files to the build.
3137         * WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
3138         JSFetchEventCustom.cpp targets, they're now built via unified sources.
3139         * bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
3140         with the ENABLE(SERVICE_WORKER) guards.
3141
3142 2017-10-24  Alejandro G. Castro  <alex@igalia.com>
3143
3144         Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
3145         https://bugs.webkit.org/show_bug.cgi?id=178721
3146
3147         Reviewed by Youenn Fablet.
3148
3149         Assert when we reach those situations and return some value after that to avoid warning.
3150
3151         No new tests, this is a clean up.
3152
3153         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3154         (WebCore::sessionDescriptionType):
3155         (WebCore::signalingState):
3156         (WebCore::toRTCIceConnectionState):
3157         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3158         (WebCore::bundlePolicyfromConfiguration):
3159         (WebCore::iceTransportPolicyfromConfiguration):
3160
3161 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
3162
3163         RenderSVGModelObject::checkIntersection triggers layout
3164         https://bugs.webkit.org/show_bug.cgi?id=178710
3165
3166         Reviewed by Simon Fraser.
3167
3168         Fixed the bug that checkIntersection and checkEnclosure no longer updates the layout after r223882.
3169
3170         Test: svg/custom/check-intersection-basic.svg
3171
3172         * svg/SVGSVGElement.cpp:
3173         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
3174         (WebCore::SVGSVGElement::checkIntersection):
3175         (WebCore::SVGSVGElement::checkEnclosure):
3176         * svg/SVGSVGElement.h:
3177
3178 2017-10-24  Andy Estes  <aestes@apple.com>
3179
3180         [Apple Pay] Implement a paymentmethodselected event for PaymentRequest
3181         https://bugs.webkit.org/show_bug.cgi?id=178765
3182
3183         Reviewed by Tim Horton.
3184
3185         When the Apple Pay payment method changes, fire an applepaypaymentmethodchanged event on the
3186         PaymentRequest object. The event has a paymentMethod property and an updateWith() method
3187         which behaves identically to PaymentRequestUpdateEvent.updateWith().
3188
3189         Test: http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html
3190
3191         * DerivedSources.make:
3192         * Modules/applepay/ApplePayPaymentMethod.idl:
3193         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
3194         * Modules/applepay/PaymentMethod.h:
3195         (WebCore::PaymentMethod::PaymentMethod): Deleted.
3196         (WebCore::PaymentMethod::pkPaymentMethod const): Deleted.
3197         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3198         (WebCore::ApplePayPaymentHandler::detailsUpdated):
3199         (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
3200         (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
3201         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
3202         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Added.
3203         (WebCore::ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent):
3204         (WebCore::ApplePayPaymentMethodUpdateEvent::eventInterface const):
3205         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Added.
3206         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl: Added.
3207         * Modules/paymentrequest/PaymentHandler.h:
3208         * Modules/paymentrequest/PaymentRequest.cpp:
3209         (WebCore::PaymentRequest::shippingAddressChanged):
3210         (WebCore::PaymentRequest::shippingOptionChanged):
3211         (WebCore::PaymentRequest::dispatchEvent):
3212         (WebCore::PaymentRequest::updateWith):
3213         (WebCore::PaymentRequest::settleDetailsPromise):
3214         (WebCore::PaymentRequest::dispatchUpdateEvent): Deleted.
3215         * Modules/paymentrequest/PaymentRequest.h:
3216         * Modules/paymentrequest/PaymentRequest.idl:
3217         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
3218         (WebCore::PaymentRequestUpdateEvent::updateWith):
3219         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
3220         * WebCore.xcodeproj/project.pbxproj:
3221         * dom/EventNames.h:
3222         * dom/EventNames.in:
3223         * testing/MockPaymentCoordinator.cpp:
3224         (WebCore::MockPaymentCoordinator::changePaymentMethod):
3225         * testing/MockPaymentCoordinator.h:
3226         * testing/MockPaymentCoordinator.idl:
3227         * testing/MockPaymentMethod.h: Added.
3228
3229 2017-10-24  Youenn Fablet  <youenn@apple.com>
3230
3231         ServiceWorkerClientFetch should return an error that is not null in case of failure
3232         https://bugs.webkit.org/show_bug.cgi?id=178761
3233
3234         Reviewed by Geoffrey Garen.
3235
3236         Covered by existing tests.
3237
3238         As per spec, ServiceWorkerJob should not go through Service Worker Handle Fetch
3239         for fetching scripts.
3240
3241         * workers/WorkerScriptLoader.cpp:
3242         (WebCore::WorkerScriptLoader::loadAsynchronously):
3243         * workers/WorkerScriptLoaderClient.h:
3244         (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const):
3245         * workers/service/ServiceWorkerJob.h:
3246
3247 2017-10-24  Keith Miller  <keith_miller@apple.com>
3248
3249         Move inspector and loader to unified sources.
3250         https://bugs.webkit.org/show_bug.cgi?id=178760
3251
3252         Rubber-stamped by Tim Horton.
3253
3254         * CMakeLists.txt:
3255         * Sources.txt:
3256         * WebCore.xcodeproj/project.pbxproj:
3257
3258 2017-10-24  Alex Christensen  <achristensen@webkit.org>
3259
3260         Fix build after r223940
3261
3262         * inspector/WebConsoleAgent.cpp:
3263
3264 2017-10-24  Alex Christensen  <achristensen@webkit.org>
3265
3266         Fix Windows build after r223929.
3267         https://bugs.webkit.org/show_bug.cgi?id=177027
3268
3269         * inspector/WebConsoleAgent.cpp:
3270         (WebCore::WebConsoleAgent::getLoggingChannels):
3271         Always initialize the variable "level".  Visual studio was complaining about the possibility of not initializing it
3272         but this is only possible if logChannel->level is an invalid enum value.
3273
3274 2017-10-24  Alex Christensen  <achristensen@webkit.org>
3275
3276         Fix Windows build after r223925
3277         https://bugs.webkit.org/show_bug.cgi?id=178687
3278
3279         * html/ImageBitmap.cpp:
3280         (WebCore::interpolationQualityForResizeQuality):
3281         Visual Studio was complaining that not all control paths returned a value.
3282
3283 2017-10-24  Youenn Fablet  <youenn@apple.com>
3284
3285         Enable service worker to use cache storage api
3286         https://bugs.webkit.org/show_bug.cgi?id=178684
3287
3288         Reviewed by Brady Eidson.
3289
3290         Test: http/tests/workers/service/service-worker-cache-api.https.html
3291
3292         Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
3293         Update WorkerCacheStorageConnection to take benefit of that.
3294         This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.
3295
3296         Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
3297         It is in particular responsible to do proxy for loading tasks.
3298         It implements cache API support for service worker by creating a dedicated CacheStorageConnection.
3299
3300         * Modules/cache/WorkerCacheStorageConnection.cpp:
3301         (WebCore::WorkerCacheStorageConnection::create):
3302         (WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
3303         (WebCore::WorkerCacheStorageConnection::doOpen):
3304         (WebCore::WorkerCacheStorageConnection::doRemove):
3305         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
3306         (WebCore::WorkerCacheStorageConnection::reference):
3307         (WebCore::WorkerCacheStorageConnection::dereference):
3308         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
3309         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
3310         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
3311         * WebCore.xcodeproj/project.pbxproj:
3312         * workers/WorkerLoaderProxy.h:
3313         * workers/WorkerMessagingProxy.cpp:
3314         (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
3315         * workers/WorkerMessagingProxy.h:
3316         * workers/service/context/ServiceWorkerThread.cpp:
3317         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
3318         * workers/service/context/ServiceWorkerThread.h:
3319         * workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
3320         (WebCore::ServiceWorkerThreadProxy::create):
3321         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
3322         (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
3323         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
3324         (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
3325         * workers/service/context/ServiceWorkerThreadProxy.h: Added.
3326
3327 2017-10-24  Alex Christensen  <achristensen@webkit.org>
3328
3329         Optionally store entire ResourceRequest for ping loads
3330         https://bugs.webkit.org/show_bug.cgi?id=178756
3331
3332         Reviewed by Tim Horton.
3333
3334         No change in behavior.
3335         This uses less memory in the common loading case.
3336         This will be needed for moving appcache loading to the Networking Process.
3337         See https://bugs.webkit.org/show_bug.cgi?id=178540
3338
3339         * loader/cache/CachedResource.cpp:
3340         (WebCore::CachedResource::load):
3341         * loader/cache/CachedResource.h:
3342         (WebCore::CachedResource::setOriginalRequest):
3343         (WebCore::CachedResource::originalRequest const):
3344         (WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
3345         * loader/cache/CachedResourceLoader.cpp:
3346         (WebCore::CachedResourceLoader::requestResource):
3347
3348 2017-10-24  Andy Estes  <aestes@apple.com>
3349
3350         [WebIDL] Support the ExportMacro attribute for dictionaries
3351         https://bugs.webkit.org/show_bug.cgi?id=178752
3352
3353         Reviewed by Sam Weinig.
3354
3355         * bindings/scripts/CodeGeneratorJS.pm:
3356         (GenerateDictionaryHeaderContent):
3357         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
3358         * bindings/scripts/test/TestStandaloneDictionary.idl:
3359
3360 2017-10-24  Eric Carlson  <eric.carlson@apple.com>
3361
3362         Web Inspector: Enable WebKit logging configuration and display
3363         https://bugs.webkit.org/show_bug.cgi?id=177027
3364         <rdar://problem/33964767>
3365
3366         Reviewed by Joseph Pecoraro.
3367
3368         Test: inspector/console/webcore-logging.html
3369
3370         * dom/Document.cpp:
3371         (WebCore::Document::~Document): Stop observing the logger.
3372         (WebCore::Document::logger): Observe the logger.
3373         (WebCore::Document::didLogMessage): Forward logging messages to the inspector.
3374         * dom/Document.h:
3375
3376         * inspector/WebConsoleAgent.cpp:
3377         (WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
3378         (WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
3379         * inspector/WebConsoleAgent.h:
3380
3381         * platform/Logging.cpp:
3382         (WebCore::getLogChannel): New, get a log channel by name.
3383         * platform/Logging.h:
3384
3385 2017-10-24  Dean Jackson  <dino@apple.com>
3386
3387         Attempted build fix for Sierra.
3388
3389         * html/ImageBitmap.cpp:
3390         (WebCore::croppedSourceRectangleWithFormatting):
3391
3392 2017-10-24  Dean Jackson  <dino@apple.com>
3393
3394         Implement resizing options for ImageBitmap rendering
3395         https://bugs.webkit.org/show_bug.cgi?id=178687
3396         <rdar://problem/35135417>
3397
3398         Reviewed by Sam Weinig.
3399
3400         Implement many of the sizing options for createImageBitmap.
3401
3402         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html
3403
3404         * html/ImageBitmap.cpp:
3405         (WebCore::croppedSourceRectangleWithFormatting):
3406
3407             Implement the first bit of the algorithm from
3408             the HTML specification.
3409
3410         (WebCore::outputSizeForSourceRectangle):
3411
3412             ... and then the second bit. Leave the rest in
3413             comments for now.
3414
3415         (WebCore::interpolationQualityForResizeQuality):
3416
3417             Helper function to map ImageBitmapOptions to
3418             GraphicsContext.
3419
3420         (WebCore::ImageBitmap::createPromise):
3421
3422             Implement more of the sizing algorithm.
3423
3424         * html/ImageBitmap.h: Origin tainting is defined to be false by default.
3425
3426 2017-10-24  Chris Dumez  <cdumez@apple.com>
3427
3428         Add initial implementation for serviceWorker.postMessage()
3429         https://bugs.webkit.org/show_bug.cgi?id=178534
3430
3431         Reviewed by Youenn Fablet.
3432
3433         Add initial implementation for serviceWorker.postMessage():
3434         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
3435
3436         Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html
3437
3438         * CMakeLists.txt:
3439         * DerivedSources.make:
3440         * Sources.txt:
3441         * WebCore.xcodeproj/project.pbxproj:
3442         * bindings/js/JSBindingsAllInOne.cpp:
3443         * bindings/js/JSExtendableMessageEvent.cpp: Added.
3444         (WebCore::JSExtendableMessageEvent::data const):
3445         * bindings/js/WebCoreBuiltinNames.h:
3446         * dom/Document.h:
3447         * dom/EventNames.in:
3448         * dom/MessagePortChannel.h:
3449         * dom/ScriptExecutionContext.h:
3450         * workers/WorkerGlobalScope.h:
3451         * workers/service/ExtendableEvent.cpp:
3452         (WebCore::ExtendableEvent::ExtendableEvent):
3453         (WebCore::ExtendableEvent::~ExtendableEvent):
3454         * workers/service/ExtendableEvent.h:
3455         * workers/service/ExtendableMessageEvent.cpp: Added.
3456         (WebCore::ExtendableMessageEvent::create):
3457         (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
3458         (WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
3459         * workers/service/ExtendableMessageEvent.h: Added.
3460         * workers/service/ExtendableMessageEvent.idl: Added.
3461         * workers/service/ServiceWorker.cpp:
3462         (WebCore::ServiceWorker::ServiceWorker):
3463         (WebCore::ServiceWorker::postMessage):
3464         (WebCore::ServiceWorker::state const):
3465         (WebCore::ServiceWorker::scriptExecutionContext const):
3466         * workers/service/ServiceWorker.h:
3467         * workers/service/ServiceWorkerContainer.cpp:
3468         (WebCore::ServiceWorkerContainer::controller const):
3469         * workers/service/ServiceWorkerContainer.h:
3470         * workers/service/ServiceWorkerGlobalScope.cpp:
3471         (WebCore::ServiceWorkerGlobalScope::thread):
3472         * workers/service/ServiceWorkerGlobalScope.h:
3473         (isType):
3474         * workers/service/context/ServiceWorkerThread.cpp:
3475         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
3476         * workers/service/context/ServiceWorkerThread.h:
3477         * workers/service/server/SWClientConnection.h:
3478
3479 2017-10-24  Andy Estes  <aestes@apple.com>
3480
3481         [Payment Request] Implement the "PaymentRequest updated" algorithm
3482         https://bugs.webkit.org/show_bug.cgi?id=178689
3483
3484         Reviewed by Alex Christensen.
3485
3486         Implemented the "PaymentRequest updated" algorithm by firing shippingaddresschange and
3487         shippingoptionchange events at the right times and implementing
3488         PaymentRequestUpdateEvent.updateWith().
3489
3490         Tests: http/tests/paymentrequest/payment-request-change-shipping-address.https.html
3491                http/tests/paymentrequest/payment-request-change-shipping-option.https.html
3492                http/tests/paymentrequest/updateWith-method-pmi-handling.https.html
3493
3494         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3495         (WebCore::convertAndValidate): Added. Converts a PaymentDetailsInit to a
3496         ApplePaySessionPaymentRequest::TotalAndLineItems.
3497         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Created a ShippingContactUpdate
3498         and passed it to PaymentCoordinator::completeShippingContactSelection().
3499         (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): Created a ShippingMethodUpdate and
3500         passed it to PaymentCoordinator::completeShippingMethodSelection().
3501         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
3502         * Modules/paymentrequest/PaymentHandler.h:
3503         * Modules/paymentrequest/PaymentRequest.cpp:
3504         (WebCore::checkAndCanonicalizeDetails): Moved the logic for checking and canonicalizing a
3505         PaymentDetailsBase from PaymentRequest::create() to here.
3506         (WebCore::PaymentRequest::create): Called checkAndCanonicalizeDetails().
3507         (WebCore::PaymentRequest::abortWithException): Moved the body of stop() to here and
3508         parameterized the Exception with which to abort m_showPromise.
3509         (WebCore::PaymentRequest::stop): Called abortWithException() with an AbortError.
3510         (WebCore::PaymentRequest::shippingAddressChanged): Called dispatchUpdateEvent() with
3511         shippingaddresschangeEvent.
3512         (WebCore::PaymentRequest::shippingOptionChanged): Ditto with shippingoptionchangeEvent.
3513         (WebCore::PaymentRequest::dispatchUpdateEvent): Created a PaymentRequestUpdateEvent and
3514         dispatched it.
3515         (WebCore::PaymentRequest::updateWith): Added a settle handler to m_detailsPromise.
3516         (WebCore::PaymentRequest::settleDetailsPromise): Updated the PaymentRequest with the new
3517         details and called PaymentHandler::shippingAddressUpdated() or
3518         PaymentHandler::shippingOptionUpdated().
3519         * Modules/paymentrequest/PaymentRequest.h:
3520         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
3521         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
3522         (WebCore::PaymentRequestUpdateEvent::updateWith): Called PaymentRequest::updateWith().
3523         (WebCore::PaymentRequestUpdateEvent::eventInterface const): Returned
3524         PaymentRequestUpdateEventInterfaceType.
3525         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
3526         * Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
3527         * testing/MockPaymentCoordinator.cpp:
3528         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
3529         (WebCore::MockPaymentCoordinator::openPaymentSetup):
3530         (WebCore::MockPaymentCoordinator::completeMerchantValidation): Stopped calling
3531         PaymentCoordinator::didAuthorizePayment().
3532         (WebCore::MockPaymentCoordinator::changeShippingOption): Called
3533         PaymentCoordinator::didSelectShippingMethod().
3534         (WebCore::MockPaymentCoordinator::acceptPayment): Called
3535         PaymentCoordinator::didAuthorizePayment().
3536         * testing/MockPaymentCoordinator.h:
3537         * testing/MockPaymentCoordinator.idl:
3538
3539 2017-10-24  Alex Christensen  <achristensen@webkit.org>
3540
3541         Apply custom header fields from WebsitePolicies to same-domain requests
3542         https://bugs.webkit.org/show_bug.cgi?id=178356
3543         <rdar://problem/31073436>
3544
3545         Reviewed by Brady Eidson.
3546
3547         Covered by new API tests.
3548
3549         * loader/cache/CachedResourceLoader.cpp:
3550         (WebCore::CachedResourceLoader::requestResource):
3551         * platform/network/ResourceRequestBase.cpp:
3552         (WebCore::ResourceRequestBase::setCachePolicy):
3553         (WebCore::ResourceRequestBase::setTimeoutInterval):
3554         (WebCore::ResourceRequestBase::setHTTPMethod):
3555         (WebCore::ResourceRequestBase::setHTTPHeaderField):
3556         (WebCore::ResourceRequestBase::clearHTTPAuthorization):
3557         (WebCore::ResourceRequestBase::clearHTTPContentType):
3558         (WebCore::ResourceRequestBase::clearHTTPReferrer):
3559         (WebCore::ResourceRequestBase::clearHTTPOrigin):
3560         (WebCore::ResourceRequestBase::clearHTTPUserAgent):
3561         (WebCore::ResourceRequestBase::clearHTTPAccept):
3562         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
3563         (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
3564         (WebCore::ResourceRequestBase::setHTTPBody):
3565         (WebCore::ResourceRequestBase::setAllowCookies):
3566         (WebCore::ResourceRequestBase::setPriority):
3567         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
3568         (WebCore::ResourceRequestBase::addHTTPHeaderField):
3569         (WebCore::ResourceRequestBase::setHTTPHeaderFields):
3570         If we only update the platform request when headers are added (or other changes) for HTTP requests,
3571         then the changes will not affect the NSURLRequest that is sent over IPC or visible to the API.
3572         This is necessary for these new tests to work, but it's also of growing importance since our
3573         introduction of WKURLSchemeHandler.
3574
3575 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
3576
3577         Adopt new secure coding APIs
3578         https://bugs.webkit.org/show_bug.cgi?id=178484
3579         <rdar://problem/34837193>
3580
3581         Reviewed by Tim Horton.
3582
3583         Switch to new NSKeyed[Un]Archiver methods that active and use
3584         NSSecureCoding by default.
3585
3586         Most of the new API is wrapped in a set of convenience methods so we can
3587         build without the new API on older systems.
3588
3589         No change in behavior.
3590
3591         * editing/cocoa/EditorCocoa.mm:
3592         (WebCore::archivedDataForAttributedString): Use new convenience method
3593         to archive the string object.
3594         * loader/archive/cf/LegacyWebArchiveMac.mm:
3595         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
3596         use secure coding where possible.
3597         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
3598         * platform/ios/PlatformPasteboardIOS.mm:
3599         (WebCore::PlatformPasteboard::write): Use new secure API.
3600         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
3601         * testing/cocoa/WebArchiveDumpSupport.mm:
3602         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
3603         secure coding API where possible.
3604
3605 2017-10-24  Jeremy Jones  <jeremyj@apple.com>
3606
3607         HTMLMediaElement should iterate HTMLTrackElements consistently.
3608         https://bugs.webkit.org/show_bug.cgi?id=178423
3609         rdar://problem/35044967
3610
3611         Reviewed by Eric Carlson.
3612
3613         No new tests because no expected behavior change.
3614
3615         HTMLMediaElement iterates HTMLTrackElements as children in every place but one, where it iterates them
3616         as descendants. It should always iterate them as children.
3617
3618         * html/HTMLMediaElement.cpp:
3619         (WebCore::HTMLMediaElement::finishParsingChildren):
3620
3621 2017-10-24  Chris Dumez  <cdumez@apple.com>
3622
3623         SerializedScriptValue::deserialize() should take ports as a const Vector&
3624         https://bugs.webkit.org/show_bug.cgi?id=178727
3625
3626         Reviewed by Alex Christensen.
3627
3628         SerializedScriptValue::deserialize() should take ports as a const Vector&, not a Vector&.
3629         It does not modify the input vector.
3630
3631         * bindings/js/JSMessageEventCustom.cpp:
3632         (WebCore::JSMessageEvent::data const):
3633         * bindings/js/SerializedScriptValue.cpp:
3634         (WebCore::CloneDeserializer::deserialize):
3635         (WebCore::CloneDeserializer::CloneDeserializer):
3636         (WebCore::SerializedScriptValue::deserialize):
3637         * bindings/js/SerializedScriptValue.h:
3638
3639 2017-10-24  Konstantin Tokarev  <annulen@yandex.ru>
3640
3641         [MediaFoundation] Videos are always autoplaying for local files
3642         https://bugs.webkit.org/show_bug.cgi?id=178693
3643
3644         Patch by Doug Massay.
3645         Reviewed by Alex Christensen.
3646
3647         r199114 fixes autoplay issue only if starting session invokes
3648         buffering stage. However when local files are played, onBufferingStarted
3649         and onBufferingStopped are not called, and video is not paused.
3650
3651         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3652         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
3653         (WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
3654         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3655
3656 2017-10-24  Matt Lewis  <jlewis3@apple.com>
3657
3658         Unreviewed, rolling out r223889.
3659
3660         This caused multiple crashes on all platforms
3661
3662         Reverted changeset:
3663
3664         "Adopt new secure coding APIs"
3665         https://bugs.webkit.org/show_bug.cgi?id=178484
3666         https://trac.webkit.org/changeset/223889
3667
3668 2017-10-24  Antti Koivisto  <antti@apple.com>
3669
3670         Create inline wrappers for before/after pseudo elements that have display:contents
3671         https://bugs.webkit.org/show_bug.cgi?id=178722
3672
3673         Reviewed by Ryosuke Niwa.
3674
3675         We can handle before and after pseudo elements with display:contents by giving them
3676         inline renderers with style inherited from display:contents style. This removes
3677         need for complicated logic for this case and handles everything correctly.
3678
3679         This is a better approach and replaces the one taken in bug 178584.
3680         It also fixes two display:contents WPTs.
3681
3682         * dom/PseudoElement.h:
3683
3684             There is no need to track content renderers separately anymore. They always descendants of
3685             pseudo element's renderer (which is an inline wrapper in case of display:contents).
3686
3687         * rendering/style/RenderStyle.cpp:
3688         (WebCore::RenderStyle::copyContentFrom):
3689         * rendering/style/RenderStyle.h:
3690         * style/RenderTreeUpdaterGeneratedContent.cpp:
3691         (WebCore::createContentRenderers):
3692         (WebCore::updateStyleForContentRenderers):
3693         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
3694         (WebCore::removeAndDestroyContentRenderers): Deleted.
3695
3696             Since content renderers are now always descendants of the pseudo renderer
3697             there is no need for a separate destruction path.
3698
3699         * style/StyleTreeResolver.cpp:
3700         (WebCore::Style::TreeResolver::resolvePseudoStyle):
3701
3702             Create ElementUpdate with a style that will produce an inline wrapper.
3703
3704 2017-10-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3705
3706         [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
3707         https://bugs.webkit.org/show_bug.cgi?id=178713
3708         <rdar://problem/35115906>
3709
3710         Reviewed by Eric Carlson.
3711
3712         Loading AVFoundation should not be required to answer the question of MediaPlayer::isAvailable() on iOS, where
3713         both AVFoundation and CoreMedia frameworks should always exist. As such, we can bail early and return true to
3714         avoid always dynamically loading AVFoundation and CoreMedia.
3715
3716         * platform/graphics/MediaPlayer.cpp:
3717         (WebCore::MediaPlayer::isAvailable):
3718
3719 2017-10-24  Antoine Quint  <graouts@apple.com>
3720
3721         RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
3722         https://bugs.webkit.org/show_bug.cgi?id=178716
3723         <rdar://problem/35112900>
3724
3725         Reviewed by Dean Jackson.
3726
3727         * rendering/RenderThemeCocoa.mm:
3728         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
3729
3730 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
3731
3732         SizesAttributeParser::SizesAttributeParser triggers layout
3733         https://bugs.webkit.org/show_bug.cgi?id=178712
3734
3735         Reviewed by Antti Koivisto.
3736
3737         Revert r213711 as this change introduced an unwated synchronous layout inside Node::insertedIntoAncestor.
3738
3739         The test had been marked as timing out since r191379 and changed to failing expectation in r199225
3740         as the test result's error message changes from run to run.
3741
3742         Disabled Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
3743                         had been marked failing since r199225, prior to which it was marked as timeout in r191379.
3744                         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
3745                         is now marked as flaky.
3746
3747         * css/parser/SizesAttributeParser.cpp:
3748         (WebCore::SizesAttributeParser::SizesAttributeParser):
3749
3750 2017-10-24  Keith Miller  <keith_miller@apple.com>
3751
3752         Unreviewed, fix internal iOS build.
3753
3754         * Sources.txt:
3755
3756 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
3757
3758         Adopt new secure coding APIs
3759         https://bugs.webkit.org/show_bug.cgi?id=178484
3760         <rdar://problem/34837193>
3761
3762         Reviewed by Tim Horton.
3763
3764         Switch to new NSKeyed[Un]Archiver methods that active and use
3765         NSSecureCoding by default.
3766
3767         Most of the new API is wrapped in a set of convenience methods so we can
3768         build without the new API on older systems.
3769
3770         No change in behavior.
3771
3772         * editing/cocoa/EditorCocoa.mm:
3773         (WebCore::archivedDataForAttributedString): Use new convenience method
3774         to archive the string object.
3775         * loader/archive/cf/LegacyWebArchiveMac.mm:
3776         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
3777         use secure coding where possible.
3778         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
3779         * platform/ios/PlatformPasteboardIOS.mm:
3780         (WebCore::PlatformPasteboard::write): Use new secure API.
3781         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
3782         * testing/cocoa/WebArchiveDumpSupport.mm:
3783         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
3784         secure coding API where possible.
3785
3786 2017-10-24  Miguel Gomez  <magomez@igalia.com>
3787
3788         [GTK][X11] Windy.com shows always straight wind lines
3789         https://bugs.webkit.org/show_bug.cgi?id=176718
3790
3791         Reviewed by Carlos Garcia Campos.
3792
3793         WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2
3794         and a core profile. In that case, we need to replace it with GL_RG and swizzle the color
3795         components appropriately.
3796
3797         No new behavior.
3798
3799         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3800         (WebCore::GraphicsContext3D::texImage2D):
3801         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3802         (WebCore::GraphicsContext3D::texSubImage2D):
3803
3804 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
3805
3806         DocumentOrderedMap::add should release assert that tree scopes match
3807         https://bugs.webkit.org/show_bug.cgi?id=178708
3808
3809         Reviewed by Antti Koivisto.
3810
3811         Assert that the tree scope of element matches the given tree scope instead of asserting that
3812         element is in tree scope, and replaced the use of RELEASE_ASSERT by the newly added
3813         RELEASE_ASSERT_WITH_SECURITY_IMPLICATION to clarify the semantics of these assertions.
3814
3815         Also removed now redudnant early exits which would never execute due to release assertions.
3816
3817         * dom/DocumentOrderedMap.cpp:
3818         (WebCore::DocumentOrderedMap::add):
3819         (WebCore::DocumentOrderedMap::remove):
3820         (WebCore::DocumentOrderedMap::get const):
3821
3822 2017-10-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3823
3824         -Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
3825         https://bugs.webkit.org/show_bug.cgi?id=178698
3826
3827         Reviewed by Joseph Pecoraro.
3828
3829         * inspector/InspectorIndexedDBAgent.cpp:
3830
3831 2017-10-24  Antoine Quint  <graouts@apple.com>
3832
3833         [Web Animations] Add basic timing and target properties
3834         https://bugs.webkit.org/show_bug.cgi?id=178674
3835
3836         Reviewed by Dean Jackson.
3837
3838         We add three new interfaces to expose enough properties to establish basic timing properties,
3839         a start time and duration, and the target of an animation. The startTime property is set on
3840         the Animation object, the target is set on the KeyframeEffect set as the effect property on
3841         the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.
3842
3843         Tests: webanimations/animation-effect-timing.html
3844                webanimations/animation-effect.html
3845                webanimations/animation-interface-effect-property.html
3846                webanimations/animation-interface-start-time-property.html
3847                webanimations/keyframe-effect-interface-timing-duration.html
3848                webanimations/keyframe-effect.html
3849
3850         * CMakeLists.txt:
3851         * DerivedSources.make:
3852         * Sources.txt:
3853         * WebCore.xcodeproj/project.pbxproj:
3854         * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
3855         (WebCore::AnimationEffect::AnimationEffect):
3856         (WebCore::AnimationEffect::~AnimationEffect):
3857         * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
3858         (WebCore::AnimationEffect::isKeyframeEffect const):
3859         (WebCore::AnimationEffect::timing const):
3860         (WebCore::AnimationEffect::classType const):
3861         * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
3862         * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
3863         (WebCore::AnimationEffectTiming::create):
3864         (WebCore::AnimationEffectTiming::AnimationEffectTiming):
3865         (WebCore::AnimationEffectTiming::~AnimationEffectTiming):
3866         * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
3867         * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
3868         * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
3869         (WebCore::KeyframeEffect::create):
3870         (WebCore::KeyframeEffect::KeyframeEffect):
3871         * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
3872         * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
3873         * animation/WebAnimation.cpp:
3874         (WebCore::WebAnimation::setEffect):
3875         * animation/WebAnimation.h:
3876         * animation/WebAnimation.idl:
3877         * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
3878         (WebCore::toJSNewlyCreated):
3879         (WebCore::toJS):
3880         * bindings/js/WebCoreBuiltinNames.h:
3881
3882 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
3883
3884         RenderSVGModelObject::checkIntersection triggers layout
3885         https://bugs.webkit.org/show_bug.cgi?id=178710
3886
3887         Reviewed by Antti Koivisto.
3888
3889         Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.
3890
3891         * rendering/svg/RenderSVGModelObject.cpp:
3892         (WebCore::getElementCTM):
3893         * svg/SVGSVGElement.cpp:
3894         (WebCore::SVGSVGElement::getEnclosureList):
3895
3896 2017-10-24  Nan Wang  <n_wang@apple.com>
3897
3898         AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
3899         https://bugs.webkit.org/show_bug.cgi?id=178697
3900
3901         Reviewed by Chris Fleizach.
3902
3903         When we are calling _accessibilityMinValue and _accessibilityMaxValue on iOS, 
3904         it might cause crash if the AX object has already been detached. Fixed this 
3905         by adding the necessary checks.
3906
3907         Test: accessibility/ios-simulator/slider-min-value-crash.html
3908
3909         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3910         (-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
3911         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
3912
3913 2017-10-23  Keith Miller  <keith_miller@apple.com>
3914
3915         Unreviewed, restore unneeded all in ones.
3916
3917         * CMakeLists.txt:
3918
3919 2017-10-23  Commit Queue  <commit-queue@webkit.org>
3920
3921         Unreviewed, rolling out r223870 and r223871.
3922         https://bugs.webkit.org/show_bug.cgi?id=178702
3923
3924         broke the windows build (Requested by keith_miller on
3925         #webkit).
3926
3927         Reverted changesets:
3928
3929         "Add html, inspector, loader to unified sources"
3930         https://bugs.webkit.org/show_bug.cgi?id=178695
3931         https://trac.webkit.org/changeset/223870
3932
3933         "Unrievwed, fix windows build."
3934         https://trac.webkit.org/changeset/223871
3935
3936 2017-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3937
3938         Unreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
3939         https://bugs.webkit.org/show_bug.cgi?id=178618
3940         <rdar://problem/35108852>
3941
3942         * platform/MIMETypeRegistry.cpp:
3943         (WebCore::initializeSupportedImageMIMETypes):
3944
3945 2017-10-23  Keith Miller  <keith_miller@apple.com>
3946
3947         Unrievwed, fix windows build.
3948
3949         * CMakeLists.txt:
3950
3951 2017-10-23  Keith Miller  <keith_miller@apple.com>
3952
3953         Add html, inspector, loader to unified sources
3954         https://bugs.webkit.org/show_bug.cgi?id=178695
3955
3956         Rubber-stamped by Tim Horton.
3957
3958         * CMakeLists.txt:
3959         * Sources.txt:
3960         * WebCore.xcodeproj/project.pbxproj:
3961
3962 2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>
3963
3964         Web Inspector: Remove unused Console.setMonitoringXHREnabled
3965         https://bugs.webkit.org/show_bug.cgi?id=178617
3966
3967         Reviewed by Sam Weinig.
3968
3969         * inspector/InspectorInstrumentation.cpp:
3970         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
3971         * inspector/InspectorInstrumentation.h:
3972         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
3973         * inspector/WebConsoleAgent.cpp:
3974         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
3975         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
3976         * inspector/WebConsoleAgent.h:
3977         Remove XHR monitoring code.
3978
3979         * xml/XMLHttpRequest.h:
3980         * xml/XMLHttpRequest.cpp:
3981         (WebCore::XMLHttpRequest::send):
3982         (WebCore::XMLHttpRequest::didFinishLoading):
3983         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
3984         * xml/XMLHttpRequest.idl:
3985         Remove now unused state on XHR and ExecState requirement for send().
3986
3987 2017-10-23  Keith Miller  <keith_miller@apple.com>
3988
3989         Add dom, editing, fileapi, and history to unified sources
3990         https://bugs.webkit.org/show_bug.cgi?id=178694
3991
3992         Rubber-stamped by Tim Horton.
3993
3994         * CMakeLists.txt:
3995         * Sources.txt:
3996         * WebCore.xcodeproj/project.pbxproj:
3997
3998 2017-10-23  Keith Miller  <keith_miller@apple.com>
3999
4000         Move bridge, contentextensions, crypto, and css to unified sources.
4001         https://bugs.webkit.org/show_bug.cgi?id=178691
4002
4003         Reviewed by Tim Horton.
4004
4005         * CMakeLists.txt:
4006         * Sources.txt:
4007         * WebCore.xcodeproj/project.pbxproj:
4008
4009 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
4010
4011  &nbs