Unreviewed, rolling out r221461.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-09-06  Ryan Haddad  <ryanhaddad@apple.com>
2
3         Unreviewed, rolling out r221461.
4
5         The LayoutTest added with this change crashes under
6         GuardMalloc.
7
8         Reverted changeset:
9
10         "Add (entirely incorrect) fetching of ServiceWorker scripts."
11         https://bugs.webkit.org/show_bug.cgi?id=176179
12         http://trac.webkit.org/changeset/221461
13
14 2017-09-06  Devin Rousso  <webkit@devinrousso.com>
15
16         Web Inspector: Support overloaded CanvasRenderingContext2D actions with identical parameter counts
17         https://bugs.webkit.org/show_bug.cgi?id=176178
18         <rdar://problem/34192229>
19
20         Reviewed by Matt Baker.
21
22         Update existing tests.
23
24         * WebCore.xcodeproj/project.pbxproj:
25
26         * inspector/InspectorCanvas.cpp:
27         (WebCore::buildArrayForVector):
28         (WebCore::InspectorCanvas::buildAction):
29         Add another array to each action that contains a swizzle type for each parameter. This is
30         used by the frontend to determine how to regenerate the value from what is given in the JSON.
31
32         * inspector/RecordingSwizzleTypes.h: Added.
33         Contains a value-specified enum of types that translate into int values, which are mirrored
34         by an object in the frontend, that indicate the type of each parameter. This enum matches
35         the values in WI.Recording.Swizzle.
36
37 2017-09-06  Per Arne Vollan  <pvollan@apple.com>
38
39         [Win] WebCore failed to build, InbandTextTrackPrivateAVF: base class undefined.
40         https://bugs.webkit.org/show_bug.cgi?id=176431
41
42         Reviewed by Alex Christensen.
43
44         AVFoundation header detection should be done in WebCore because of build dependencies.
45
46         No new tests, covered by existing tests.
47
48         * AVFoundationSupport.py: Copied from Source/WTF/AVFoundationSupport.py.
49         * PlatformWin.cmake:
50         * config.h:
51         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
52         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
53
54 2017-09-06  Sam Weinig  <sam@webkit.org>
55
56         REGRESSION (r221598): Legacy "round" and "bevel" options can no longer be used with the legacy CanvasRenderingContext2D setLineJoin operation
57         https://bugs.webkit.org/show_bug.cgi?id=176461
58
59         Reviewed by Alex Christensen.
60
61         Tests: fast/canvas/canvas-strokePath-cap-join-legacy-functions-match-attribute.html
62                fast/canvas/canvas-strokePath-cap-join-legacy.html
63
64         * html/canvas/CanvasRenderingContext2D.cpp:
65         (WebCore::CanvasRenderingContext2D::setLineJoin):
66         
67             Fix silly typo, ifs -> else ifs.
68
69 2017-09-06  Per Arne Vollan  <pvollan@apple.com>
70
71         [Win] Compile errors in Document::updateTitleElement.
72         https://bugs.webkit.org/show_bug.cgi?id=176381
73
74         Reviewed by Alex Christensen.
75
76         MSVC is not able to compile the statement:
77         'auto result = boolExpression ? lambda1 : lambda2;'
78         where 'lambda1' and 'lambda2' have the same signature.
79
80         * dom/Document.cpp:
81         (WebCore::findHTMLTitle):
82         (WebCore::isHTMLTitle):
83         (WebCore::isHTMLTitleEligible):
84         (WebCore::findSVGTitle):
85         (WebCore::isSVGTitle):
86         (WebCore::isSVGTitleEligible):
87         (WebCore::Document::updateTitleElement):
88
89 2017-09-06  Brent Fulgham  <bfulgham@apple.com>
90
91         Deny third-party cookie creation for prevalent resources without interaction
92         https://bugs.webkit.org/show_bug.cgi?id=175232
93         <rdar://problem/33709386>
94
95         Reviewed by Alex Christensen.
96
97         Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's
98         settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie,
99         but destroy it at some arbitrary moment which is difficult for websites to work with.
100         
101         This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately,
102         which is what sites are expecting from Safari.
103
104         Tests: http/tests/loading/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html
105
106         * platform/network/NetworkStorageSession.h:
107         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
108         (WebCore::NetworkStorageSession::shouldPartitionCookies const): Revise for new naming.
109         (WebCore::NetworkStorageSession::shouldAllowThirdPartyCookies const): Allow third party cookies when the
110         user interaction property applies.
111         (WebCore::NetworkStorageSession::shouldBlockCookies const): Deny cookies for origins that are not allowed by
112         user interaction, and that are not being partitioned.
113         (WebCore::NetworkStorageSession::setPrevalentDomainsWithAndWithoutInteraction): Revise for new naming, and
114         to track prevalent origins with and without user interaction.
115         (WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts): Renamed to setPrevalentDomainsWithAndWithoutInteraction.
116         (WebCore::NetworkStorageSession::removePrevalentDomains): New helper function for testing.
117
118 2017-09-06  Tomas Popela  <tpopela@redhat.com>
119
120         Missing break in URLParser
121         https://bugs.webkit.org/show_bug.cgi?id=176357
122
123         Reviewed by Darin Adler.
124
125         Add a missing break so the currently set state is not overwritten
126         after the block. Found by Coverity scan.
127
128         * platform/URLParser.cpp:
129         (WebCore::URLParser::parse):
130
131 2017-09-06  Dominik Röttsches  <dominik.rottsches@intel.com>
132
133         [GTK] Bump freetype version to 2.8.0
134         https://bugs.webkit.org/show_bug.cgi?id=176351
135
136         Reviewed by Carlos Alberto Lopez Perez.
137
138         Retrieving line spacing info without metrics hinting - FreeType's metric hinting
139         uses rounding which results in the sum of ascent and descent being larger
140         than the line height. To work around this without globally disabling font metrics
141         hinting, I am temporarily creating a new cairo scaled font with metrics hinting
142         off and retrieving the height values from this one.
143
144         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
145         (WebCore::scaledFontWithoutMetricsHinting): New function to clone the existing font, only with metrics hinting
146         disabled.
147         (WebCore::Font::platformInit): Get height info from non-metrics hinted font, disable rounding for linespacing.
148
149 2017-09-06  Frédéric Wang  <fwang@igalia.com>
150
151         Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling
152         https://bugs.webkit.org/show_bug.cgi?id=174097
153
154         Reviewed by Darin Adler.
155
156         No new tests, behavior unchanged.
157
158         * WebCore.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegate.
159         * page/scrolling/ScrollingTreeScrollingNode.h: Make ScrollingTreeScrollingNodeDelegate a
160         friend so that it can access private members.
161         * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp: Added. New delegate class for a
162         scrolling node, which is used by the UI process.
163         (WebCore::ScrollingTreeScrollingNodeDelegate::ScrollingTreeScrollingNodeDelegate):
164         Constructor, taking the scrolling node as a parameter.
165         (WebCore::ScrollingTreeScrollingNodeDelegate::~ScrollingTreeScrollingNodeDelegate):
166         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingTree const): Expose the scrolling
167         tree containing the scrolling node.
168         (WebCore::ScrollingTreeScrollingNodeDelegate::lastCommittedScrollPosition const): Expose
169         the last committed scroll position of the scrolling node.
170         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h: Added.
171         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingNode): Expose the scrolling node.
172         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingNode const): Ditto.
173
174 2017-09-06  Manuel Rego Casasnovas  <rego@igalia.com>
175
176         [css-grid] grid shorthand should not reset the gutter properties
177         https://bugs.webkit.org/show_bug.cgi?id=176375
178
179         Reviewed by Sergio Villar Senin.
180
181         The CSS WG has resolved that the "grid" shorthand shouldn't reset
182         the gutter properties anymore:
183         https://github.com/w3c/csswg-drafts/issues/1036
184
185         This was originally implemented in r195529, so this is somehow
186         a revert of that change.
187
188         Test: imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html
189
190         * css/CSSProperties.json:
191         * css/parser/CSSPropertyParser.cpp:
192         (WebCore::CSSPropertyParser::consumeGridShorthand):
193
194 2017-09-06  Zan Dobersek  <zdobersek@igalia.com>
195
196         [WebGL2] Implement getActiveUniforms()
197         https://bugs.webkit.org/show_bug.cgi?id=175203
198
199         Reviewed by Darin Adler.
200
201         Align getActiveUniforms() WebIDL signature with the spec -- making it
202         return a WebGLAny object, making the program parameter non-nullable,
203         and making the uniformIndices parameter a sequence on GLuint values.
204
205         The getActiveUniforms() implementation in WebGL2RenderingContext
206         validates the passed-in program and parameter name and then calls the
207         GraphicsContext3D::getActiveUniforms() method, retrieving an array of
208         integers that represent values of the requested parameter name for
209         each uniform whose index was passed through uniformIndices.
210
211         Test: fast/canvas/webgl/webgl2-getActiveUniforms.html
212
213         * bindings/js/JSDOMConvertWebGL.cpp:
214         (WebCore::convertToJSValue):
215         * html/canvas/WebGL2RenderingContext.cpp:
216         (WebCore::WebGL2RenderingContext::getActiveUniforms):
217         * html/canvas/WebGL2RenderingContext.h:
218         * html/canvas/WebGL2RenderingContext.idl:
219         * html/canvas/WebGLAny.h:
220         * platform/graphics/GraphicsContext3D.h:
221         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
222         (WebCore::GraphicsContext3D::getActiveUniforms):
223
224 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
225
226         [WebCrypto] Downcast parameters and keys at the platform operation callsites
227         https://bugs.webkit.org/show_bug.cgi?id=176392
228
229         Reviewed by Sam Weinig.
230
231         Downcast to algorithm-specific parameter and key types in the shared
232         code that then invokes platform-specific operation implementations.
233         This reduces the duplicated downcasts across different implementations
234         that don't differ at all in this behavior.
235
236         Covered by existing tests.
237
238         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
239         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
240         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
241         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
242         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
243         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
244         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
245         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
246         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
247         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
248         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
249         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
250         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
251         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
252         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
253         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
254         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
255         (WebCore::CryptoAlgorithmAES_KW::wrapKey):
256         (WebCore::CryptoAlgorithmAES_KW::unwrapKey):
257         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
258         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
259         (WebCore::CryptoAlgorithmECDH::deriveBits):
260         * crypto/algorithms/CryptoAlgorithmECDH.h:
261         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
262         (WebCore::CryptoAlgorithmECDSA::sign):
263         (WebCore::CryptoAlgorithmECDSA::verify):
264         * crypto/algorithms/CryptoAlgorithmECDSA.h:
265         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
266         (WebCore::CryptoAlgorithmHKDF::deriveBits):
267         * crypto/algorithms/CryptoAlgorithmHKDF.h:
268         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
269         (WebCore::CryptoAlgorithmHMAC::sign):
270         (WebCore::CryptoAlgorithmHMAC::verify):
271         * crypto/algorithms/CryptoAlgorithmHMAC.h:
272         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
273         (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
274         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
275         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
276         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
277         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
278         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
279         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
280         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
281         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
282         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
283         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
284         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
285         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
286         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
287         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
288         (WebCore::CryptoAlgorithmRSA_PSS::sign):
289         (WebCore::CryptoAlgorithmRSA_PSS::verify):
290         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
291         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
292         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
293         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
294         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
295         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
296         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
297         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
298         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
299         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
300         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
301         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
302         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
303         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
304         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
305         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
306         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
307         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
308         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
309         (WebCore::CryptoAlgorithmECDSA::platformSign):
310         (WebCore::CryptoAlgorithmECDSA::platformVerify):
311         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
312         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
313         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
314         (WebCore::CryptoAlgorithmHMAC::platformSign):
315         (WebCore::CryptoAlgorithmHMAC::platformVerify):
316         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
317         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
318         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
319         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
320         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
321         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
322         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
323         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
324         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
325         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
326         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
327         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
328         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
329         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
330         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
331         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
332         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
333         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
334         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
335         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
336         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
337         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
338         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
339         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
340         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
341         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
342         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
343         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
344         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
345         * crypto/mac/CryptoAlgorithmECDHMac.cpp:
346         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
347         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
348         (WebCore::CryptoAlgorithmECDSA::platformSign):
349         (WebCore::CryptoAlgorithmECDSA::platformVerify):
350         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
351         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
352         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
353         (WebCore::CryptoAlgorithmHMAC::platformSign):
354         (WebCore::CryptoAlgorithmHMAC::platformVerify):
355         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
356         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
357         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
358         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
359         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
360         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
361         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
362         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
363         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
364         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
365         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
366         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
367         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
368         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
369
370 2017-09-05  Darin Adler  <darin@apple.com>
371
372         Fix a few minor problems found while working toward removing unneeded calls to updateStyle
373         https://bugs.webkit.org/show_bug.cgi?id=176279
374
375         Reviewed by Antti Koivisto.
376
377         * dom/Document.cpp:
378         (WebCore::Document::updateTitleElement): Fix the algorithm so that an SVG title won't
379         ever become the title when the document element is not an SVG element. We had this wrong
380         before but we were passing the test because SVGTitleElement::insertedInto had a bug that
381         hid the problem.
382         (WebCore::Document::titleElementAdded): Pass a reference instead of a pointer.
383         (WebCore::Document::titleElementRemoved): Pass a reference instead of nullptr since we
384         want to know which element is being removed.
385
386         * dom/Document.h: Update the argument name and type for updateTitleElement.
387
388         * html/HTMLTitleElement.cpp:
389         (WebCore::HTMLTitleElement::insertedInto): Call titleElementAdded unconditionally.
390         The checks to see if the title element is connected to the document and not in the
391         shadow tree are now handled by the Document class.
392         (WebCore::HTMLTitleElement::removedFrom): Same for titleElementRemoved.
393
394         * platform/mock/MockRealtimeVideoSource.cpp:
395         (WebCore::MockRealtimeVideoSource::applySize): Removed incorrect caching of FontCascade
396         objects; these need to be created each time we draw.
397         (WebCore::MockRealtimeVideoSource::drawText): Create all the fonts here. Since this is
398         a mock for testing, there is no real performance concern with doing this.
399         * platform/mock/MockRealtimeVideoSource.h: Removed the FontCascade data members.
400
401         * rendering/RenderTreeAsText.cpp:
402         (WebCore::updateLayoutIgnoringPendingStylesheetsIncludingSubframes): Added. Used below
403         to update layout more thoroughly.
404         (WebCore::externalRepresentation): Update layout of all descendant frames, not just
405         the top level frame.
406
407         * svg/SVGTitleElement.cpp:
408         (WebCore::SVGTitleElement::insertedInto): Removed bogus firstChild check, bogus isSVGDocument
409         check, and unneeded isConnected check and call titleElementAdded unconditionally. The checks
410         are now handled by the Document class.
411         (WebCore::SVGTitleElement::removedFrom): Same for titleElementRemoved.
412
413         * testing/Internals.cpp:
414         (WebCore::Internals::layerTreeAsText const): Added missing updateLayoutIgnorePendingStylesheets,
415         since dumping the layer tree without first doing a layout will yield stale results.
416         (WebCore::Internals::layerIDForElement): Added missing updateLayoutIgnorePendingStylesheets,
417         since using a renderer to check if a layer exists without first doing a layout will yield stale results.
418         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
419         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
420         (WebCore::Internals::displayListForElement): Ditto.
421         (WebCore::Internals::replayDisplayListForElement): Ditto.
422         (WebCore::Internals::isSelectPopupVisible): Added missing updateLayoutIgnorePendingStylesheets,
423         since working with the RenderMenuList without first doing a layout will yield stale results.
424         Also removed unneeded strict handling of null renderer, instead just returning false.
425         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Removed unnneeded check of
426         renderer class, since the HTMLPlugInElement::isReplacementObscured already handles that correctly.
427         (WebCore::Internals::pageOverlayLayerTreeAsText const): Use updateLayoutIgnorePendingStylesheets
428         instead of the normal updateLayout for consistency with the behavior of the other functions in this
429         file, and because we need a real answer here.
430         (WebCore::Internals::scrollSnapOffsets): Ditto. Also rearranged the code so the renderer check is
431         done after updating the renderer tree.
432
433 2017-09-05  Ryan Haddad  <ryanhaddad@apple.com>
434
435         Unreviewed, rolling out r221495.
436
437         This change introduced  assertion failures on El Capitan Debug
438         WK2.
439
440         Reverted changeset:
441
442         "Move ServiceWorkerJob from FetchLoader to ThreadableLoader."
443         https://bugs.webkit.org/show_bug.cgi?id=176231
444         http://trac.webkit.org/changeset/221495
445
446 2017-09-05  Chris Dumez  <cdumez@apple.com>
447
448         Add support for input.webkitEntries
449         https://bugs.webkit.org/show_bug.cgi?id=176257
450         <rdar://problem/34218671>
451
452         Reviewed by Andreas Kling.
453
454         Add support for input.webkitEntries as per:
455         - https://wicg.github.io/entries-api/#html-forms
456
457         Our behavior matches Chrome and Firefox, rather than the specification. This means
458         that webkitEntries is only populated if the webkitdirectory flag is unset.
459
460         Tests: fast/forms/file/entries-api/drag-folder-webkitEntries.html
461                fast/forms/file/entries-api/webkitdirectory-drag-folder-webkitEntries.html
462
463         * CMakeLists.txt:
464         * DerivedSources.make:
465         * Modules/entriesapi/HTMLInputElementEntriesAPI.cpp: Added.
466         (WebCore::HTMLInputElementEntriesAPI::webkitEntries):
467         * Modules/entriesapi/HTMLInputElementEntriesAPI.h: Added.
468         * Modules/entriesapi/HTMLInputElementEntriesAPI.idl: Added.
469         * WebCore.xcodeproj/project.pbxproj:
470         * bindings/scripts/generate-bindings.pl:
471         * bindings/scripts/test/JS/JSTestInterface.cpp:
472         (WebCore::jsTestInterfaceReflectAttributeGetter):
473         (WebCore::jsTestInterfaceReflectAttribute):
474         (WebCore::setJSTestInterfaceReflectAttributeSetter):
475         (WebCore::setJSTestInterfaceReflectAttribute):
476         * bindings/scripts/test/TestSupplemental.idl:
477         * html/HTMLInputElement.idl:
478
479 2017-09-05  Chris Dumez  <cdumez@apple.com>
480
481         FileSystemEntry API should ignore hidden files
482         https://bugs.webkit.org/show_bug.cgi?id=176292
483         <rdar://problem/34257666>
484
485         Reviewed by Andreas Kling.
486
487         FileSystemEntry API should ignore hidden files as the user likely does not mean
488         to expose those when drag'n dropping a folder.
489
490         Test: editing/pasteboard/enties-api/datatransfer-items-drop-hidden-file.html
491
492         * Modules/entriesapi/DOMFileSystem.cpp:
493         (WebCore::listDirectoryWithMetadata):
494         (WebCore::validatePathIsExpectedType):
495         (WebCore::fileType):
496         (WebCore::DOMFileSystem::getEntry):
497
498 2017-09-05  Myles C. Maxfield  <mmaxfield@apple.com>
499
500         Update font selection algorithm to match latest CSS spec
501         https://bugs.webkit.org/show_bug.cgi?id=175236
502
503         Reviewed by Darin Adler.
504
505         The CSS WG tweaked the generalization of the font selection
506         algorithm between levels 3 and 4. In particular, the behavior
507         of weights between 400 and 500 works a little differently.
508
509         https://github.com/w3c/csswg-drafts/commit/f6973a21847f1c200ed38bff05dc543cebe1c827
510
511         Test: fast/text/variations/font-selection-font-weight.html
512
513         * platform/graphics/FontSelectionAlgorithm.cpp:
514         (WebCore::FontSelectionAlgorithm::weightDistance const):
515         * platform/graphics/FontSelectionAlgorithm.h:
516         (WebCore::lowerWeightSearchThreshold):
517         (WebCore::upperWeightSearchThreshold):
518         (WebCore::weightSearchThreshold): Deleted.
519
520 2017-09-05  Per Arne Vollan  <pvollan@apple.com>
521
522         [Win] Compile errors in pathByAppendingComponents.
523         https://bugs.webkit.org/show_bug.cgi?id=176387
524
525         Reviewed by Brent Fulgham.
526
527         The pathByAppendingComponents function has changed signature.
528
529         * platform/win/FileSystemWin.cpp:
530         (WebCore::pathByAppendingComponents):
531
532 2017-09-05  Simon Fraser  <simon.fraser@apple.com>
533
534         Fix capitalization of scheduleinvalidateStyleAndLayerComposition
535         https://bugs.webkit.org/show_bug.cgi?id=176266
536
537         Reviewed by Antti Koivisto.
538
539         * html/HTMLFrameOwnerElement.cpp:
540         (WebCore::HTMLFrameOwnerElement::scheduleInvalidateStyleAndLayerComposition):
541         (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition): Deleted.
542         * html/HTMLFrameOwnerElement.h:
543         * rendering/RenderLayerCompositor.cpp:
544         (WebCore::RenderLayerCompositor::attachRootLayer):
545         (WebCore::RenderLayerCompositor::detachRootLayer):
546         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
547
548 2017-09-05  Matt Lewis  <jlewis3@apple.com>
549
550         Unreviewed, rolling out r221603.
551
552         This caused accessibility/mac/select-element-selection-with-
553         optgroups.html to consistently timeout on macOS
554
555         Reverted changeset:
556
557         "Fix a few minor problems found while working toward removing
558         unneeded calls to updateStyle"
559         https://bugs.webkit.org/show_bug.cgi?id=176279
560         http://trac.webkit.org/changeset/221603
561
562 2017-09-05  Youenn Fablet  <youenn@apple.com>
563
564         Allow retrieving Cache Storage records for a given URL only
565         https://bugs.webkit.org/show_bug.cgi?id=176202
566
567         Reviewed by Alex Christensen.
568
569         No observable change of behavior.
570
571         Adding a URL parameter to CacheStorageConnection::retrieveRecords.
572         If given URL is null, all records will be retrieved, which is useful for the keys method.
573         Other operations only need records that share the same URL (modulo query string and frag id).
574
575         * Modules/cache/Cache.cpp:
576         (WebCore::Cache::matchAll):
577         (WebCore::Cache::keys):
578         (WebCore::Cache::retrieveRecords):
579         (WebCore::Cache::queryCache):
580         * Modules/cache/Cache.h:
581         * Modules/cache/CacheStorageConnection.cpp:
582         (WebCore::CacheStorageConnection::retrieveRecords):
583         * Modules/cache/CacheStorageConnection.h:
584         (WebCore::CacheStorageConnection::doRetrieveRecords):
585         * Modules/cache/WorkerCacheStorageConnection.cpp:
586         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
587         * Modules/cache/WorkerCacheStorageConnection.h:
588         * platform/URL.h:
589
590 2017-09-05  Tim Horton  <timothy_horton@apple.com>
591
592         Remove some unused bits of code and resources
593         https://bugs.webkit.org/show_bug.cgi?id=176275
594
595         Reviewed by Dan Bernstein.
596
597         No new tests, just removing things.
598
599         * Resources/textAreaResizeCorner.tiff: Removed.
600         * Resources/missingImage.tiff: Removed.
601         These files have PNG versions that include more resolutions.
602
603         * Resources/hScrollControl_left.png: Removed.
604         * Resources/hScrollControl_middle.png: Removed.
605         * Resources/hScrollControl_right.png: Removed.
606         * Resources/vScrollControl_bottom.png: Removed.
607         * Resources/vScrollControl_middle.png: Removed.
608         * Resources/vScrollControl_top.png: Removed.
609         * Resources/decrementArrow.tiff: Removed.
610         * Resources/incrementArrow.tiff: Removed.
611         * Resources/markedLeft.png: Removed.
612         * Resources/markedMiddle.png: Removed.
613         * Resources/markedRight.png: Removed.
614         These were added in r161638 as part of the iOS upstreaming, but were
615         unused even then.
616
617         * Resources/inputSpeech.tiff: Removed.
618         The feature this image was for was removed in r172259; the PNG version
619         of this image was removed in r172384.
620
621         * WebCore.xcodeproj/project.pbxproj:
622         * platform/ios/FileSystemIOS.h: Removed.
623         * platform/ios/FileSystemIOS.mm: Removed.
624         Remove FileSystemIOS; one function is unused, the other is not at all
625         iOS-specific and can be folded into FileSystemCocoa.
626
627         * platform/FileSystem.h:
628         * platform/cocoa/FileSystemCocoa.mm:
629         (WebCore::createTemporaryDirectory):
630         Move this in from FileSystemIOS.
631
632         * platform/PlatformEvent.cpp: Removed.
633         Remove this unused file.
634         
635         * platform/ios/QuickLook.mm:
636         * platform/ios/WebItemProviderPasteboard.mm:
637         Include FileSystem instead of FileSystemIOS.
638
639 2017-09-05  Frederic Wang  <fwang@igalia.com>
640
641         Use TilesBacking for iframes when async frame scrolling is enabled
642         https://bugs.webkit.org/show_bug.cgi?id=173644
643
644         Reviewed by Simon Fraser.
645
646         This patch adds creation of TilesBacking for non-main frames when async frame scrolling is
647         enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect
648         that tiled backing is not exclusive to the main frame. More adjustments might be needed for
649         non-main frames and will be handled in follow-up commits.
650
651         Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
652
653         * rendering/RenderLayerBacking.cpp: Rename m_isMainFrameLayerWithTiledBacking
654         * rendering/RenderLayerBacking.h: Rename isMainFrameLayerWithTiledBacking and
655         m_isMainFrameLayerWithTiledBacking.
656         * rendering/RenderLayerCompositor.cpp: Use isFrameLayerWithTiledBacking
657
658 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
659
660         HTMLMediaElement: attach any existing EME CDMInstance in mediaEngineWasUpdated()
661         https://bugs.webkit.org/show_bug.cgi?id=176354
662
663         Reviewed by Xabier Rodriguez-Calvar.
664
665         It's common for MediaKeys to be set on an HTMLMediaElement object before
666         any resource is loaded for that element, meaning no underlying MediaPlayer
667         exists at that point. In order to not stall the pipeline when encrypted
668         content is finally loaded, the CDMInstance object of the current MediaKeys
669         set on this element should be attached in mediaEngineWasUpdated() that's
670         called whenever the underlying MediaPlayerPrivate object is replaced.
671
672         * html/HTMLMediaElement.cpp:
673         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
674
675 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
676
677         [EME] HTMLMediaElement: setMediaKeys() should attach CDMInstance from the arriving MediaKeys
678         https://bugs.webkit.org/show_bug.cgi?id=176352
679
680         Reviewed by Xabier Rodriguez-Calvar.
681
682         In HTMLMediaElement::setMediaKeys(), use the incoming MediaKeys object
683         to retrieve the CDMInstance that is then attached to the current
684         MediaPlayer, if any.
685
686         Covered by existing W3C tests that focus on multi-key use cases.
687
688         * html/HTMLMediaElement.cpp:
689         (WebCore::HTMLMediaElement::setMediaKeys):
690
691 2017-09-05  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
692
693         [Win] Fix the wincairo build after r221558 and r221583
694         https://bugs.webkit.org/show_bug.cgi?id=176353
695
696         Reviewed by Yusuke Suzuki.
697
698         * platform/win/FileSystemWin.cpp:
699         (WebCore::isSymbolicLink): Fix a "missing type specifier" error
700         (WebCore::findDataToFileMetadata): Fix a narrowing convertion error
701
702 2017-09-04  Chris Dumez  <cdumez@apple.com>
703
704         Use StringView more in DOMFileSystem code
705         https://bugs.webkit.org/show_bug.cgi?id=176347
706
707         Reviewed by Darin Adler.
708
709         * Modules/entriesapi/DOMFileSystem.cpp:
710         (WebCore::resolveRelativeVirtualPath):
711         (WebCore::DOMFileSystem::evaluatePath):
712         * platform/FileSystem.h:
713         * platform/glib/FileSystemGlib.cpp:
714         (WebCore::pathByAppendingComponents):
715         * platform/posix/FileSystemPOSIX.cpp:
716         (WebCore::pathByAppendingComponents):
717         * platform/win/FileSystemWin.cpp:
718         (WebCore::pathByAppendingComponents):
719
720 2017-09-04  Eric Carlson  <eric.carlson@apple.com>
721
722         Switch HTMLMediaElement to release logging
723         https://bugs.webkit.org/show_bug.cgi?id=176065
724
725         Reviewed by Jer Noble.
726
727         * dom/Document.cpp:
728         (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
729         mode is enabled.
730         (WebCore::Document::logger const):
731         * dom/Document.h:
732
733         Convert debug-only logging to configurable release logging.
734         * html/HTMLMediaElement.cpp:
735         (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
736         String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
737         * html/HTMLMediaElement.h:
738
739 2017-09-04  Sam Weinig  <sam@webkit.org>
740
741         [Canvas] Move non-standard functionality/aliases back to CanvasRenderingContext2D.idl
742         https://bugs.webkit.org/show_bug.cgi?id=176340
743
744         Reviewed by Darin Adler.
745
746         In r221598 (https://webkit.org/b/176276), the CanvasRenderingContext2D was split out into
747         separate interfaces to the match the spec and prepare for implementing OffscreenCanvas. While
748         doing that, related non-standard functionality and aliases were moved as well. In retrospect,
749         that doesn't really makes sense, as we don't want to add these legacy properties to any new
750         interfaces that happen to implement/use the broken out interfaces. Since they are specific
751         to CanvasRenderingContext2D, let's move them back.
752
753         * html/canvas/CanvasCompositing.idl:
754         * html/canvas/CanvasDrawImage.idl:
755         * html/canvas/CanvasFillStrokeStyles.idl:
756         * html/canvas/CanvasImageData.idl:
757         * html/canvas/CanvasImageSmoothing.idl:
758         * html/canvas/CanvasPathDrawingStyles.idl:
759         * html/canvas/CanvasShadowStyles.idl:
760         * html/canvas/CanvasRenderingContext2D.idl:
761
762             Move non-standard operation and attributes back to CanvasRenderingContext2D.idl.
763
764             * html/canvas/CanvasRenderingContext2D.h:
765         * html/canvas/CanvasRenderingContext2D.cpp:
766         (WebCore::CanvasRenderingContext2D::stringForCanvasFillRule): Deleted.
767             
768             Remove unused function.
769
770         (WebCore::CanvasRenderingContext2D::setAlpha): Deleted.
771         (WebCore::CanvasRenderingContext2D::setCompositeOperation): Deleted.
772
773             Removed. Instead, the IDL uses [ImplementedAs] to forward to the 
774             underlying setGlobalAlpha/setGlobalCompositeOperation. This reduces
775             code and makes it clear they are strict aliases.
776
777 2017-09-03  Darin Adler  <darin@apple.com>
778
779         Fix a few minor problems found while working toward removing unneeded calls to updateStyle
780         https://bugs.webkit.org/show_bug.cgi?id=176279
781
782         Reviewed by Antti Koivisto.
783
784         * dom/Document.cpp:
785         (WebCore::Document::updateTitleElement): Fix the algorithm so that an SVG title won't
786         ever become the title when the document element is not an SVG element. We had this wrong
787         before but we were passing the test because SVGTitleElement::insertedInto had a bug that
788         hid the problem.
789         (WebCore::Document::titleElementAdded): Pass a reference instead of a pointer.
790         (WebCore::Document::titleElementRemoved): Pass a reference instead of nullptr since we
791         want to know which element is being removed.
792
793         * dom/Document.h: Update the argument name and type for updateTitleElement.
794
795         * html/HTMLTitleElement.cpp:
796         (WebCore::HTMLTitleElement::insertedInto): Call titleElementAdded unconditionally.
797         The checks to see if the title element is connected to the document and not in the
798         shadow tree are now handled by the Document class.
799         (WebCore::HTMLTitleElement::removedFrom): Same for titleElementRemoved.
800
801         * platform/mock/MockRealtimeVideoSource.cpp:
802         (WebCore::MockRealtimeVideoSource::applySize): Removed incorrect caching of FontCascade
803         objects; these need to be created each time we draw.
804         (WebCore::MockRealtimeVideoSource::drawText): Create all the fonts here. Since this is
805         a mock for testing, there is no real performance concern with doing this.
806         * platform/mock/MockRealtimeVideoSource.h: Removed the FontCascade data members.
807
808         * rendering/RenderTreeAsText.cpp:
809         (WebCore::updateLayoutIgnoringPendingStylesheetsIncludingSubframes): Added. Used below
810         to update layout more thoroughly.
811         (WebCore::externalRepresentation): Update layout of all descendant frames, not just
812         the top level frame.
813
814         * svg/SVGTitleElement.cpp:
815         (WebCore::SVGTitleElement::insertedInto): Removed bogus firstChild check, bogus isSVGDocument
816         check, and unneeded isConnected check and call titleElementAdded unconditionally. The checks
817         are now handled by the Document class.
818         (WebCore::SVGTitleElement::removedFrom): Same for titleElementRemoved.
819
820         * testing/Internals.cpp:
821         (WebCore::Internals::layerTreeAsText const): Added missing updateLayoutIgnorePendingStylesheets,
822         since dumping the layer tree without first doing a layout will yield stale results.
823         (WebCore::Internals::layerIDForElement): Added missing updateLayoutIgnorePendingStylesheets,
824         since using a renderer to check if a layer exists without first doing a layout will yield stale results.
825         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
826         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
827         (WebCore::Internals::displayListForElement): Ditto.
828         (WebCore::Internals::replayDisplayListForElement): Ditto.
829         (WebCore::Internals::isSelectPopupVisible): Added missing updateLayoutIgnorePendingStylesheets,
830         since working with the RenderMenuList without first doing a layout will yield stale results.
831         Also removed unneeded strict handling of null renderer, instead just returning false.
832         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Removed unnneeded check of
833         renderer class, since the HTMLPlugInElement::isReplacementObscured already handles that correctly.
834         (WebCore::Internals::pageOverlayLayerTreeAsText const): Use updateLayoutIgnorePendingStylesheets
835         instead of the normal updateLayout for consistency with the behavior of the other functions in this
836         file, and because we need a real answer here.
837         (WebCore::Internals::scrollSnapOffsets): Ditto. Also rearranged the code so the renderer check is
838         done after updating the renderer tree.
839
840 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
841
842         Remove OS(SOLARIS) support
843         https://bugs.webkit.org/show_bug.cgi?id=176341
844
845         Reviewed by Sam Weinig.
846
847         * bindings/scripts/preprocessor.pm:
848         (applyPreprocessor):
849         * dom/make_names.pl:
850         * inspector/InspectorFrontendHost.cpp:
851         (WebCore::InspectorFrontendHost::platform):
852         * page/Page.h:
853
854 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
855
856         Unreviewed, fixing unused constant for initial buffer size
857         https://bugs.webkit.org/show_bug.cgi?id=176310
858
859         Follow-up patch after r221583. Pointed by darin@.
860
861         * platform/graphics/win/FontPlatformDataWin.cpp:
862         (WebCore::FontPlatformData::FontPlatformData):
863
864 2017-09-04  Sam Weinig  <sam@webkit.org>
865
866         [Canvas] Split CanvasRenderingContext2D.idl into separate IDLs to match current HTML spec
867         https://bugs.webkit.org/show_bug.cgi?id=176276
868
869         Reviewed by Dean Jackson.
870
871         - Splits CanvasRenderingContext2D.idl out into:
872             CanvasState
873             CanvasTransform
874             CanvasCompositing
875             CanvasImageSmoothing
876             CanvasFillStrokeStyles
877             CanvasShadowStyles
878             CanvasFilters
879             CanvasRect
880             CanvasDrawPath
881             CanvasUserInterface
882             CanvasText
883             CanvasDrawImage
884             CanvasImageData
885             CanvasPathDrawingStyles
886             CanvasTextDrawingStyles
887         - Renames CanvasWindingRule enum to CanvasFillRule, and moves it to its own file
888           so it can be reused by multiple IDLs.
889         - Renames DOMPath to Path2D, which is what it is supposed to be called, and doesn't
890           conflict with any WebCore names.
891         - Converts lineCap, lineJoin, textAlign, textBaseline, direction to use enums, rather
892           than DOMStrings, allowing us to remove a bunch of custom parsing.
893         - Non-standard canvas API was grouped with related functionality in the broken out
894           IDLs and clearly marked as non-standard.
895         - Comments were added for places where we break with the standard, mostly around use
896           of float where we should be using double.
897
898         * CMakeLists.txt:
899         * DerivedSources.cpp:
900         * DerivedSources.make:
901         * WebCore.xcodeproj/project.pbxproj:
902         
903             Add new files.
904         
905         * bindings/js/CallTracerTypes.h:
906         * inspector/InspectorCanvas.cpp:
907         (WebCore::InspectorCanvas::buildInitialState):
908         (WebCore::InspectorCanvas::buildAction):
909
910             Update for renames, and use new convertEnumerationToString to
911             serialize enumerations.
912         
913         * bindings/scripts/CodeGeneratorJS.pm:
914         (GenerateEnumerationImplementationContent):
915         (GenerateEnumerationHeaderContent):
916
917             Split string conversion out of convertEnumerationToJS, and into
918             its own function, convertEnumerationToString, to allow serialization
919             to string outside of the bindings context, in this case, for the 
920             InspectorCanvas.
921
922         (GenerateParametersCheck):
923         
924             Improve error message to make it clear which operation has the issue
925             in order to make debugging easier.
926
927         * html/ImageData.idl:
928         
929             Re-order constructors to match specification, and add FIXME for incorrect
930             default argument.
931         
932         * html/TextMetrics.idl:
933             
934             Add spec'd exposure and spec comments, as well a FIXME to convert the
935             unrestricted float parameters should be doubles.
936
937         * html/canvas/CanvasCompositing.idl: Added.
938         * html/canvas/CanvasDirection.h: Added.
939         * html/canvas/CanvasDirection.idl: Added.
940         * html/canvas/CanvasDrawImage.idl: Added.
941         * html/canvas/CanvasDrawPath.idl: Added.
942         * html/canvas/CanvasFillRule.h: Added.
943         * html/canvas/CanvasFillRule.idl: Added.
944         * html/canvas/CanvasFillStrokeStyles.idl: Added.
945         * html/canvas/CanvasFilters.idl: Added.
946         * html/canvas/CanvasImageData.idl: Added.
947         * html/canvas/CanvasImageSmoothing.idl: Added.
948         * html/canvas/CanvasLineCap.h: Added.
949         * html/canvas/CanvasLineCap.idl: Added.
950         * html/canvas/CanvasLineJoin.h: Added.
951         * html/canvas/CanvasLineJoin.idl: Added.
952         * html/canvas/CanvasPathDrawingStyles.idl: Added.
953         * html/canvas/CanvasRect.idl: Added.
954         * html/canvas/CanvasShadowStyles.idl: Added.
955         * html/canvas/CanvasState.idl: Added.
956         * html/canvas/CanvasText.idl: Added.
957         * html/canvas/CanvasTextAlign.h: Added.
958         * html/canvas/CanvasTextAlign.idl: Added.
959         * html/canvas/CanvasTextBaseline.h: Added.
960         * html/canvas/CanvasTextBaseline.idl: Added.
961         * html/canvas/CanvasTextDrawingStyles.idl: Added.
962         * html/canvas/CanvasTransform.idl: Added.
963         * html/canvas/CanvasUserInterface.idl: Added.
964         * html/canvas/ImageSmoothingQuality.h: Added.
965         * html/canvas/ImageSmoothingQuality.idl: Added.
966
967             Move CanvasRenderingContext2D.idl content into separate files to
968             match the specification.
969
970         * html/canvas/CanvasGradient.idl:
971         * html/canvas/CanvasPath.idl:
972         * html/canvas/CanvasPattern.idl:
973
974             Add exposure and FIXMEs on changes need to match the spec.
975
976         * html/canvas/CanvasRenderingContext2D.cpp:
977         * html/canvas/CanvasRenderingContext2D.h:
978
979             Switch to using enums for lineCap, lineJoin, textAlign, textBaseline, and direction.
980             Rather than using the parsing / stringifying functions from GraphicsTypes, add simple
981             switch based to/from converters to convert to/from the canvas type to the platform
982             type. Also update for rename of DOMPath -> Path2D and WindingRule -> CanvasFillRule.
983
984             Unfortunately, not all custom parsing could be removed. To support the legacy functions
985             setLineCap and setLineJoin, which take Strings, two simply parse paths had to be
986             brought back. They can't use the enums, because the rules for enums as parameters
987             is stricter that what was implemented in the custom code (e.g. the bindings would
988             have thrown for strings not in the enum set).
989
990         * html/canvas/CanvasRenderingContext2D.idl:
991
992             Move most of the functions into the new files, which are then 'implemented' by
993             this.
994
995         * html/canvas/DOMPath.cpp: Removed.
996         * html/canvas/DOMPath.h: Removed.
997         * html/canvas/DOMPath.idl: Removed.
998         * html/canvas/Path2D.cpp: Copied from Source/WebCore/html/canvas/DOMPath.cpp.
999         * html/canvas/Path2D.h: Copied from Source/WebCore/html/canvas/DOMPath.h.
1000         * html/canvas/Path2D.idl: Copied from Source/WebCore/html/canvas/DOMPath.idl.
1001
1002             Rename DOMPath to Path2D to match the spec..
1003
1004         * platform/graphics/GraphicsTypes.cpp:
1005         (WebCore::parseLineCap): Deleted.
1006         (WebCore::lineCapName): Deleted.
1007         (WebCore::parseLineJoin): Deleted.
1008         (WebCore::lineJoinName): Deleted.
1009         (WebCore::textAlignName): Deleted.
1010         (WebCore::parseTextAlign): Deleted.
1011         (WebCore::textBaselineName): Deleted.
1012         (WebCore::parseTextBaseline): Deleted.
1013         * platform/graphics/GraphicsTypes.h:
1014
1015             Remove now unused parsing / stringifying functions.
1016
1017         * testing/Internals.cpp:
1018
1019             Remove unused #include.
1020
1021         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1022         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
1023         * bindings/scripts/test/JS/JSTestObj.cpp:
1024         * bindings/scripts/test/JS/JSTestObj.h:
1025         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1026         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1027         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
1028         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
1029
1030             Update test results to add convertEnumerationToString.
1031
1032 2017-09-03  Darin Adler  <darin@apple.com>
1033
1034         Follow up FrameView::updateLayoutAndStyleIfNeededRecursive changes with related improvements
1035         https://bugs.webkit.org/show_bug.cgi?id=176277
1036
1037         Reviewed by Antti Koivisto.
1038
1039         * page/FrameView.cpp:
1040         (WebCore::FrameView::needsStyleRecalcOrLayout): Deleted. This function was only used
1041         by an assertion inside updateLayoutAndStyleIfNeededRecursive, and thus there is no reason
1042         for it to be in the header file, or for it to be a public member function.
1043         (WebCore::appendRenderedChildren): Deleted. This function was only used inside
1044         updateLayoutAndStyleIfNeededRecursive, and it is now packaged in an even better way
1045         for efficient use inside that function.
1046         (WebCore::FrameView::renderedChildFrameViews): Deleted. This function was only used
1047         inside needsStyleRecalcOrLayout, and it's now packaged in a better way inside that function.
1048         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Created a new lambda called
1049         nextRendereredDescendant that packages up the process of repeatedly iterating this view
1050         and all of its descendants in an easy-to-use way. Replaces both of the functions above.
1051         Rewrote to use it; it made the logic clear enough that it was good to get rid of the
1052         updateOneFrame lambda, too. Added two separate functions, one that checks for needed
1053         style recalculation and a separate one that checked for needed layout. Using those,
1054         replaced the old single assertion with two separate assertions.
1055
1056         * page/FrameView.h: Removed needsStyleRecalcOrLayout, renderedChildFrameViews, and
1057         FrameViewList.
1058
1059 2017-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1060
1061         [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session
1062         https://bugs.webkit.org/show_bug.cgi?id=176264
1063         <rdar://problem/31144674>
1064
1065         Reviewed by Darin Adler.
1066
1067         Makes some small adjustments to WebItemProviderPasteboard. Rather than just -setItemProviders: on the
1068         WebItemProviderPasteboard when initiating a drag, also stage the WebItemProviderRegistrationList that will be
1069         used to generate an item provider. While it would be cleaner to avoid directly setting item providers so we
1070         don't overwrite item providers on the WebItemProviderPasteboard when adding items to an existing drag session,
1071         this isn't possible without breaking binary compability with older UIKit versions.
1072
1073         Importantly, WKContentView will now ignore any item providers that have been set on the
1074         WebItemProviderPasteboard when initiating a drag or adding items to an existing drag session, and instead only
1075         consider the staged registration list when generating item providers for dragging. This only has the drawback of
1076         generating an unnecessary item provider, but otherwise maintains backwards compatibility while allowing us to
1077         provide WebKit2 support for multiple items per drag session.
1078
1079         Tests: DataInteractionTests.DragEventClientCoordinatesBasic
1080                DataInteractionTests.DragEventClientCoordinatesWithScrollOffset
1081                DataInteractionTests.DragEventPageCoordinatesBasic
1082                DataInteractionTests.DragEventPageCoordinatesWithScrollOffset
1083
1084         * platform/ios/AbstractPasteboard.h:
1085         * platform/ios/PlatformPasteboardIOS.mm:
1086         (WebCore::registerItemToPasteboard):
1087
1088         Changed to only stage registration info on the item provider pasteboard, if possible. This has no effect on the
1089         copy/paste codepath, since it uses a UIPasteboard.
1090
1091         * platform/ios/WebItemProviderPasteboard.h:
1092         * platform/ios/WebItemProviderPasteboard.mm:
1093
1094         Rename _registrationInfoLists to _stagedRegistrationInfoList, and change it from an array of registration info
1095         lists to a single registration info list. This could be updated in the future to be an array of registration
1096         lists, but currently, it serves no purpose and makes coordination with DragItem info more difficult. This would
1097         need to support multiple registration lists if we are to add a way to begin a drag containing multiple items in
1098         vanilla web content, such as dragging multiple selections.
1099
1100         (-[WebItemProviderPasteboard init]):
1101         (-[WebItemProviderPasteboard setItemProviders:]):
1102         (-[WebItemProviderPasteboard stageRegistrationList:]):
1103
1104         Sets the staged item provider registration list.
1105
1106         (-[WebItemProviderPasteboard takeRegistrationList]):
1107
1108         Removes the staged item provider registration list from the WebItemProviderPasteboard and also returns it.
1109
1110         (-[WebItemProviderPasteboard registrationInfoAtIndex:]): Deleted.
1111         (-[WebItemProviderPasteboard setRegistrationInfoLists:]): Deleted.
1112
1113 2017-09-04  Commit Queue  <commit-queue@webkit.org>
1114
1115         Unreviewed, rolling out r221494 and r221500.
1116         https://bugs.webkit.org/show_bug.cgi?id=176258
1117
1118         This caused the windows build to fail. (Requested by mlewis13
1119         on #webkit).
1120
1121         Reverted changesets:
1122
1123         "Switch HTMLMediaElement to release logging"
1124         https://bugs.webkit.org/show_bug.cgi?id=176065
1125         http://trac.webkit.org/changeset/221494
1126
1127         "Switch HTMLMediaElement to release logging"
1128         https://bugs.webkit.org/show_bug.cgi?id=176065
1129         http://trac.webkit.org/changeset/221500
1130
1131 2017-09-04  Sam Weinig  <sam@webkit.org>
1132
1133         [WebIDL] Simplify EnabledBySettings generation
1134         https://bugs.webkit.org/show_bug.cgi?id=176312
1135
1136         Reviewed by Darin Adler.
1137
1138         * bindings/scripts/CodeGeneratorJS.pm:
1139         (NeedsRuntimeCheck):
1140         (OperationShouldBeOnInstance):
1141         (GeneratePropertiesHashTable):
1142         (GenerateRuntimeEnableConditionalString):
1143         (GenerateImplementation):
1144         (GenerateAttributeGetterBodyDefinition):
1145
1146             - Simplify the [EnabledBySetting] code generation by merging it with the other
1147             runtime checks (Exposed, EnabledAtRuntime, EnabledForWorld, and SecureContext).
1148
1149             - Switches to using WebCoreBuiltinNames for identifiers, rather than relying
1150             on the appropriate identifiers being available on JavaScriptCore's CommonIdentifiers
1151             which was an unnecessary layering violation. There are still problems with this
1152             as we continue to be inconsistent  about which identifiers deserve to be in 
1153             WebCoreBuiltinNames, and which ones can be created each time and there is no
1154             automation of WebCoreBuiltinNames from the IDLs.
1155
1156             - Enforce at code generation time that [EnabledBySetting] can only be used
1157             on interfaces that are uniquely exposed to the window environment. This is a
1158             condition we should find a way to remove (e.g. propagating necessary settings 
1159             to an object the ScriptExecutionContext owns), but for now, Settings is a main
1160             thread only object.
1161
1162         * bindings/js/JSDOMWindowCustom.cpp:
1163         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1164         (WebCore::JSDOMWindow::getOwnPropertySlot):
1165         (WebCore::JSDOMWindow::put):
1166         (WebCore::addCrossOriginWindowPropertyNames):
1167         (WebCore::addCrossOriginWindowOwnPropertyNames):
1168
1169             Switch to using WebCoreBuiltinNames for WebCore specific identifiers.
1170
1171         * bindings/js/WebCoreBuiltinNames.h:
1172
1173             Add WebCore specific identifiers from JavaScriptCore's CommonIdentifiers
1174             as well as some new ones need by the [EnableBySetting] unification.
1175
1176         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: Added.
1177         * bindings/scripts/test/JS/JSTestEnabledBySetting.h: Added.
1178         * bindings/scripts/test/TestEnabledBySetting.idl: Added.
1179
1180             Add new test for [EnabledBySetting].
1181
1182         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1183         * bindings/scripts/test/JS/JSTestObj.cpp:
1184         * bindings/scripts/test/TestObj.idl:
1185
1186             Remove use of [EnabledBySetting] from TestObj, as it is no longer
1187             valid to use [EnabledBySetting] on interfaces that are no uniquely
1188             exposed to the window environment.
1189
1190 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1191
1192         Remove "malloc" and "free" use
1193         https://bugs.webkit.org/show_bug.cgi?id=176310
1194
1195         Reviewed by Darin Adler.
1196
1197         Use MallocPtr<>, fastMalloc/fastFree, or Vector instead of manual call of system malloc/free.
1198         In this patch, we apply the above change if we can easily find the pair of malloc/free.
1199         And we do not touch plugin directory since the external code could call free() onto the
1200         fastMalloc-ed memory.
1201
1202         Also, we still use malloc if the system adopts the allocated memory. Later, the system
1203         will deallocate it by calling the system "free".
1204
1205         * platform/audio/mac/FFTFrameMac.cpp:
1206         (WebCore::FFTFrame::fftSetupForSize):
1207         (WebCore::FFTFrame::cleanup):
1208         * platform/graphics/win/FontCacheWin.cpp:
1209         (WebCore::getLinkedFonts):
1210         * platform/graphics/win/FontCustomPlatformData.cpp:
1211         (WebCore::FontCustomPlatformData::fontPlatformData):
1212         * platform/graphics/win/FontPlatformDataWin.cpp:
1213         (WebCore::FontPlatformData::FontPlatformData):
1214         * platform/mac/WebCoreNSURLExtras.mm:
1215         (WebCore::URLByTruncatingOneCharacterBeforeComponent):
1216         (WebCore::dataForURLComponentType):
1217         (WebCore::URLByRemovingComponentAndSubsequentCharacter):
1218         (WebCore::createStringWithEscapedUnsafeCharacters):
1219         (WebCore::userVisibleString):
1220         * platform/win/ClipboardUtilitiesWin.cpp:
1221         (WebCore::markupToCFHTML):
1222
1223 2017-09-03  Chris Dumez  <cdumez@apple.com>
1224
1225         Use StringView in DOMFileSystem::evaluatePath()
1226         https://bugs.webkit.org/show_bug.cgi?id=176324
1227
1228         Reviewed by Darin Adler.
1229
1230         Use StringView in DOMFileSystem::evaluatePath() for performance.
1231
1232         * Modules/entriesapi/DOMFileSystem.cpp:
1233         (WebCore::resolveRelativeVirtualPath):
1234         (WebCore::DOMFileSystem::evaluatePath):
1235         * Modules/entriesapi/DOMFileSystem.h:
1236
1237 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1238
1239         String#utf8() allocates new CString
1240         https://bugs.webkit.org/show_bug.cgi?id=176302
1241
1242         Reviewed by Sam Weinig.
1243
1244         Several places uses String#utf8() like an accessor. In reality, it allocates new CString per call.
1245         It is very costly. Furthermore, some places uses this incorrectly. For example,
1246         `std::vector<char>(srtpAuth.utf8().data(), srtpAuth.utf8().data() + srtpAuth.utf8().length());`
1247         is incorrect since each time strpAuth.utf8() allocates different CString.
1248
1249         This patch calls utf8() first and use it.
1250
1251         * Modules/websockets/WebSocketChannel.cpp:
1252         (WebCore::WebSocketChannel::startClosingHandshake):
1253         * platform/wpe/PlatformPasteboardWPE.cpp:
1254         (WebCore::PlatformPasteboard::write):
1255
1256 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1257
1258         [SOUP] Use fastMalloced SoupBuffer in ResourcehandleSoup
1259         https://bugs.webkit.org/show_bug.cgi?id=176311
1260
1261         Reviewed by Michael Catanzaro.
1262
1263         Use fastMalloced memory instead of g_malloc for SoupBuffer.
1264
1265         * platform/network/soup/ResourceHandleSoup.cpp:
1266         (WebCore::ResourceHandle::ensureReadBuffer):
1267
1268 2017-09-03  Chris Dumez  <cdumez@apple.com>
1269
1270         Have getFileMetadata() return a std::optional<FileMetadata>
1271         https://bugs.webkit.org/show_bug.cgi?id=176293
1272
1273         Reviewed by Darin Adler.
1274
1275         Have getFileMetadata() return a std::optional<FileMetadata> instead of
1276         using an out parameter for the metadata.
1277
1278         * Modules/entriesapi/DOMFileSystem.cpp:
1279         (WebCore::listDirectoryWithMetadata):
1280         (WebCore::validatePathIsExpectedType):
1281         (WebCore::DOMFileSystem::getEntry):
1282         * html/FileListCreator.cpp:
1283         (WebCore::appendDirectoryFiles):
1284         * platform/FileSystem.cpp:
1285         (WebCore::fileIsDirectory):
1286         * platform/FileSystem.h:
1287         * platform/glib/FileSystemGlib.cpp:
1288         (WebCore::getFileMetadata):
1289         * platform/network/BlobDataFileReference.cpp:
1290         (WebCore::BlobDataFileReference::startTrackingModifications):
1291         * platform/network/mac/BlobDataFileReferenceMac.mm:
1292         (WebCore::BlobDataFileReference::generateReplacementFile):
1293         * platform/posix/FileSystemPOSIX.cpp:
1294         (WebCore::getFileMetadata):
1295         * platform/win/FileSystemWin.cpp:
1296         (WebCore::getFileMetadata):
1297
1298 2017-09-03  Sam Weinig  <sam@webkit.org>
1299
1300         Remove CanvasProxy
1301         https://bugs.webkit.org/show_bug.cgi?id=176288
1302
1303         Reviewed by Yusuke Suzuki.
1304
1305         CanvasProxy does not appear to be in any current HTML spec
1306         and was disabled and unimplemented in our tree. Time to 
1307         get rid of it.
1308
1309         * CMakeLists.txt:
1310         * Configurations/FeatureDefines.xcconfig:
1311         * DerivedSources.cpp:
1312         * DerivedSources.make:
1313         * WebCore.xcodeproj/project.pbxproj:
1314         * html/canvas/CanvasProxy.cpp: Removed.
1315         * html/canvas/CanvasProxy.h: Removed.
1316         * html/canvas/CanvasProxy.idl: Removed.
1317
1318 2017-09-02  Sam Weinig  <sam@webkit.org>
1319
1320         DOMMatrix/DOMMatrixReadOnly validation is incorrect for NaN values
1321         https://bugs.webkit.org/show_bug.cgi?id=176287
1322
1323         Reviewed by Chris Dumez.
1324
1325         * css/DOMMatrixReadOnly.cpp:
1326         (WebCore::sameValueZero): Added.
1327         (WebCore::DOMMatrixReadOnly::validateAndFixup):
1328
1329             Switch from using standard != to added sameValueZero helper
1330             which implements https://tc39.github.io/ecma262/#sec-samevaluezero
1331
1332 2017-09-02  Chris Dumez  <cdumez@apple.com>
1333
1334         Implement FileSystemFileEntry.file()
1335         https://bugs.webkit.org/show_bug.cgi?id=176166
1336         <rdar://problem/34187756>
1337
1338         Reviewed by Sam Weinig.
1339
1340         Implement FileSystemFileEntry.file():
1341         - https://wicg.github.io/entries-api/#dom-filesystemfileentry-file
1342
1343         Test: editing/pasteboard/datatransfer-items-drop-fileEntry-file.html
1344
1345         * Modules/entriesapi/DOMFileSystem.cpp:
1346         (WebCore::validatePathIsExpectedType):
1347         (WebCore::DOMFileSystem::listDirectory):
1348         (WebCore::DOMFileSystem::getParent):
1349         (WebCore::DOMFileSystem::getFile):
1350         * Modules/entriesapi/DOMFileSystem.h:
1351         * Modules/entriesapi/FileSystemFileEntry.cpp:
1352         (WebCore::FileSystemFileEntry::file):
1353
1354 2017-09-02  Andy Estes  <aestes@apple.com>
1355
1356         [CA] Upstream QuartzCore-related WebKitSystemInterface functions
1357         https://bugs.webkit.org/show_bug.cgi?id=176270
1358
1359         Reviewed by Tim Horton.
1360
1361         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1362         (PlatformCALayerCocoa::enumerateRectsBeingDrawn):
1363         * platform/graphics/cocoa/WebCoreCALayerExtras.h:
1364         * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
1365         (+[CALayer _web_renderLayerWithContextID:]):
1366         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1367         * platform/mac/WebCoreSystemInterface.h:
1368         * platform/mac/WebCoreSystemInterface.mm:
1369
1370 2017-09-02  Emilio Cobos Álvarez  <emilio@crisal.io>
1371
1372         Wrong getComputedStyle result for pseudo-elements in display: none subtrees.
1373         https://bugs.webkit.org/show_bug.cgi?id=176259
1374
1375         Reviewed by Antti Koivisto.
1376
1377         Before this patch, we were wrongly returning the parent style when there wasn't
1378         a cached pseudo style.
1379
1380         With this, the only remaining failures in getComputedStyle-pseudo is a
1381         serialisation bug for the "content" property, and the display: contents test,
1382         which is because we don't support pseudo-elements of display: contents elements
1383         yet.
1384
1385         Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
1386
1387         * dom/Document.cpp:
1388         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
1389         * dom/Document.h:
1390         * dom/Element.cpp:
1391         (WebCore::Element::resolvePseudoElementStyle):
1392         (WebCore::Element::computedStyle):
1393         * dom/Element.h:
1394
1395 2017-09-02  Chris Dumez  <cdumez@apple.com>
1396
1397         Implement FileSystemDirectoryEntry.getDirectory()
1398         https://bugs.webkit.org/show_bug.cgi?id=176168
1399         <rdar://problem/34187787>
1400
1401         Reviewed by Darin Adler.
1402
1403         Implement FileSystemDirectoryEntry.getDirectory() as per:
1404         - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getdirectory
1405
1406         Test: editing/pasteboard/datatransfer-items-drop-getDirectory.html
1407
1408         * Modules/entriesapi/DOMFileSystem.cpp:
1409         (WebCore::isValidVirtualPath):
1410         (WebCore::resolveRelativeVirtualPath):
1411         (WebCore::DOMFileSystem::getEntry):
1412         * Modules/entriesapi/DOMFileSystem.h:
1413         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
1414         (WebCore::FileSystemDirectoryEntry::getEntry):
1415         (WebCore::FileSystemDirectoryEntry::getFile):
1416         (WebCore::FileSystemDirectoryEntry::getDirectory):
1417         * Modules/entriesapi/FileSystemDirectoryEntry.h:
1418
1419 2017-09-02  Joseph Pecoraro  <pecoraro@apple.com>
1420
1421         Performance / PerformanceObserver leaks seen on bots
1422         https://bugs.webkit.org/show_bug.cgi?id=176269
1423
1424         Reviewed by Darin Adler.
1425
1426         * page/DOMWindow.cpp:
1427         (WebCore::DOMWindow::removeAllEventListeners):
1428         * workers/WorkerGlobalScope.cpp:
1429         (WebCore::WorkerGlobalScope::removeAllEventListeners):
1430         Also use this opportunity to break up the reference cycle
1431         between PerformanceObservers and the Performance object.
1432
1433         * page/Performance.h:
1434         * page/Performance.cpp:
1435         (WebCore::Performance::removeAllObservers):
1436         Disassociate and clear observers.
1437
1438         * page/PerformanceObserver.h:
1439         * page/PerformanceObserver.cpp:
1440         (WebCore::PerformanceObserver::disassociate):
1441         Clear the back-reference to the Performance object to
1442         break the cycle.
1443
1444 2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1445
1446         [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data
1447         https://bugs.webkit.org/show_bug.cgi?id=176226
1448
1449         Reviewed by Michael Catanzaro.
1450
1451         It reduces the memory consumption and improves the performance. Also, since performance is better we don't need
1452         to keep the scroll surface allocated all the time, we can create it on demand and keep it allocated only while
1453         scrolling too fast.
1454
1455         * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:
1456         (WebCore::createCairoImageSurfaceWithFastMalloc): Helper to create a cairo image surface using fast malloc.
1457         (WebCore::BackingStoreBackendCairoImpl::BackingStoreBackendCairoImpl): Create the main surface, but no the
1458         scroll one. Initialize the hysteresis activity to discard the scroll surface after scrolling.
1459         (WebCore::BackingStoreBackendCairoImpl::scroll): Create the scroll surface only if it's nullptr, and notify the
1460         hysteresis activity.
1461         * platform/graphics/cairo/BackingStoreBackendCairoImpl.h:
1462
1463 2017-09-01  Sam Weinig  <sam@webkit.org>
1464
1465         DOMMatrix and DOMMatrixReadOnly should be available in workers
1466         https://bugs.webkit.org/show_bug.cgi?id=176255
1467
1468         Reviewed by Simon Fraser.
1469
1470         * WebCore.xcodeproj/project.pbxproj:
1471
1472             Add GlobalPerformance.idl to the project. It was missing.
1473
1474         * bindings/scripts/CodeGeneratorJS.pm:
1475         (IsAlwaysExposedOnInterface):
1476         (NeedsRuntimeCheck):
1477         (GenerateRuntimeEnableConditionalStringForExposed):
1478         (GenerateRuntimeEnableConditionalString):
1479
1480             Adds support for [Exposed] extended attributes on operations, attributes and
1481             constants. This allows an interface that is exposed to both windows and workers 
1482             (with [Exposed=(Window,Worker)]), to indicate that a specific property should
1483             only be be exposed somewhere, e.g only the window. This is need by DOMMatrixReadOnly's
1484             stringifier, which is only exposed in the window environment.
1485
1486         * bindings/scripts/IDLParser.pm:
1487         (parseExtendedAttributeRest2):
1488
1489             Fix bug where array extended attributes, like those found in Exposed expressions
1490             where being converter to scalars.
1491
1492         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1493         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1494         * bindings/scripts/test/JS/JSTestObj.cpp:
1495         * bindings/scripts/test/TestObj.idl:
1496
1497             Add tests and update results. Some results are just improved
1498             includes.
1499
1500         * css/DOMMatrix.cpp:
1501         * css/DOMMatrix.h:
1502         * css/DOMMatrix.idl:
1503         * css/DOMMatrixReadOnly.cpp:
1504         * css/DOMMatrixReadOnly.h:
1505         * css/DOMMatrixReadOnly.idl:
1506             
1507             Expose DOMMatrix and DOMMatrixReadOnly to workers and update the constructors
1508             to match the current spec, throwing if the argument is a string, and the context
1509             is not the window / document context. Also did some refactoring to avoid allocating
1510             the DOMMatrix or DOMMatrixReadOnly until after all the exceptional cases were handled.
1511
1512 2017-09-01  Chris Dumez  <cdumez@apple.com>
1513
1514         Implement FileSystemDirectoryEntry.getFile()
1515         https://bugs.webkit.org/show_bug.cgi?id=176167
1516         <rdar://problem/34187775>
1517
1518         Reviewed by Andreas Kling.
1519
1520         Implement FileSystemDirectoryEntry.getFile():
1521         - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getfile
1522
1523         Test: editing/pasteboard/datatransfer-items-drop-getFile.html
1524
1525         * Modules/entriesapi/DOMFileSystem.cpp:
1526         (WebCore::isValidPathNameCharacter):
1527         (WebCore::isValidPathSegment):
1528         (WebCore::isValidRelativeVirtualPath):
1529         (WebCore::isValidAbsoluteVirtualPath):
1530         (WebCore::isValidVirtualPath):
1531         Implement various path validation functions as per:
1532         - https://wicg.github.io/entries-api/#names-paths
1533
1534         (WebCore::resolveRelativeVirtualPath):
1535         - Use StringView for second parameter for efficiency. Had to keep
1536           a String for the first parameter because I need the split to
1537           return a Vector.
1538         - If the input path is absolute, call recursively with '/' as
1539           base path so that the virtual path gets sanitized (i.e. '..'
1540           and '.' in the absolute URL get resolved).
1541
1542         (WebCore::DOMFileSystem::listDirectory):
1543         Use String instead of auto. It is not much longer and is clearer.
1544
1545         (WebCore::validatePathIsDirectory):
1546         (WebCore::DOMFileSystem::getParent):
1547         Move logic to validate that the path is a directory from getParent() to a
1548         separate function. This only makes sure the ScriptExecutionContext is only
1549         ref'd / deref'd on the main thread.
1550
1551         (WebCore::validatePathIsFile):
1552         Logic for validating that a path is a file, used by getFile().
1553
1554         (WebCore::DOMFileSystem::getFile):
1555         Implement getFile() as per:
1556         - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getfile
1557
1558         * Modules/entriesapi/DOMFileSystem.h:
1559         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
1560         (WebCore::FileSystemDirectoryEntry::getFile):
1561         Add implementation of FileSystemDirectoryEntry::getFile() which merely calls
1562         DOMFileSystem::getFile().
1563
1564 2017-09-01  Brady Eidson  <beidson@apple.com>
1565
1566         ASSERTION FAILED: taken.get() == &job in WebCore::ServiceWorkerContainer::jobDidFinish(WebCore::ServiceWorkerJob &).
1567         https://bugs.webkit.org/show_bug.cgi?id=176234
1568
1569         Rubberstamped by Tim Horton, reluctantly.
1570
1571         * workers/service/ServiceWorkerContainer.cpp:
1572         (WebCore::ServiceWorkerContainer::jobDidFinish): It's valid for the job to be missing after navigations, which is
1573           why this was hitting downstream tests.
1574
1575 2017-09-01  Youenn Fablet  <youenn@apple.com>
1576
1577         Do not Reject CacheStorage promises when updating the persistent filesystem data fails
1578         https://bugs.webkit.org/show_bug.cgi?id=176241
1579
1580         Reviewed by Alex Christensen.
1581
1582         Open/Remove caches may succeed in updating the memory representation but the write-to-disk operation may fail.
1583         In that case, the corresponding promise is now resolved since the web page can still proceeed.
1584
1585         There is no way to test that currently as this would require a write disk failure to be triggered.
1586
1587         * Modules/cache/CacheStorage.cpp:
1588         (WebCore::logConsolePersistencyError):
1589         (WebCore::CacheStorage::open):
1590         (WebCore::CacheStorage::remove):
1591         * Modules/cache/DOMCacheEngine.h:
1592         (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::encode const):
1593         (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::decode):
1594
1595 2017-09-01  Youenn Fablet  <youenn@apple.com>
1596
1597         [Fetch API] Add support for consuming a Request ReadableStream body
1598         https://bugs.webkit.org/show_bug.cgi?id=176182
1599
1600         Reviewed by Alex Christensen.
1601
1602         Tests: http/wpt/fetch/request-stream-empty.html
1603                http/wpt/fetch/request-stream-error.html
1604
1605         Adding a ReadableStreamSink which allows to pipe all ReadableStream data back to C++ code.
1606         This sink only takes BufferSource as the only user is Fetch which has this restriction.
1607         This sink is tied to the readableStreamPipeTo builtin internal function that reads all data from the ReadableStream
1608         and send it to the sink.
1609
1610         Adding a ReadableStreamToSharedBufferSink specialization to get the data as a SharedBuffer.
1611
1612         Use that class in FetchBodyConsumer to get the data back from the ReadableStream and transform it according
1613         the desired body type (text, JSON, ArrayBuffer).
1614
1615         * CMakeLists.txt:
1616         * DerivedSources.make:
1617         * Modules/fetch/FetchBody.cpp:
1618         (WebCore::FetchBody::consume):
1619         (WebCore::FetchBody::loadingSucceeded):
1620         * Modules/fetch/FetchBodyConsumer.cpp:
1621         (WebCore::resolveWithTypeAndData):
1622         (WebCore::FetchBodyConsumer::clean):
1623         (WebCore::FetchBodyConsumer::resolveWithData):
1624         (WebCore::FetchBodyConsumer::resolve):
1625         * Modules/fetch/FetchBodyConsumer.h:
1626         * Modules/fetch/FetchResponse.cpp:
1627         (WebCore::FetchResponse::finishConsumingStream):
1628         * Modules/streams/ReadableStreamInternals.js:
1629         (readableStreamPipeTo):
1630         * Modules/streams/ReadableStreamSink.cpp: Added.
1631         (WebCore::ReadableStreamToSharedBufferSink::ReadableStreamToSharedBufferSink):
1632         (WebCore::ReadableStreamToSharedBufferSink::pipeFrom):
1633         (WebCore::ReadableStreamToSharedBufferSink::enqueue):
1634         (WebCore::ReadableStreamToSharedBufferSink::close):
1635         (WebCore::ReadableStreamToSharedBufferSink::error):
1636         * Modules/streams/ReadableStreamSink.h: Added.
1637         * Modules/streams/ReadableStreamSink.idl: Added.
1638         * WebCore.xcodeproj/project.pbxproj:
1639         * bindings/js/ReadableStream.cpp:
1640         (WebCore::ReadableStream::pipeTo):
1641         * bindings/js/ReadableStream.h:
1642
1643 2017-09-01  Emilio Cobos Álvarez  <emilio@crisal.io>
1644
1645         Wrong getComputedStyle behavior for pseudo-elements for layout-dependent properties.
1646         https://bugs.webkit.org/show_bug.cgi?id=175936
1647
1648         Reviewed by Antti Koivisto.
1649
1650         Before this patch we may wrongly end up using the wrong renderer to resolve
1651         this.
1652
1653         Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
1654
1655         * css/CSSComputedStyleDeclaration.cpp:
1656         (WebCore::ComputedStyleExtractor::styledElement const):
1657         (WebCore::ComputedStyleExtractor::styledRenderer const):
1658         (WebCore::ComputedStyleExtractor::propertyValue):
1659         * css/CSSComputedStyleDeclaration.h:
1660
1661 2017-09-01  Per Arne Vollan  <pvollan@apple.com>
1662
1663         [Win] Compile error, 'Cache' is not declared.
1664         https://bugs.webkit.org/show_bug.cgi?id=176062
1665
1666         Reviewed by Youenn Fablet.
1667
1668         Rename Cache to DOMCache.
1669
1670         No new tests, covered by existing tests. 
1671
1672         * DerivedSources.make:
1673         * Modules/cache/Cache.cpp: Removed.
1674         * Modules/cache/Cache.h: Removed.
1675         * Modules/cache/Cache.idl: Removed.
1676         * Modules/cache/CacheStorage.cpp:
1677         (WebCore::doSequentialMatch):
1678         (WebCore::startSequentialMatch):
1679         (WebCore::copyCaches):
1680         (WebCore::CacheStorage::match):
1681         (WebCore::CacheStorage::retrieveCaches):
1682         (WebCore::CacheStorage::open):
1683         * Modules/cache/CacheStorage.h:
1684         * Modules/cache/DOMCache.cpp: Copied from Source/WebCore/Modules/cache/Cache.cpp.
1685         (WebCore::DOMCache::DOMCache):
1686         (WebCore::DOMCache::~DOMCache):
1687         (WebCore::DOMCache::match):
1688         (WebCore::DOMCache::doMatch):
1689         (WebCore::DOMCache::matchAll):
1690         (WebCore::DOMCache::add):
1691         (WebCore::DOMCache::requestFromInfo):
1692         (WebCore::DOMCache::addAll):
1693         (WebCore::DOMCache::put):
1694         (WebCore::DOMCache::remove):
1695         (WebCore::DOMCache::keys):
1696         (WebCore::DOMCache::retrieveRecords):
1697         (WebCore::DOMCache::queryCache):
1698         (WebCore::DOMCache::queryCacheWithTargetStorage):
1699         (WebCore::DOMCache::batchDeleteOperation):
1700         (WebCore::DOMCache::batchPutOperation):
1701         (WebCore::DOMCache::updateRecords):
1702         (WebCore::DOMCache::stop):
1703         (WebCore::DOMCache::activeDOMObjectName const):
1704         (WebCore::DOMCache::canSuspendForDocumentSuspension const):
1705         (WebCore::Cache::Cache): Deleted.
1706         (WebCore::Cache::~Cache): Deleted.
1707         (WebCore::Cache::match): Deleted.
1708         (WebCore::Cache::doMatch): Deleted.
1709         (WebCore::Cache::matchAll): Deleted.
1710         (WebCore::Cache::add): Deleted.
1711         (WebCore::Cache::requestFromInfo): Deleted.
1712         (WebCore::Cache::addAll): Deleted.
1713         (WebCore::Cache::put): Deleted.
1714         (WebCore::Cache::remove): Deleted.
1715         (WebCore::Cache::keys): Deleted.
1716         (WebCore::Cache::retrieveRecords): Deleted.
1717         (WebCore::Cache::queryCache): Deleted.
1718         (WebCore::Cache::queryCacheWithTargetStorage): Deleted.
1719         (WebCore::Cache::batchDeleteOperation): Deleted.
1720         (WebCore::Cache::batchPutOperation): Deleted.
1721         (WebCore::Cache::updateRecords): Deleted.
1722         (WebCore::Cache::stop): Deleted.
1723         (WebCore::Cache::activeDOMObjectName const): Deleted.
1724         (WebCore::Cache::canSuspendForDocumentSuspension const): Deleted.
1725         * Modules/cache/DOMCache.h: Copied from Source/WebCore/Modules/cache/Cache.h.
1726         * Modules/cache/DOMCache.idl: Copied from Source/WebCore/Modules/cache/Cache.idl.
1727         * WebCore.xcodeproj/project.pbxproj:
1728
1729 2017-09-01  Brady Eidson  <beidson@apple.com>
1730
1731         Move ServiceWorkerJob from FetchLoader to ThreadableLoader.
1732         https://bugs.webkit.org/show_bug.cgi?id=176231
1733
1734         Reviewed by Youenn Fablet.
1735
1736         No new tests (No behavior change).
1737
1738         * WebCore.xcodeproj/project.pbxproj:
1739
1740         Re-indent these headers. Yuck!
1741         * loader/ThreadableLoader.h:
1742         (WebCore::ThreadableLoader::ref):
1743         (WebCore::ThreadableLoader::deref):
1744         (WebCore::ThreadableLoader::ThreadableLoader):
1745         (WebCore::ThreadableLoader::~ThreadableLoader):
1746         * loader/ThreadableLoaderClient.h:
1747         (WebCore::ThreadableLoaderClient::didSendData):
1748         (WebCore::ThreadableLoaderClient::didReceiveResponse):
1749         (WebCore::ThreadableLoaderClient::didReceiveData):
1750         (WebCore::ThreadableLoaderClient::didFinishLoading):
1751         (WebCore::ThreadableLoaderClient::didFail):
1752         (WebCore::ThreadableLoaderClient::didFinishTiming):
1753         (WebCore::ThreadableLoaderClient::ThreadableLoaderClient):
1754         (WebCore::ThreadableLoaderClient::~ThreadableLoaderClient):
1755
1756         Move from FetchLoaderClient to ThreadableLoaderClient:
1757         * workers/service/ServiceWorkerJob.cpp:
1758         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
1759         (WebCore::ServiceWorkerJob::didReceiveResponse):
1760         (WebCore::ServiceWorkerJob::didReceiveData):
1761         (WebCore::ServiceWorkerJob::didFinishLoading):
1762         (WebCore::ServiceWorkerJob::didFail):
1763         (WebCore::ServiceWorkerJob::didSucceed): Deleted.
1764         * workers/service/ServiceWorkerJob.h:
1765
1766         * workers/service/server/SWClientConnection.cpp: Add a now-required include.
1767
1768 2017-09-01  Eric Carlson  <eric.carlson@apple.com>
1769
1770         Switch HTMLMediaElement to release logging
1771         https://bugs.webkit.org/show_bug.cgi?id=176065
1772
1773         Reviewed by Jer Noble.
1774
1775         * dom/Document.cpp:
1776         (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
1777         mode is enabled.
1778         (WebCore::Document::logger const):
1779         * dom/Document.h:
1780
1781         Convert debug-only logging to configurable release logging.
1782         * html/HTMLMediaElement.cpp:
1783         (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
1784         String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
1785         * html/HTMLMediaElement.h:
1786
1787 2017-09-01  Simon Fraser  <simon.fraser@apple.com>
1788
1789         transformCanLikelyUseFastPath() can read off the end of a string
1790         https://bugs.webkit.org/show_bug.cgi?id=176232
1791         rdar://problem/33851237
1792
1793         Reviewed by Tim Horton.
1794         
1795         Code added in r220382 could read one byte past the end of the string when looking for the 'z'
1796         of a rotateZ() function. The code was actually incorrect, testing for the 'z at i+6 after
1797         already incrementing i by 6. This patch makes the code correctly detect rotateZ().
1798         
1799         Also, rotate functions at the end of a string could be ignored because kShortestValidTransformStringLength
1800         was too long, so set it to the length of "rotate(0)", the shortest transform function that we currently
1801         fast-parse.
1802
1803         There's an implicit assumption in this code that chars is not indexed past i+kShortestValidTransformStringLength.
1804         If the 'translate' path is taken, i is incremented by 9 (==kShortestValidTransformStringLength), but that's
1805         OK because WTF::find() doesn't index into chars if i >= length.
1806
1807         Test: fast/css/transform-fast-paths.html
1808
1809         * css/parser/CSSParserFastPaths.cpp:
1810         (WebCore::transformCanLikelyUseFastPath):
1811
1812 2017-09-01  Andy Estes  <aestes@apple.com>
1813
1814         [CG] Upstream CoreGraphics-related WebKitSystemInterface functions
1815         https://bugs.webkit.org/show_bug.cgi?id=176200
1816
1817         Reviewed by Tim Horton.
1818
1819         * platform/graphics/GraphicsContext.h:
1820         * platform/graphics/ImageSource.cpp:
1821         (WebCore::ImageSource::subsamplingLevelForScaleFactor):
1822         * platform/graphics/cg/GraphicsContextCG.cpp:
1823         (WebCore::GraphicsContext::clipOut):
1824         (WebCore::applyShadowOffsetWorkaroundIfNeeded):
1825         * platform/graphics/cg/PatternCG.cpp:
1826         (WebCore::Pattern::createPlatformPattern const):
1827         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1828         (WebCore::GraphicsContext::focusRingColor):
1829         (WebCore::drawFocusRingAtTime):
1830         (WebCore::drawFocusRing):
1831         (WebCore::drawFocusRingToContext):
1832         (WebCore::drawFocusRingToContextAtTime):
1833         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1834         * platform/mac/PasteboardMac.mm:
1835         (WebCore::flipImageSpec):
1836         (WebCore::setDragImageImpl):
1837         (WebCore::Pasteboard::setDragImage):
1838         * platform/mac/PlatformEventFactoryMac.mm:
1839         * platform/mac/ScrollbarThemeMac.mm:
1840         (WebCore::linenBackgroundColor):
1841         * platform/mac/ThemeMac.mm:
1842         (WebCore::drawCellFocusRingWithFrameAtTime):
1843         (WebCore::drawCellFocusRing):
1844         * platform/mac/WebCoreSystemInterface.h:
1845         * platform/mac/WebCoreSystemInterface.mm:
1846         * platform/mac/WebWindowAnimation.mm:
1847         (flipRect):
1848         (mainWindowServerConnectionID):
1849         (setScaledFrameForWindow):
1850         (-[WebWindowScaleAnimation setCurrentProgress:]):
1851         (-[WebWindowFadeAnimation setCurrentProgress:]):
1852
1853 2017-09-01  Youenn Fablet  <youenn@apple.com>
1854
1855         Reject promises in case of internal CacheStorage engine errors.
1856         https://bugs.webkit.org/show_bug.cgi?id=176194
1857
1858         Reviewed by Alex Christensen.
1859
1860         No new tests as this covers error cases that should not happen in regular cases.
1861         Replacing lambdas that take no parameters to lambdas taking an optional error.
1862         Reject promise if an error is found.
1863
1864         * Modules/cache/Cache.cpp:
1865         (WebCore::Cache::doMatch):
1866         (WebCore::Cache::matchAll):
1867         (WebCore::Cache::keys):
1868         (WebCore::Cache::retrieveRecords):
1869         (WebCore::Cache::queryCache):
1870         * Modules/cache/Cache.h:
1871         * Modules/cache/CacheStorage.cpp:
1872         (WebCore::CacheStorage::match):
1873         (WebCore::CacheStorage::has):
1874         (WebCore::CacheStorage::retrieveCaches):
1875         (WebCore::CacheStorage::open):
1876         (WebCore::CacheStorage::remove):
1877         (WebCore::CacheStorage::keys):
1878         * Modules/cache/CacheStorage.h:
1879
1880 2017-09-01  Zan Dobersek  <zdobersek@igalia.com>
1881
1882         Unreviewed WPE build fix after r221439.
1883
1884         * html/canvas/WebGL2RenderingContext.cpp: Add the HeapInlines.h
1885         header include in order to properly inline a Heap::vm() call.
1886
1887 2017-09-01  Chris Dumez  <cdumez@apple.com>
1888
1889         Implement FileSystemEntry.getParent()
1890         https://bugs.webkit.org/show_bug.cgi?id=176165
1891         <rdar://problem/34187743>
1892
1893         Reviewed by Andreas Kling.
1894
1895         Implement FileSystemEntry.getParent():
1896         - https://wicg.github.io/entries-api/#dom-filesystementry-getparent
1897
1898         Tests: editing/pasteboard/datatransfer-items-drop-getParent-root.html
1899                editing/pasteboard/datatransfer-items-drop-getParent.html
1900                editing/pasteboard/datatransfer-items-drop-getParent2.html
1901
1902         * Modules/entriesapi/DOMFileSystem.cpp:
1903         (WebCore::toFileSystemEntries):
1904         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1905
1906         (WebCore::isAbsoluteVirtualPath):
1907         Add utility function to determine if a virtual path is absolute:
1908         - https://wicg.github.io/entries-api/#absolute-path
1909
1910         (WebCore::DOMFileSystem::root):
1911         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1912
1913         (WebCore::DOMFileSystem::fileAsEntry):
1914         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1915
1916         (WebCore::resolveRelativePath):
1917         Add implementation for:
1918         - https://wicg.github.io/entries-api/#resolve-a-relative-path
1919
1920         (WebCore::DOMFileSystem::listDirectory):
1921         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1922
1923         (WebCore::DOMFileSystem::getParent):
1924         Add implementation of getParent() as per:
1925         - https://wicg.github.io/entries-api/#dom-filesystementry-getparent
1926
1927         * Modules/entriesapi/DOMFileSystem.h:
1928         (WebCore::DOMFileSystem::createEntryForFile):
1929         * Modules/entriesapi/DOMFileSystem.idl:
1930         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
1931         (WebCore::FileSystemDirectoryEntry::FileSystemDirectoryEntry):
1932         * Modules/entriesapi/FileSystemDirectoryEntry.h:
1933         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
1934         (WebCore::FileSystemDirectoryReader::readEntries):
1935         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1936
1937         * Modules/entriesapi/FileSystemEntry.cpp:
1938         (WebCore::FileSystemEntry::FileSystemEntry):
1939         (WebCore::FileSystemEntry::activeDOMObjectName const):
1940         (WebCore::FileSystemEntry::canSuspendForDocumentSuspension const):
1941         (WebCore::FileSystemEntry::getParent):
1942         * Modules/entriesapi/FileSystemEntry.h:
1943         * Modules/entriesapi/FileSystemEntry.idl:
1944         - Add implementation of FileSystemEntry.getParent() which relies on
1945           DOMFileSystem::getParent()
1946         - Make FileSystemEntry an ActiveDOMObject as getParent() is an asynchronous
1947           operation which causes delayed JS execution.
1948
1949         * Modules/entriesapi/FileSystemFileEntry.cpp:
1950         (WebCore::FileSystemFileEntry::FileSystemFileEntry):
1951         * Modules/entriesapi/FileSystemFileEntry.h:
1952         * dom/DataTransferItem.cpp:
1953         (WebCore::DataTransferItem::getAsEntry const):
1954         * dom/DataTransferItem.h:
1955         * dom/DataTransferItem.idl:
1956         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1957
1958 2017-09-01  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1959
1960         Ensure RenderStyle and SameSizeAsRenderStyle have the same size
1961         https://bugs.webkit.org/show_bug.cgi?id=176210
1962
1963         Reviewed by Daniel Bates.
1964
1965         SameSizeAsRenderStyle::m_nonInheritedFlags requires a 64 bit alignment,
1966         which currently produces an extra 32 bit padding with 32 bit build.
1967
1968         * rendering/style/RenderStyle.cpp:
1969         Make m_nonInheritedFlags 32 bit aligned and restore the size check.
1970
1971 2017-09-01  Per Arne Vollan  <pvollan@apple.com>
1972
1973         [Win] Compile error, 'Cache' is not declared.
1974         https://bugs.webkit.org/show_bug.cgi?id=176062
1975
1976         Reviewed by Youenn Fablet.
1977
1978         Rename DOMCache to DOMCacheEngine.
1979
1980         No new tests, covered by existing tests. 
1981
1982         * Modules/cache/Cache.cpp:
1983         (WebCore::Cache::addAll):
1984         (WebCore::Cache::put):
1985         (WebCore::queryCacheMatch):
1986         (WebCore::Cache::batchDeleteOperation):
1987         (WebCore::toConnectionRecord):
1988         (WebCore::Cache::batchPutOperation):
1989         * Modules/cache/Cache.h:
1990         * Modules/cache/CacheStorage.cpp:
1991         (WebCore::CacheStorage::open):
1992         (WebCore::CacheStorage::remove):
1993         * Modules/cache/CacheStorageConnection.cpp:
1994         * Modules/cache/CacheStorageConnection.h:
1995         (WebCore::CacheStorageConnection::clearMemoryRepresentation):
1996         (WebCore::CacheStorageConnection::openCompleted):
1997         (WebCore::CacheStorageConnection::removeCompleted):
1998         (WebCore::CacheStorageConnection::doOpen):
1999         (WebCore::CacheStorageConnection::doRemove):
2000         (WebCore::CacheStorageConnection::doBatchDeleteOperation):
2001         (WebCore::CacheStorageConnection::doBatchPutOperation):
2002         * Modules/cache/DOMCache.cpp: Removed.
2003         * Modules/cache/DOMCache.h: Removed.
2004         * Modules/cache/DOMCacheEngine.cpp: Copied from Source/WebCore/Modules/cache/DOMCache.cpp.
2005         (WebCore::DOMCacheEngine::isolatedResponseBody):
2006         (WebCore::DOMCacheEngine::copyResponseBody):
2007         (WebCore::DOMCache::errorToException): Deleted.
2008         (WebCore::DOMCache::queryCacheMatch): Deleted.
2009         (WebCore::DOMCache::isolatedResponseBody): Deleted.
2010         (WebCore::DOMCache::copyResponseBody): Deleted.
2011         (WebCore::DOMCache::Record::copy const): Deleted.
2012         * Modules/cache/DOMCacheEngine.h: Copied from Source/WebCore/Modules/cache/DOMCache.h.
2013         * Modules/cache/WorkerCacheStorageConnection.cpp:
2014         * Modules/cache/WorkerCacheStorageConnection.h:
2015         * WebCore.xcodeproj/project.pbxproj:
2016         * testing/Internals.cpp:
2017         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
2018
2019 2017-08-31  Andy Estes  <aestes@apple.com>
2020
2021         [Mac] Upstream AppKit-related WebKitSystemInterface functions
2022         https://bugs.webkit.org/show_bug.cgi?id=176175
2023
2024         Reviewed by Brady Eidson.
2025
2026         * Configurations/WebCore.xcconfig: Added -ObjC to OTHER_LDFLAGS so that Objective-C classes
2027         in PAL are exported by WebCore even if WebCore doesn't use them.
2028         * platform/mac/PlatformEventFactoryMac.h:
2029         * platform/mac/PlatformEventFactoryMac.mm:
2030         (WebCore::getWheelEventDeltas):
2031         (WebCore::keyCharForEvent):
2032         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
2033         * platform/mac/WebCoreSystemInterface.h:
2034         * platform/mac/WebCoreSystemInterface.mm:
2035
2036 2017-08-31  Alex Christensen  <achristensen@webkit.org>
2037
2038         Fix Windows build after r221422
2039         https://bugs.webkit.org/show_bug.cgi?id=174924
2040
2041         * platform/text/win/LocaleWin.cpp:
2042         (WebCore::LocaleWin::getLocaleInfoString):
2043         StringVector is now the type that can be adopted by String::adopt.
2044
2045 2017-08-31  Daniel Bates  <dabates@apple.com>
2046
2047         Another attempt to fix the Apple Windows build following <https://trac.webkit.org/changeset/221459>
2048         (https://bugs.webkit.org/show_bug.cgi?id=176171)
2049
2050         Temporarily weaken the size check for RenderStyle from a strict equality to <=.
2051
2052         * rendering/style/RenderStyle.cpp:
2053
2054 2017-08-31  Daniel Bates  <dabates@apple.com>
2055
2056         Attempt to fix the Apple Windows and WinCairo build following <https://trac.webkit.org/changeset/221459>
2057         (https://bugs.webkit.org/show_bug.cgi?id=176171)
2058
2059         Explicitly cast PseudoIds to unsigned before computing a difference between two PseudoIds.
2060
2061         * rendering/style/RenderStyle.h:
2062
2063 2017-08-31  Alex Christensen  <achristensen@webkit.org>
2064
2065         Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
2066         https://bugs.webkit.org/show_bug.cgi?id=175779
2067         <rdar://problem/22367975>
2068
2069         Reviewed by Tim Horton.
2070
2071         Covered by new API tests.
2072
2073         * loader/FrameLoaderClient.h:
2074
2075 2017-08-31  Andreas Kling  <akling@apple.com>
2076
2077         Element focus appearance update should be either immediate or a post-layout task
2078         https://bugs.webkit.org/show_bug.cgi?id=176193
2079
2080         Reviewed by Antti Koivisto.
2081
2082         This change removes an old mechanism for avoiding element focus appearance updates
2083         while we might be in the middle of attaching a renderer.
2084
2085         Focus appearance updates depend on a clean layout, since they want to be able to
2086         scroll the element into the visible viewport if needed.
2087         We now simply do the updates either immediately after layout in Element::focus(),
2088         or as a post-layout callback when needed for HTMLInputElement::didAttachRenderers().
2089
2090         * dom/Document.cpp:
2091         (WebCore::Document::Document):
2092         (WebCore::Document::updateFocusAppearanceSoon): Deleted.
2093         (WebCore::Document::cancelFocusAppearanceUpdate): Deleted.
2094         (WebCore::Document::updateFocusAppearanceTimerFired): Deleted.
2095         * dom/Document.h:
2096         * dom/Element.cpp:
2097         (WebCore::Element::focus):
2098         (WebCore::Element::blur):
2099         (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
2100         (WebCore::Element::updateFocusAppearanceAfterAttachIfNeeded): Deleted.
2101         (WebCore::Element::cancelFocusAppearanceUpdate): Deleted.
2102         * dom/Element.h:
2103         * dom/ElementRareData.h:
2104         (WebCore::ElementRareData::ElementRareData):
2105         (WebCore::ElementRareData::needsFocusAppearanceUpdateSoonAfterAttach const): Deleted.
2106         (WebCore::ElementRareData::setNeedsFocusAppearanceUpdateSoonAfterAttach): Deleted.
2107         * html/HTMLInputElement.cpp:
2108         (WebCore::HTMLInputElement::didAttachRenderers):
2109
2110 2017-08-31  Don Olmstead  <don.olmstead@sony.com>
2111
2112         [CMake] Make USE_CF conditional within Windows
2113         https://bugs.webkit.org/show_bug.cgi?id=176173
2114
2115         Reviewed by Alex Christensen.
2116
2117         No new tests. No change in behavior.
2118
2119         * PlatformWin.cmake:
2120         * WebCorePrefix.h:
2121         * testing/js/WebCoreTestSupportPrefix.h:
2122
2123 2017-08-31  Sam Weinig  <sam@webkit.org>
2124
2125         Implement DOMMatrix2DInit for setTransform()/addPath()
2126         https://bugs.webkit.org/show_bug.cgi?id=176048
2127
2128         Reviewed by Simon Fraser.
2129
2130         * DerivedSources.make:
2131         * WebCore.xcodeproj/project.pbxproj:
2132         * CMakeLists.txt:
2133
2134             Add new files.
2135
2136         * bindings/js/CallTracerTypes.h:
2137         * inspector/InspectorCanvas.cpp:
2138         
2139             Swap out DOMMatrixInit for DOMMatrix2DInit in canvas tracing infrastructure.
2140
2141         * css/DOMMatrix2DInit.h: Added.
2142         * css/DOMMatrix2DInit.idl: Added.
2143         * css/DOMMatrixInit.h:
2144         * css/DOMMatrixInit.idl:
2145         Split DOMMatrixInit in two, with the 2D bits going into DOMMatrix2DInit.
2146         
2147         * css/DOMMatrixReadOnly.cpp:
2148         * css/DOMMatrixReadOnly.h:
2149         
2150             Add a validateAndFixup overload for DOMMatrix2DInit.
2151         
2152         * html/canvas/CanvasRenderingContext2D.cpp:
2153         * html/canvas/CanvasRenderingContext2D.h:
2154
2155             Swap out DOMMatrixInit for DOMMatrix2DInit in setTransform. This
2156             should have no observable difference, since we ignored the 3D prior.
2157
2158         * html/canvas/DOMPath.cpp:
2159         * html/canvas/DOMPath.h:
2160         * html/canvas/DOMPath.idl:
2161
2162             Update DOMPath (actually called Path2D) to take an optional DOMMatrix2DInit
2163             rather than an SVGMatrix. Passing an SVGMatrix is still valid, as it conforms
2164             as a DOMMatrix2DInit dictionary (having the necessary properties), so the
2165             risk of compatibility issues is minimal.
2166
2167 2017-08-31  Brady Eidson  <beidson@apple.com>
2168
2169         Add (entirely incorrect) fetching of ServiceWorker scripts.
2170         https://bugs.webkit.org/show_bug.cgi?id=176179
2171
2172         Reviewed by Andy Estes.
2173
2174         No new tests (Covered by changes to existing tests).
2175
2176         When the Storage process is running the "Update" algorithm and a ServiceWorker script file needs to be fetched, this patch:
2177           - Messages back to the WebContent process that started the register/update job
2178           - Executes a FetchLoad in that script context for the script
2179           - Sends the results back to the Storage process
2180
2181         We don't do anything with the results yet.
2182
2183         Soon.
2184
2185         * WebCore.xcodeproj/project.pbxproj:
2186
2187         * workers/service/ServiceWorkerContainer.cpp:
2188         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2189         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2190         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2191         * workers/service/ServiceWorkerContainer.h:
2192
2193         * workers/service/ServiceWorkerFetchResult.h: Copied from Source/WebCore/workers/service/server/SWClientConnection.h.
2194         (WebCore::ServiceWorkerFetchResult::encode const):
2195         (WebCore::ServiceWorkerFetchResult::decode):
2196
2197         * workers/service/ServiceWorkerJob.cpp:
2198         (WebCore::ServiceWorkerJob::startScriptFetch):
2199         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
2200         (WebCore::ServiceWorkerJob::didReceiveResponse):
2201         (WebCore::ServiceWorkerJob::didReceiveData):
2202         (WebCore::ServiceWorkerJob::didSucceed):
2203         (WebCore::ServiceWorkerJob::didFail):
2204         * workers/service/ServiceWorkerJob.h:
2205
2206         * workers/service/ServiceWorkerJobClient.h:
2207
2208         * workers/service/server/SWClientConnection.cpp:
2209         (WebCore::SWClientConnection::finishedFetchingScript):
2210         (WebCore::SWClientConnection::failedFetchingScript):
2211         (WebCore::SWClientConnection::startScriptFetchForServer):
2212         * workers/service/server/SWClientConnection.h:
2213
2214         * workers/service/server/SWServer.cpp:
2215         (WebCore::SWServer::Connection::finishFetchingScriptInServer):
2216         (WebCore::SWServer::startScriptFetch):
2217         (WebCore::SWServer::scriptFetchFinished):
2218         * workers/service/server/SWServer.h:
2219
2220         * workers/service/server/SWServerRegistration.cpp:
2221         (WebCore::SWServerRegistration::scriptFetchFinished):
2222         (WebCore::SWServerRegistration::runUpdateJob):
2223         (WebCore::SWServerRegistration::startScriptFetchFromMainThread):
2224         (WebCore::SWServerRegistration::startScriptFetchForCurrentJob):
2225         * workers/service/server/SWServerRegistration.h:
2226
2227 2017-08-31  Daniel Bates  <dabates@apple.com>
2228
2229         Make RenderStyle's non-inherited flags more human friendly
2230         https://bugs.webkit.org/show_bug.cgi?id=176171
2231
2232         Reviewed by Antti Koivisto.
2233
2234         Revert r166465 as we never followed through and made the CSS JIT update
2235         RenderStyle's non-inherited flags directly.
2236
2237         * rendering/style/RenderStyle.cpp:
2238         (WebCore::RenderStyle::RenderStyle):
2239         (WebCore::RenderStyle::hashForTextAutosizing const):
2240         (WebCore::RenderStyle::equalForTextAutosizing const):
2241         (WebCore::RenderStyle::changeRequiresLayout const):
2242         * rendering/style/RenderStyle.h:
2243         (WebCore::RenderStyle::styleType const):
2244         (WebCore::RenderStyle::setStyleType):
2245         (WebCore::RenderStyle::setHasViewportUnits):
2246         (WebCore::RenderStyle::hasViewportUnits const):
2247         (WebCore::RenderStyle::affectedByHover const):
2248         (WebCore::RenderStyle::affectedByActive const):
2249         (WebCore::RenderStyle::affectedByDrag const):
2250         (WebCore::RenderStyle::setAffectedByHover):
2251         (WebCore::RenderStyle::setAffectedByActive):
2252         (WebCore::RenderStyle::setAffectedByDrag):
2253         (WebCore::RenderStyle::isFloating const):
2254         (WebCore::RenderStyle::display const):
2255         (WebCore::RenderStyle::position const):
2256         (WebCore::RenderStyle::floating const):
2257         (WebCore::RenderStyle::overflowX const):
2258         (WebCore::RenderStyle::overflowY const):
2259         (WebCore::RenderStyle::verticalAlign const):
2260         (WebCore::RenderStyle::unicodeBidi const):
2261         (WebCore::RenderStyle::clear const):
2262         (WebCore::RenderStyle::tableLayout const):
2263         (WebCore::RenderStyle::hasExplicitlySetDirection const):
2264         (WebCore::RenderStyle::isLink const):
2265         (WebCore::RenderStyle::setDisplay):
2266         (WebCore::RenderStyle::setOriginalDisplay):
2267         (WebCore::RenderStyle::setPosition):
2268         (WebCore::RenderStyle::setFloating):
2269         (WebCore::RenderStyle::setOverflowX):
2270         (WebCore::RenderStyle::setOverflowY):
2271         (WebCore::RenderStyle::setVerticalAlign):
2272         (WebCore::RenderStyle::setUnicodeBidi):
2273         (WebCore::RenderStyle::setClear):
2274         (WebCore::RenderStyle::setTableLayout):
2275         (WebCore::RenderStyle::setHasExplicitlySetDirection):
2276         (WebCore::RenderStyle::setIsLink):
2277         (WebCore::RenderStyle::hasExplicitlySetWritingMode const):
2278         (WebCore::RenderStyle::setHasExplicitlySetWritingMode):
2279         (WebCore::RenderStyle::hasExplicitlySetTextAlign const):
2280         (WebCore::RenderStyle::setHasExplicitlySetTextAlign):
2281         (WebCore::RenderStyle::unique const):
2282         (WebCore::RenderStyle::setUnique):
2283         (WebCore::RenderStyle::emptyState const):
2284         (WebCore::RenderStyle::setEmptyState):
2285         (WebCore::RenderStyle::firstChildState const):
2286         (WebCore::RenderStyle::setFirstChildState):
2287         (WebCore::RenderStyle::lastChildState const):
2288         (WebCore::RenderStyle::setLastChildState):
2289         (WebCore::RenderStyle::setHasExplicitlyInheritedProperties):
2290         (WebCore::RenderStyle::hasExplicitlyInheritedProperties const):
2291         (WebCore::RenderStyle::inheritUnicodeBidiFrom):
2292         (WebCore::RenderStyle::NonInheritedFlags::operator!= const):
2293         (WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const):
2294         (WebCore::RenderStyle::originalDisplay const):
2295         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
2296         (WebCore::RenderStyle::NonInheritedFlags::copyNonInheritedFrom):
2297         (WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const):
2298         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle):
2299         (WebCore::RenderStyle::NonInheritedFlags::overflowX const): Deleted.
2300         (WebCore::RenderStyle::NonInheritedFlags::setOverflowX): Deleted.
2301         (WebCore::RenderStyle::NonInheritedFlags::overflowY const): Deleted.
2302         (WebCore::RenderStyle::NonInheritedFlags::setOverflowY): Deleted.
2303         (WebCore::RenderStyle::NonInheritedFlags::clear const): Deleted.
2304         (WebCore::RenderStyle::NonInheritedFlags::setClear): Deleted.
2305         (WebCore::RenderStyle::NonInheritedFlags::effectiveDisplay const): Deleted.
2306         (WebCore::RenderStyle::NonInheritedFlags::setEffectiveDisplay): Deleted.
2307         (WebCore::RenderStyle::NonInheritedFlags::position const): Deleted.
2308         (WebCore::RenderStyle::NonInheritedFlags::setPosition): Deleted.
2309         (WebCore::RenderStyle::NonInheritedFlags::originalDisplay const): Deleted.
2310         (WebCore::RenderStyle::NonInheritedFlags::setOriginalDisplay): Deleted.
2311         (WebCore::RenderStyle::NonInheritedFlags::unicodeBidi const): Deleted.
2312         (WebCore::RenderStyle::NonInheritedFlags::setUnicodeBidi): Deleted.
2313         (WebCore::RenderStyle::NonInheritedFlags::hasViewportUnits const): Deleted.
2314         (WebCore::RenderStyle::NonInheritedFlags::setHasViewportUnits): Deleted.
2315         (WebCore::RenderStyle::NonInheritedFlags::verticalAlign const): Deleted.
2316         (WebCore::RenderStyle::NonInheritedFlags::setVerticalAlign): Deleted.
2317         (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlyInheritedProperties const): Deleted.
2318         (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlyInheritedProperties): Deleted.
2319         (WebCore::RenderStyle::NonInheritedFlags::isFloating const): Deleted.
2320         (WebCore::RenderStyle::NonInheritedFlags::floating const): Deleted.
2321         (WebCore::RenderStyle::NonInheritedFlags::setFloating): Deleted.
2322         (WebCore::RenderStyle::NonInheritedFlags::tableLayout const): Deleted.
2323         (WebCore::RenderStyle::NonInheritedFlags::setTableLayout): Deleted.
2324         (WebCore::RenderStyle::NonInheritedFlags::styleType const): Deleted.
2325         (WebCore::RenderStyle::NonInheritedFlags::setStyleType): Deleted.
2326         (WebCore::RenderStyle::NonInheritedFlags::isUnique const): Deleted.
2327         (WebCore::RenderStyle::NonInheritedFlags::setIsUnique): Deleted.
2328         (WebCore::RenderStyle::NonInheritedFlags::emptyState const): Deleted.
2329         (WebCore::RenderStyle::NonInheritedFlags::setEmptyState): Deleted.
2330         (WebCore::RenderStyle::NonInheritedFlags::firstChildState const): Deleted.
2331         (WebCore::RenderStyle::NonInheritedFlags::setFirstChildState): Deleted.
2332         (WebCore::RenderStyle::NonInheritedFlags::lastChildState const): Deleted.
2333         (WebCore::RenderStyle::NonInheritedFlags::setLastChildState): Deleted.
2334         (WebCore::RenderStyle::NonInheritedFlags::affectedByHover const): Deleted.
2335         (WebCore::RenderStyle::NonInheritedFlags::setAffectedByHover): Deleted.
2336         (WebCore::RenderStyle::NonInheritedFlags::affectedByActive const): Deleted.
2337         (WebCore::RenderStyle::NonInheritedFlags::setAffectedByActive): Deleted.
2338         (WebCore::RenderStyle::NonInheritedFlags::affectedByDrag const): Deleted.
2339         (WebCore::RenderStyle::NonInheritedFlags::setAffectedByDrag): Deleted.
2340         (WebCore::RenderStyle::NonInheritedFlags::isLink const): Deleted.
2341         (WebCore::RenderStyle::NonInheritedFlags::setIsLink): Deleted.
2342         (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetDirection const): Deleted.
2343         (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetDirection): Deleted.
2344         (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetWritingMode const): Deleted.
2345         (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetWritingMode): Deleted.
2346         (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetTextAlign const): Deleted.
2347         (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetTextAlign): Deleted.
2348         (WebCore::RenderStyle::NonInheritedFlags::flagsMemoryOffset): Deleted.
2349         (WebCore::RenderStyle::NonInheritedFlags::flagIsaffectedByActive): Deleted.
2350         (WebCore::RenderStyle::NonInheritedFlags::flagIsaffectedByHover): Deleted.
2351         (WebCore::RenderStyle::NonInheritedFlags::flagPseudoStyle): Deleted.
2352         (WebCore::RenderStyle::NonInheritedFlags::setFirstChildStateFlags): Deleted.
2353         (WebCore::RenderStyle::NonInheritedFlags::setLastChildStateFlags): Deleted.
2354         (WebCore::RenderStyle::NonInheritedFlags::flagIsUnique): Deleted.
2355         (WebCore::RenderStyle::NonInheritedFlags::flagFirstChildState): Deleted.
2356         (WebCore::RenderStyle::NonInheritedFlags::flagLastChildState): Deleted.
2357         (WebCore::RenderStyle::NonInheritedFlags::NonInheritedFlags): Deleted.
2358         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles): Deleted.
2359         (WebCore::RenderStyle::NonInheritedFlags::updateBoolean): Deleted.
2360         (WebCore::RenderStyle::NonInheritedFlags::getBoolean const): Deleted.
2361         (WebCore::RenderStyle::NonInheritedFlags::updateValue): Deleted.
2362         (WebCore::RenderStyle::InheritedFlags::operator== const): Deleted.
2363         (WebCore::RenderStyle::NonInheritedFlags::getValue const): Deleted.
2364         (WebCore::adjustForAbsoluteZoom): Deleted.
2365         (WebCore::adjustFloatForAbsoluteZoom): Deleted.
2366         (WebCore::adjustLayoutUnitForAbsoluteZoom): Deleted.
2367         (WebCore::collapsedBorderStyle): Deleted.
2368         (WebCore::RenderStyle::hasBackground const): Deleted.
2369         (WebCore::RenderStyle::autoWrap): Deleted.
2370         (WebCore::RenderStyle::preserveNewline): Deleted.
2371         (WebCore::RenderStyle::collapseWhiteSpace): Deleted.
2372         (WebCore::RenderStyle::isCollapsibleWhiteSpace const): Deleted.
2373         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Deleted.
2374         (WebCore::RenderStyle::breakWords const): Deleted.
2375         (WebCore::RenderStyle::hasInlineColumnAxis const): Deleted.
2376         (WebCore::RenderStyle::imageOrientation const): Deleted.
2377         (WebCore::RenderStyle::setLogicalWidth): Deleted.
2378         (WebCore::RenderStyle::setLogicalHeight): Deleted.
2379         (WebCore::RenderStyle::setBorderRadius): Deleted.
2380         (WebCore::RenderStyle::setZoom): Deleted.
2381         (WebCore::RenderStyle::setEffectiveZoom): Deleted.
2382         (WebCore::RenderStyle::setTextOrientation): Deleted.
2383         (WebCore::RenderStyle::adjustBackgroundLayers): Deleted.
2384         (WebCore::RenderStyle::adjustMaskLayers): Deleted.
2385         (WebCore::RenderStyle::clearAnimations): Deleted.
2386         (WebCore::RenderStyle::clearTransitions): Deleted.
2387         (WebCore::RenderStyle::setShapeOutside): Deleted.
2388         (WebCore::RenderStyle::setShapeImageThreshold): Deleted.
2389         (WebCore::RenderStyle::setClipPath): Deleted.
2390         (WebCore::RenderStyle::willChangeCreatesStackingContext const): Deleted.
2391         (WebCore::RenderStyle::isDisplayRegionType const): Deleted.
2392         (WebCore::RenderStyle::setWritingMode): Deleted.
2393         (WebCore::RenderStyle::getShadowInlineDirectionExtent const): Deleted.
2394         (WebCore::RenderStyle::getShadowBlockDirectionExtent const): Deleted.
2395         (WebCore::RenderStyle::isDisplayReplacedType): Deleted.
2396         (WebCore::RenderStyle::isDisplayInlineType): Deleted.
2397         (WebCore::RenderStyle::isDisplayFlexibleBox): Deleted.
2398         (WebCore::RenderStyle::isDisplayGridBox): Deleted.
2399         (WebCore::RenderStyle::isDisplayFlexibleOrGridBox): Deleted.
2400         (WebCore::RenderStyle::hasAnyPublicPseudoStyles const): Deleted.
2401         (WebCore::RenderStyle::hasPseudoStyle const): Deleted.
2402         (WebCore::RenderStyle::setHasPseudoStyle): Deleted.
2403         (WebCore::RenderStyle::setHasPseudoStyles): Deleted.
2404         (WebCore::RenderStyle::setBoxReflect): Deleted.
2405         (WebCore::pseudoElementRendererIsNeeded): Deleted.
2406
2407 2017-08-31  Antti Koivisto  <antti@apple.com>
2408
2409         Remove newBlockInsideInlineModel and anonymous inline block
2410         https://bugs.webkit.org/show_bug.cgi?id=176181
2411
2412         Reviewed by Zalan Bujtas.
2413
2414         Anonymous inline block exists to support newBlockInsideInlineModel which was planned as the replacement for continuations.
2415         It has never been enabled and it is time to remove it.
2416
2417         * page/Settings.in:
2418         * rendering/InlineElementBox.cpp:
2419         (WebCore::InlineElementBox::paint):
2420         (WebCore::InlineElementBox::nodeAtPoint):
2421         * rendering/InlineFlowBox.cpp:
2422         (WebCore::InlineFlowBox::addToLine):
2423         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2424         (WebCore::InlineFlowBox::nodeAtPoint):
2425         (WebCore::InlineFlowBox::paint):
2426         (WebCore::InlineFlowBox::anonymousInlineBlock const): Deleted.
2427         * rendering/InlineFlowBox.h:
2428         (WebCore::InlineFlowBox::InlineFlowBox):
2429         (WebCore::InlineFlowBox::hasAnonymousInlineBlock const): Deleted.
2430         (WebCore::InlineFlowBox::setHasAnonymousInlineBlock): Deleted.
2431         * rendering/RenderBlock.cpp:
2432         (WebCore::RenderBlock::lineHeight const):
2433         (WebCore::RenderBlock::baselinePosition const):
2434         (WebCore::RenderBlock::renderName const):
2435         * rendering/RenderBlockFlow.cpp:
2436         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2437         (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing const):
2438         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
2439         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
2440         * rendering/RenderBlockFlow.h:
2441         * rendering/RenderBlockLineLayout.cpp:
2442         (WebCore::updateLogicalInlinePositions):
2443         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
2444         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
2445         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2446         (WebCore::RenderBlockFlow::layoutLineBoxes):
2447         (WebCore::RenderBlockFlow::determineStartPosition):
2448         (WebCore::RenderBlockFlow::matchedEndLine):
2449         (WebCore::RenderBlockFlow::marginCollapseLinesFromStart): Deleted.
2450         * rendering/RenderBox.cpp:
2451         (WebCore::RenderBox::sizesLogicalWidthToFitContent const):
2452         (WebCore::RenderBox::createsNewFormattingContext const):
2453         (WebCore::RenderBox::avoidsFloats const):
2454         * rendering/RenderInline.cpp:
2455         (WebCore::RenderInline::addChildIgnoringContinuation):
2456         * rendering/RenderObject.cpp:
2457         (WebCore::RenderObject::isAnonymousInlineBlock const): Deleted.
2458         * rendering/RenderObject.h:
2459         (WebCore::RenderObject::isAnonymousBlock const):
2460         * rendering/RootInlineBox.cpp:
2461         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
2462         (WebCore::RootInlineBox::ascentAndDescentForBox const):
2463         * rendering/line/BreakingContext.h:
2464         (WebCore::BreakingContext::BreakingContext):
2465         (WebCore::BreakingContext::handleReplaced):
2466         * rendering/line/LineBreaker.cpp:
2467         (WebCore::LineBreaker::nextLineBreak):
2468         * rendering/line/LineBreaker.h:
2469         * rendering/line/LineLayoutState.h:
2470         (WebCore::LineLayoutState::marginInfo):
2471         (WebCore::LineLayoutState::prevFloatBottomFromAnonymousInlineBlock): Deleted.
2472         (WebCore::LineLayoutState::maxFloatBottomFromAnonymousInlineBlock): Deleted.
2473
2474 2017-08-31  Ryan Haddad  <ryanhaddad@apple.com>
2475
2476         Unreviewed, rolling out r221445.
2477
2478         This change broke Sierra Release builds.
2479
2480         Reverted changeset:
2481
2482         "Switch HTMLMediaElement to release logging"
2483         https://bugs.webkit.org/show_bug.cgi?id=176065
2484         http://trac.webkit.org/changeset/221445
2485
2486 2017-08-31  Youenn Fablet  <youenn@apple.com>
2487
2488         Update CacheStorage caches only if it is updated
2489         https://bugs.webkit.org/show_bug.cgi?id=176135
2490
2491         Reviewed by Alex Christensen.
2492
2493         Covered by existing tests.
2494
2495         When retrieving caches from the engine, CacheStorage gets an update counter.
2496         When this counter is different from the previous received one, CacheStorage will update its cache list.
2497         Otherwise it will skip this update step.
2498
2499         * Modules/cache/CacheStorage.cpp:
2500         (WebCore::CacheStorage::retrieveCaches):
2501         * Modules/cache/CacheStorage.h:
2502         * Modules/cache/CacheStorageConnection.cpp:
2503         (WebCore::CacheStorageConnection::retrieveCaches):
2504         * Modules/cache/CacheStorageConnection.h:
2505         (WebCore::CacheStorageConnection::doRetrieveCaches):
2506         * Modules/cache/DOMCache.cpp:
2507         (WebCore::DOMCache::CacheInfos::isolatedCopy):
2508         * Modules/cache/DOMCache.h:
2509         (WebCore::DOMCache::CacheInfos::encode const):
2510         (WebCore::DOMCache::CacheInfos::decode):
2511         * Modules/cache/WorkerCacheStorageConnection.cpp:
2512         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
2513         * Modules/cache/WorkerCacheStorageConnection.h:
2514
2515 2017-08-31  Eric Carlson  <eric.carlson@apple.com>
2516
2517         Switch HTMLMediaElement to release logging
2518         https://bugs.webkit.org/show_bug.cgi?id=176065
2519
2520         Reviewed by Jer Noble.
2521
2522         * dom/Document.cpp:
2523         (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
2524         mode is enabled.
2525         (WebCore::Document::logger const):
2526         * dom/Document.h:
2527
2528         Convert debug-only logging to configurable release logging.
2529         * html/HTMLMediaElement.cpp:
2530         (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
2531         String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
2532         * html/HTMLMediaElement.h:
2533
2534 2017-08-31  David Quesada  <david_quesada@apple.com>
2535
2536         WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading
2537         https://bugs.webkit.org/show_bug.cgi?id=176128
2538         rdar://problem/34068476
2539
2540         Reviewed by Brady Eidson.
2541
2542         Removed FrameLoaderClient::dispatchDidPerformClientRedirect() since no client cares about this event anymore.
2543         Also removed FrameLoader::performClientRedirect() since it wouldn't do anything but call changeLocation().
2544
2545         No new tests - no change in functionality.
2546
2547         * loader/FrameLoader.cpp:
2548         * loader/FrameLoader.h:
2549         * loader/FrameLoaderClient.h:
2550         * loader/NavigationScheduler.cpp:
2551
2552 2017-08-31  Chris Dumez  <cdumez@apple.com>
2553
2554         getFileMetadata() does not work as expected for symbolic links
2555         https://bugs.webkit.org/show_bug.cgi?id=176143
2556
2557         Reviewed by Andreas Kling.
2558
2559         getFileMetadata() does not work as expected for symbolic links:
2560         On POSIX, getFileMetadata() always followed symlinks, which meant that FileMetadata.type could
2561         never be TypeSymbolicLink. On Windows, the function properly did not follow symlinks but failed to set
2562         FileMetadata.type to TypeSymbolicLink when the file was a symbolic link.
2563
2564         This patch adds a new ShouldFollowSymbolicLinks parameter to getFileMetadata() so that
2565         the call site can decide the behavior it wants. If getFileMetadata() is called on a
2566         symbolic link with ShouldFollowSymbolicLinks::No as parameter, FileMetadata.type is now
2567         properly set to TypeSymbolicLink.
2568
2569         No new tests, covered by new API test.
2570
2571         * Modules/entriesapi/DOMFileSystem.cpp:
2572         (WebCore::listDirectoryWithMetadata):
2573         It is important we do not follow symlinks here since the code wants to discard them
2574         and does so by checking FileMetadata.type.
2575
2576         * WebCore.xcodeproj/project.pbxproj:
2577         * fileapi/File.cpp:
2578         (WebCore::File::isDirectory const):
2579
2580         * html/FileListCreator.cpp:
2581         (WebCore::appendDirectoryFiles):
2582         (WebCore::FileListCreator::createFileList):
2583         It is important we do not follow symlinks here since the code wants to discard them
2584         and does so by checking FileMetadata.type.
2585
2586         * platform/FileSystem.cpp:
2587         (WebCore::fileIsDirectory):
2588         * platform/FileSystem.h:
2589         * platform/glib/FileSystemGlib.cpp:
2590         (WebCore::getFileLStat):
2591         (WebCore::getFileMetadata):
2592         * platform/posix/FileSystemPOSIX.cpp:
2593         (WebCore::getFileMetadata):
2594         (WebCore::createSymbolicLink):
2595         * platform/win/FileSystemWin.cpp:
2596         (WebCore::getFinalPathName):
2597         (WebCore::getFileMetadata):
2598         (WebCore::createSymbolicLink):
2599         - Add new createSymbolicLink() function for testing purposes.
2600         - On Posix, call lstat() instead of stat if ShouldFollowSymbolicLinks::No.
2601         - On Windows, since FindFirstFileW() does not follow symlinks, resolve
2602           final path using GetFinalPathNameByHandleW() if ShouldFollowSymbolicLinks::Yes.
2603         - On Windows, properly set FileMetadata.type to TypeSymbolicLink if the file
2604           is a symbolic link.
2605
2606 2017-08-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2607
2608         REGRESSION(r221226): [SOUP] libsoup-CRITICAL **: soup_cookies_to_cookie_header: assertion 'cookies != NULL' failed
2609         https://bugs.webkit.org/show_bug.cgi?id=176140
2610
2611         Reviewed by Carlos Garcia Campos.
2612
2613         This should fix unexpected stderr output in several tests.
2614
2615         * platform/network/soup/CookieJarSoup.cpp:
2616         (WebCore::cookiesForSession):
2617
2618 2017-08-31  Youenn Fablet  <youenn@apple.com>
2619
2620         Add support for Request body stream cloning
2621         https://bugs.webkit.org/show_bug.cgi?id=176148
2622
2623         Reviewed by Alex Christensen.
2624
2625         Tests: http/wpt/fetch/request-clone.html
2626                http/wpt/fetch/request-consume-stream.html
2627                http/wpt/fetch/request-stream-disturbed-1.html
2628                http/wpt/fetch/request-stream-disturbed-2.html
2629                http/wpt/fetch/request-stream-disturbed-3.html
2630
2631         Adding support for ReadableStream teeing for cloning fetch bodies.
2632         Adding support for pushing request body data to its ReadableStream.
2633         Renamed FetchResponseSource to FetchBodySource for that purpose.
2634
2635         Tests extracting body from a ReadableStream through JS API pass.
2636         Tests extracting data stored in a ReadableStream to resolve fetch body promises are failing.
2637         There is no support yet, this will be added as a follow-up.
2638
2639         * CMakeLists.txt:
2640         * Modules/fetch/FetchBody.cpp:
2641         (WebCore::FetchBody::consume):
2642         (WebCore::FetchBody::consumeAsStream):
2643         (WebCore::FetchBody::clone):
2644         * Modules/fetch/FetchBody.h:
2645         * Modules/fetch/FetchBodyConsumer.h:
2646         * Modules/fetch/FetchBodyOwner.cpp:
2647         (WebCore::FetchBodyOwner::cloneBody):
2648         (WebCore::FetchBodyOwner::loadBlob):
2649         (WebCore::FetchBodyOwner::readableStream):
2650         (WebCore::FetchBodyOwner::consumeBodyAsStream):
2651         * Modules/fetch/FetchBodyOwner.h:
2652         (WebCore::FetchBodyOwner::feedStream):
2653         (WebCore::FetchBodyOwner::cancel):
2654         * Modules/fetch/FetchBodySource.cpp: Renamed from Source/WebCore/Modules/fetch/FetchResponseSource.cpp.
2655         * Modules/fetch/FetchBodySource.h: Renamed from Source/WebCore/Modules/fetch/FetchResponseSource.h.
2656         * Modules/fetch/FetchResponse.cpp:
2657         (WebCore::FetchResponse::consumeBodyAsStream):
2658         (WebCore::FetchResponse::createReadableStream):
2659         * Modules/fetch/FetchResponse.h:
2660         * Modules/fetch/FetchResponse.idl:
2661         * Modules/fetch/FetchResponse.js:
2662         (getter.body):
2663         (clone):
2664         * WebCore.xcodeproj/project.pbxproj:
2665         * bindings/js/ReadableStream.cpp:
2666         (WebCore::ReadableStream::tee):
2667         * bindings/js/ReadableStream.h:
2668         * bindings/js/WebCoreBuiltinNames.h:
2669
2670 2017-08-31  Chris Dumez  <cdumez@apple.com>
2671
2672         Use WTF::crossThreadCopy() in more places
2673         https://bugs.webkit.org/show_bug.cgi?id=176169
2674
2675         Reviewed by Andreas Kling.
2676
2677         Use WTF::crossThreadCopy() in more places to make code more concise.
2678
2679         * Modules/indexeddb/IDBValue.cpp:
2680         (WebCore::IDBValue::setAsIsolatedCopy):
2681
2682 2017-08-31  Jer Noble  <jer.noble@apple.com>
2683
2684         MSE-to-Canvas painting can become "stuck" during heavy workloads
2685         https://bugs.webkit.org/show_bug.cgi?id=176170
2686
2687         Reviewed by Eric Carlson.
2688
2689         During heavy workloads, the trigger from CMBufferQueue notifying us that we have dipped below
2690         the "low-water mark" of decoded (and decoding) frames will not fire. Instead of using a trigger
2691         (since it will not fire when the number of "frames being decoded" changes, just the number of
2692         decoded frames), just call maybeBecomeReadyForMoreMediaData() whenever the number of frames in
2693         the decoded queue decreases, or when the number of frames being decoded decreases.
2694
2695         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
2696         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2697         (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
2698         (WebCore::WebCoreDecompressionSession::enqueueSample):
2699         (WebCore::WebCoreDecompressionSession::decodeSample):
2700         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
2701         (WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
2702         (WebCore::WebCoreDecompressionSession::automaticDequeue):
2703         (WebCore::WebCoreDecompressionSession::imageForTime):
2704         (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaDataCallback): Deleted.
2705
2706 2017-08-31  Youenn Fablet  <youenn@apple.com>
2707
2708         Move consume promise from FetchBody to FetchBodyConsumer
2709         https://bugs.webkit.org/show_bug.cgi?id=176121
2710
2711         Reviewed by Alex Christensen.
2712
2713         No change of behavior.
2714
2715         FetchBodyConsumer should be made responsible for data consumption through promise getters and ReadableStream.
2716         This will allow making data consumption consistent for Request and Response.
2717         This patch is doing the first step.
2718
2719         * Modules/fetch/FetchBody.cpp:
2720         (WebCore::FetchBody::consumeOnceLoadingFinished):
2721         (WebCore::FetchBody::consumeBlob):
2722         (WebCore::FetchBody::loadingFailed):
2723         (WebCore::FetchBody::loadingSucceeded):
2724         (WebCore::FetchBody::clone const):
2725         * Modules/fetch/FetchBody.h:
2726         (WebCore::FetchBody::cleanConsumer):
2727         (WebCore::FetchBody::cleanConsumePromise): Deleted.
2728         * Modules/fetch/FetchBodyConsumer.cpp:
2729         (WebCore::FetchBodyConsumer::setConsumePromise):
2730         (WebCore::FetchBodyConsumer::loadingFailed):
2731         (WebCore::FetchBodyConsumer::loadingSucceeded):
2732         (WebCore::FetchBodyConsumer::clean):
2733         * Modules/fetch/FetchBodyConsumer.h:
2734         (WebCore::FetchBodyConsumer::clean): Deleted.
2735         * Modules/fetch/FetchBodyOwner.cpp:
2736         (WebCore::FetchBodyOwner::stop):
2737
2738 2017-08-22  Darin Adler  <darin@apple.com>
2739
2740         REGRESSION (r220052): ASSERTION FAILED: !frame().isMainFrame() || !needsStyleRecalcOrLayout()  in WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive()
2741         https://bugs.webkit.org/show_bug.cgi?id=175270
2742
2743         Reviewed by Simon Fraser and Antti Koivisto.
2744
2745         * dom/Document.cpp:
2746         (WebCore::Document::Document): Initialize m_styleRecalcTimer with a lamdba so it can work
2747         with a function that returns a bool and ignore the return value.
2748         (WebCore::Document::updateStyleIfNeeded): Added a boolean return value indicating if the
2749         function did any work or not.
2750         * dom/Document.h: Updated for above change.
2751
2752         * page/FrameView.cpp:
2753         (WebCore::appendRenderedChildren): Added helper that will later replace the
2754         FrameView::renderedChildFrameViews function and is used below.
2755         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Instead of always doing two
2756         passes of style and layout update do up to 25 passes, but stop as soon as a pass does
2757         no work. This is slightly more efficient in cases where no layout and style update is
2758         needed, and works correctly when a additional passes are needed, which is what happens
2759         in the test that was failing. We can eventually improve this further, but this resolves
2760         the immediate problem we are seeing in the test.
2761
2762 2017-08-22  Filip Pizlo  <fpizlo@apple.com>
2763
2764         Strings need to be in some kind of gigacage
2765         https://bugs.webkit.org/show_bug.cgi?id=174924
2766
2767         Reviewed by Oliver Hunt.
2768
2769         No new tests because no new behavior.
2770
2771         * html/canvas/CanvasRenderingContext2D.cpp:
2772         (WebCore::normalizeSpaces):
2773
2774 2017-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2775
2776         [JSC] Use reifying system for "name" property of builtin JSFunction
2777         https://bugs.webkit.org/show_bug.cgi?id=175260
2778
2779         Reviewed by Saam Barati.
2780
2781         Test: js/dom/builtin-getter-name.html
2782
2783         Use @getter for JSBuiltin getters.
2784
2785         * Modules/fetch/FetchResponse.js:
2786         (bodyUsed): Deleted.
2787         (body): Deleted.
2788         * Modules/streams/ReadableByteStreamController.js:
2789         (byobRequest): Deleted.
2790         (desiredSize): Deleted.
2791         * Modules/streams/ReadableStream.js:
2792         (locked): Deleted.
2793         * Modules/streams/ReadableStreamBYOBReader.js:
2794         (closed): Deleted.
2795         * Modules/streams/ReadableStreamBYOBRequest.js:
2796         (view): Deleted.
2797         * Modules/streams/ReadableStreamDefaultController.js:
2798         (desiredSize): Deleted.
2799         * Modules/streams/ReadableStreamDefaultReader.js:
2800         (closed): Deleted.
2801         * Modules/streams/WritableStream.js:
2802         (closed): Deleted.
2803         (ready): Deleted.
2804         (state): Deleted.
2805         * bindings/js/JSDOMBuiltinConstructor.h:
2806         (WebCore::JSDOMBuiltinConstructor<JSClass>::finishCreation):
2807
2808 2017-08-30  Chris Dumez  <cdumez@apple.com>
2809
2810         Implement FileSystemDirectoryReader.readEntries()
2811         https://bugs.webkit.org/show_bug.cgi?id=176091
2812         <rdar://problem/34168015>
2813
2814         Reviewed by Andreas Kling.
2815
2816         Tests: editing/pasteboard/datatransfer-items-drop-directoryReader-error.html
2817                editing/pasteboard/datatransfer-items-drop-directoryReader-root.html
2818                editing/pasteboard/datatransfer-items-drop-directoryReader.html
2819
2820         * Modules/entriesapi/DOMFileSystem.cpp:
2821         (WebCore::ListedChild::isolatedCopy const):
2822         (WebCore::listDirectoryWithMetadata):
2823         (WebCore::toFileSystemEntries):
2824         (WebCore::DOMFileSystem::DOMFileSystem):
2825         (WebCore::DOMFileSystem::root):
2826         (WebCore::DOMFileSystem::fileAsEntry):
2827         (WebCore::DOMFileSystem::evaluatePath):
2828         (WebCore::DOMFileSystem::listDirectory):
2829         * Modules/entriesapi/DOMFileSystem.h:
2830         (WebCore::DOMFileSystem::createEntryForFile):
2831         * Modules/entriesapi/DOMFileSystem.idl:
2832         - Implement directory listing operation for supporting
2833           FileSystemDirectoryReader::readEntries().
2834         - Implement evaluatePath() operation as per:
2835           - https://wicg.github.io/entries-api/#evaluate-a-path
2836         - DOMFileSystem should no longer hold a strong reference to
2837           the root entry and FileSystemEntry now holds a strong
2838           reference to the DOMFileSystem and this would create a
2839           cycle.
2840
2841         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
2842         (WebCore::FileSystemDirectoryEntry::createReader):
2843         * Modules/entriesapi/FileSystemDirectoryEntry.h:
2844         * Modules/entriesapi/FileSystemDirectoryEntry.idl:
2845         Have createReader() take a ScriptExecutionContext, which is needed
2846         to construct a FileSystemDirectoryReader, now that FileSystemDirectoryReader
2847         is an ActiveDOMObject.
2848
2849         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
2850         (WebCore::FileSystemDirectoryReader::FileSystemDirectoryReader):
2851         (WebCore::FileSystemDirectoryReader::activeDOMObjectName const):
2852         (WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const):
2853         (WebCore::FileSystemDirectoryReader::readEntries):
2854         * Modules/entriesapi/FileSystemDirectoryReader.h:
2855         * Modules/entriesapi/FileSystemDirectoryReader.idl:
2856         Provide implementation for FileSystemDirectoryReader.readEntries() as per:
2857         - https://wicg.github.io/entries-api/#dom-filesystemdirectoryreader-readentries
2858         For the actual directory listing operation, we ask the DOMFileSystem, which is
2859         where all filesystem operations should live.
2860         Also made the FileSystemDirectoryReader an ActiveDOMObject to keep it and its
2861         wrapper alive while a file system operation is pending.
2862
2863         * Modules/entriesapi/FileSystemEntry.cpp:
2864         (WebCore::FileSystemEntry::~FileSystemEntry):
2865         (WebCore::FileSystemEntry::filesystem const):
2866         * Modules/entriesapi/FileSystemEntry.h:
2867         Make FileSystemEntry keep a strong reference to its DOMFileSystem object.
2868         Previously, the DOMFileSystem was kept alive by the DataTransferItem but
2869         this was unsafe because FileSystemEntry may outlive the DataTransferItem.
2870
2871         * dom/ActiveDOMObject.h:
2872         (WebCore::ActiveDOMObject::PendingActivity::PendingActivity):
2873         (WebCore::ActiveDOMObject::PendingActivity::~PendingActivity):
2874         (WebCore::ActiveDOMObject::makePendingActivity):
2875         Add PendingActivity / makePendingActivity() as a less error-prone
2876         replacement for setPendingActivity() / unsetPendingActivity().
2877
2878         * dom/DOMException.cpp:
2879         (WebCore::DOMException::create):
2880         * dom/DOMException.h:
2881         Add factory to construct a DOMException from an Exception.
2882
2883         * dom/DataTransferItem.cpp:
2884         (WebCore::DataTransferItem::getAsEntry const):
2885         * dom/DataTransferItem.h:
2886
2887         * dom/Exception.h:
2888         (WebCore::Exception::isolatedCopy const):
2889         * dom/ExceptionOr.h:
2890         Make ExceptionOr<> / Exception work with CrossThreadCopier for convenience.
2891
2892         * html/FileListCreator.cpp:
2893         (WebCore::FileListCreator::FileListCreator):
2894         Use crossThreadCopy() instead of longer form.
2895
2896         * platform/FileSystem.h:
2897         * platform/glib/FileSystemGlib.cpp:
2898         (WebCore::pathByAppendingComponents):
2899         * platform/posix/FileSystemPOSIX.cpp:
2900         (WebCore::pathByAppendingComponents):
2901         * platform/win/FileSystemWin.cpp:
2902         (WebCore::pathByAppendingComponents):
2903         Add pathByAppendingComponents() utility function, which is similar to
2904         pathByAppendingComponent() but supports appending multiple components
2905         in an efficient fashion.
2906
2907 2017-08-30  Antti Koivisto  <antti@apple.com>
2908
2909         Factor RenderMultiColumnFlowThread construction and destruction into RenderTreeUpdater helper
2910         https://bugs.webkit.org/show_bug.cgi?id=176130
2911
2912         Reviewed by Zalan Bujtas.
2913
2914         Move mutation code out of the render tree.
2915
2916         * WebCore.xcodeproj/project.pbxproj:
2917         * rendering/RenderBlockFlow.cpp:
2918         (WebCore::RenderBlockFlow::createMultiColumnFlowThread): Deleted.
2919         (WebCore::RenderBlockFlow::destroyMultiColumnFlowThread): Deleted.
2920         * rendering/RenderBlockFlow.h:
2921         * style/RenderTreeUpdater.cpp:
2922         (WebCore::RenderTreeUpdater::commit):
2923         (WebCore::RenderTreeUpdater::updateAfterDescendants):
2924         (WebCore::updateMultiColumnFlowThread): Deleted.
2925         * style/RenderTreeUpdater.h:
2926         * style/RenderTreeUpdaterMultiColumn.cpp: Added.
2927         (WebCore::RenderTreeUpdater::MultiColumn::update):
2928         (WebCore::RenderTreeUpdater::MultiColumn::createFlowThread):
2929         * style/RenderTreeUpdaterMultiColumn.h: Added.
2930
2931 2017-08-30  Myles C. Maxfield  <mmaxfield@apple.com>
2932
2933         Previous elements with lang= can affect fonts selected for subsequent elements
2934         https://bugs.webkit.org/show_bug.cgi?id=175959
2935         <rdar://problem/33785853>
2936
2937         Reviewed by Zalan Bujtas.
2938
2939         FontCascade::update() was erroneously getting a cache hit. Elements with different lang=
2940         should be distinct inside the FontCascadeCache. We should be keying off of the locale
2941         string instead of the script enum because the string is the thing we actually pass to the
2942         platform APIs when performing font selection. This is a regression because we only
2943         recently (within the past few years) started making font selection sensitive to lang= at
2944         all.
2945
2946         Test: fast/text/lang-font-selection-cache.html
2947
2948         * platform/graphics/FontCache.h:
2949         (WebCore::FontDescriptionKey::FontDescriptionKey):
2950         (WebCore::FontDescriptionKey::operator== const):
2951         (WebCore::FontDescriptionKey::computeHash const):
2952
2953 2017-08-30  Ryan Haddad  <ryanhaddad@apple.com>
2954
2955         Unreviewed, rolling out r221327.
2956
2957         This change caused test262 failures.
2958
2959         Reverted changeset:
2960
2961         "[JSC] Use reifying system for "name" property of builtin
2962         JSFunction"
2963         https://bugs.webkit.org/show_bug.cgi?id=175260
2964         http://trac.webkit.org/changeset/221327
2965
2966 2017-08-30  Youenn Fablet  <youenn@apple.com>
2967
2968         [Cache API] Support cache names persistency
2969         https://bugs.webkit.org/show_bug.cgi?id=175995
2970
2971         Reviewed by Alex Christensen.
2972
2973         Test: http/tests/cache-storage/cache-persistency.https.html
2974
2975         Adding method to clear the memory representation of the cache storage.
2976         Exposing it as internals so that layout tests can be used for testing persistency by combining clearing and private browsing mode.
2977
2978         Introducing ReadDisk and WriteDisk errors that are used by CacheStorage::Engine.
2979
2980         * Modules/cache/CacheStorageConnection.h:
2981         (WebCore::CacheStorageConnection::clearMemoryRepresentation):
2982         * Modules/cache/DOMCache.cpp:
2983         (WebCore::DOMCache::errorToException):
2984         * Modules/cache/DOMCache.h:
2985         * testing/Internals.cpp:
2986         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
2987         * testing/Internals.h:
2988         * testing/Internals.idl:
2989
2990 2017-08-30  Matt Lewis  <jlewis3@apple.com>
2991
2992         Unreviewed, rolling out r221384.
2993
2994         This patch caused multiple 32-bit JSC test failures.
2995
2996         Reverted changeset:
2997
2998         "Strings need to be in some kind of gigacage"
2999         https://bugs.webkit.org/show_bug.cgi?id=174924
3000         http://trac.webkit.org/changeset/221384
3001
3002 2017-08-30  Brady Eidson  <beidson@apple.com>
3003
3004         Add "Identified" base class to replace a whole bunch of custom identifier generators.
3005         https://bugs.webkit.org/show_bug.cgi?id=176120
3006
3007         Reviewed by Alex Christensen.
3008
3009         No new tests (No behavior change).
3010
3011         Instead of repeating the common pattern of a class with an integer identifier keeping its
3012         own static counter of the next identifier and generating it for each instance, this
3013         uses a common template in WTF that does that automatically.
3014
3015         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3016         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
3017         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionPendingCloseFromClient):
3018         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
3019         (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer):
3020         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
3021         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
3022         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
3023         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
3024         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
3025         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
3026         (WebCore::IDBServer::nextDatabaseConnectionIdentifier): Deleted.
3027         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3028         (WebCore::IDBServer::UniqueIDBDatabaseConnection::identifier const): Deleted.
3029
3030         * workers/service/ServiceWorkerJobData.cpp:
3031         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
3032         (WebCore::ServiceWorkerJobData::isolatedCopy const):
3033         * workers/service/ServiceWorkerJobData.h:
3034         (WebCore::ServiceWorkerJobData::encode const):
3035         (WebCore::ServiceWorkerJobData::decode):
3036         (WebCore::ServiceWorkerJobData::identifier const): Deleted.
3037
3038         * workers/service/server/SWServer.cpp:
3039         (WebCore::SWServer::Connection::Connection):
3040         * workers/service/server/SWServer.h:
3041         (WebCore::SWServer::Connection::identifier const): Deleted.
3042
3043         * workers/service/server/SWServerRegistration.cpp:
3044         (WebCore::SWServerRegistration::SWServerRegistration):
3045         (WebCore::SWServerRegistration::data const):
3046         * workers/service/server/SWServerRegistration.h:
3047         (WebCore::SWServerRegistration::identifier const): Deleted.
3048
3049 2017-08-30  Youenn Fablet  <youenn@apple.com>
3050
3051         Remove FetchRequest::InternalRequest
3052         https://bugs.webkit.org/show_bug.cgi?id=176085
3053
3054         Reviewed by Alex Christensen.
3055
3056         No change of behavior.
3057
3058         Removing InternalRequest struct and passing/defining fields directly.
3059
3060         * Modules/cache/Cache.cpp:
3061         (WebCore::Cache::updateRecords):
3062         * Modules/fetch/FetchRequest.cpp:
3063         (WebCore::computeReferrer):
3064         (WebCore::buildOptions):
3065         (WebCore::methodCanHaveBody):
3066         (WebCore::FetchRequest::initializeOptions):
3067         (WebCore::FetchRequest::initializeWith):
3068         (WebCore::FetchRequest::setBody):
3069         (WebCore::FetchRequest::create):
3070         (WebCore::FetchRequest::referrer const):
3071         (WebCore::FetchRequest::urlString const):
3072         (WebCore::FetchRequest::resourceRequest const):
3073         (WebCore::FetchRequest::clone):
3074         (WebCore::setReferrer): Deleted.
3075         * Modules/fetch/FetchRequest.h:
3076         (WebCore::FetchRequest::FetchRequest):
3077         (WebCore::FetchRequest::cache const):
3078         (WebCore::FetchRequest::credentials const):
3079         (WebCore::FetchRequest::destination const):
3080         (WebCore::FetchRequest::mode const):
3081         (WebCore::FetchRequest::redirect const):
3082         (WebCore::FetchRequest::referrerPolicy const):
3083         (WebCore::FetchRequest::type const):
3084
3085 2017-08-30  Youenn Fablet  <youenn@apple.com>
3086
3087         Add support for FetchRequest.body
3088         https://bugs.webkit.org/show_bug.cgi?id=176066
3089         <rdar://problem/34148373>
3090
3091         Reviewed by Sam Weinig and Alex Christensen.
3092
3093         Follow-up to https://trac.webkit.org/r221329 as per post landing comments.
3094         Returning a RefPtr<ReadableStream> so as to to not specialize ReadableStream converter.
3095
3096         * Modules/fetch/FetchBodyOwner.cpp:
3097         (WebCore::FetchBodyOwner::readableStream):
3098         * Modules/fetch/FetchBodyOwner.h:
3099         * bindings/js/ReadableStream.h:
3100         (WebCore::toJS):
3101         (WebCore::JSConverter<IDLInterface<ReadableStream>>::convert): Deleted.
3102
3103 2017-08-30  Per Arne Vollan  <pvollan@apple.com>
3104
3105         [Win] Crash in MathML layout test.
3106         https://bugs.webkit.org/show_bug.cgi?id=176109
3107
3108         Reviewed by Brent Fulgham.
3109
3110         Return early if no font can be found for code point.
3111
3112         No new tests, covered by existing tests. 
3113
3114         * rendering/mathml/MathOperator.cpp:
3115         (WebCore::MathOperator::paintVerticalGlyphAssembly):
3116         (WebCore::MathOperator::paintHorizontalGlyphAssembly):
3117
3118 2017-08-30  Brady Eidson  <beidson@apple.com>
3119
3120         Implement all of "Register" right up until where the script is fetched.
3121         https://bugs.webkit.org/show_bug.cgi?id=176082
3122
3123         Reviewed by Andy Estes.
3124
3125         Test: http/tests/workers/service/basic-register-exceptions.html
3126
3127         This patch implements every detail of the "Register" and "Update" algorithms right up to
3128         where we would actually fetch the service worker script file.
3129
3130         It also includes miscellaneous refactoring and cleanup along the way.
3131
3132         * CMakeLists.txt:
3133         * WebCore.xcodeproj/project.pbxproj:
3134
3135         * page/SecurityOrigin.cpp:
3136         (WebCore::shouldTreatAsPotentiallyTrustworthy): Expose in the header for other files to use.
3137         * page/SecurityOrigin.h:
3138
3139         * workers/service/ServiceWorkerContainer.cpp:
3140         (WebCore::ServiceWorkerContainer::addRegistration): Add some more exception cases from the spec.
3141         (WebCore::ServiceWorkerContainer::scheduleJob): Use the correct job identifier.
3142         (WebCore::ServiceWorkerContainer::jobFailedWithException):
3143         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3144         (WebCore::ServiceWorkerContainer::jobDidFinish):
3145         * workers/service/ServiceWorkerContainer.h:
3146
3147         * workers/service/ServiceWorkerJob.cpp:
3148         (WebCore::ServiceWorkerJob::ServiceWorkerJob):
3149         (WebCore::ServiceWorkerJob::failedWithException): Call through to the client to handle the failure.
3150         (WebCore::ServiceWorkerJob::resolvedWithRegistration): Call through to the client to handle success.
3151         * workers/service/ServiceWorkerJob.h:
3152         (WebCore::ServiceWorkerJob::promise):
3153         (WebCore::ServiceWorkerJob::identifier const): Deleted. Rely on the identifier from the JobData.
3154
3155         * workers/service/ServiceWorkerJobClient.h:
3156
3157         * workers/service/ServiceWorkerJobData.cpp:
3158         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
3159         (WebCore::ServiceWorkerJobData::isolatedCopy const):
3160         * workers/service/ServiceWorkerJobData.h:
3161         (WebCore::ServiceWorkerJobData::identifier const):
3162         (WebCore::ServiceWorkerJobData::encode const):
3163         (WebCore::ServiceWorkerJobData::decode):
3164         (WebCore::ServiceWorkerJobData::jobIdentifier const): Deleted.
3165
3166         * workers/service/ServiceWorkerRegistration.cpp:
3167         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): Make this class an ActiveDOMObject
3168           both because it *is* an active DOM object and because we need to get at the ScriptExecutionContext.
3169         * workers/service/ServiceWorkerRegistration.h:
3170
3171         Add a class to encapsulate everything about a registration for encode/decode/crossthread:
3172         * workers/service/ServiceWorkerRegistrationData.cpp:
3173         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
3174         * workers/service/ServiceWorkerRegistrationData.h: 
3175         (WebCore::ServiceWorkerRegistrationData::encode const):
3176         (WebCore::ServiceWorkerRegistrationData::decode):
3177
3178         * workers/service/ServiceWorkerRegistrationKey.cpp:
3179         (WebCore::ServiceWorkerRegistrationKey::isolatedCopy const):
3180         * workers/service/ServiceWorkerRegistrationKey.h:
3181         (WebCore::ServiceWorkerRegistrationKey::encode const):
3182         (WebCore::ServiceWorkerRegistrationKey::decode):
3183
3184         * workers/service/server/SWClientConnection.cpp:
3185         (WebCore::SWClientConnection::scheduleJob):
3186         (WebCore::SWClientConnection::jobResolvedInServer):
3187         * workers/service/server/SWClientConnection.h:
3188
3189         * workers/service/server/SWServer.cpp:
3190         (WebCore::SWServer::~SWServer):
3191         (WebCore::SWServer::Connection::scheduleJobInServer):
3192         (WebCore::SWServer::scheduleJob):
3193         (WebCore::SWServer::rejectJob):
3194         (WebCore::SWServer::resolveJob):
3195         * workers/service/server/SWServer.h:
3196
3197         * workers/service/server/SWServerRegistration.cpp:
3198         (WebCore::SWServerRegistration::SWServerRegistration):
3199         (WebCore::SWServerRegistration::startNextJob):
3200         (WebCore::SWServerRegistration::isEmpty):
3201         (WebCore::SWServerRegistration::getNewestWorker): Implement "Get Newest Worker" algorithm.
3202         (WebCore::SWServerRegistration::runRegisterJob): Implement the rest of the "Register" algorithm.
3203         (WebCore::SWServerRegistration::runUpdateJob): Implement every part of "Update" up to where we would fetch.
3204         (WebCore::SWServerRegistration::rejectWithExceptionOnMainThread):
3205         (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
3206         (WebCore::SWServerRegistration::resolveCurrentJob):
3207         (WebCore::SWServerRegistration::data const):
3208         (WebCore::SWServerRegistration::performCurrentJob): Deleted.
3209         * workers/service/server/SWServerRegistration.h:
3210         (WebCore::SWServerRegistration::identifier const):
3211
3212         Add a stub class to represent "active service workers" in the SWServer:
3213         * workers/service/server/SWServerWorker.cpp:
3214         (WebCore::SWServerWorker::SWServerWorker):
3215         (WebCore::SWServerWorker::~SWServerWorker):
3216         * workers/service/server/SWServerWorker.h: 
3217         (WebCore::SWServerWorker::scriptURL const):
3218
3219 2017-08-30  Don Olmstead  <don.olmstead@sony.com>
3220
3221         [CMake][WinCairo] Use find_package for libpng and libjpeg
3222         https://bugs.webkit.org/show_bug.cgi?id=176113
3223
3224         Reviewed by Alex Christensen.
3225
3226         No new tests. No change in behavior.
3227
3228         * PlatformWinCairo.cmake:
3229         * platform/ImageDecoders.cmake:
3230
3231 2017-08-22  Matt Rajca  <mrajca@apple.com>
3232
3233         Opt all Mac clients into document-level media user gesture quirks.
3234         https://bugs.webkit.org/show_bug.cgi?id=175831
3235
3236         This un-breaks many of the sites that take a long time to load video ad elements on-demand.
3237
3238         Reviewed by Eric Carlson.
3239
3240         Test: media/document-level-media-user-gesture-quirk.html
3241
3242         * html/MediaElementSession.cpp:
3243         (WebCore::MediaElementSession::playbackPermitted const):
3244         (WebCore::needsDocumentLevelMediaUserGestureQuirk): Deleted.
3245
3246 2017-08-22  Filip Pizlo  <fpizlo@apple.com>
3247
3248         Strings need to be in some kind of gigacage
3249         https://bugs.webkit.org/show_bug.cgi?id=174924
3250
3251         Reviewed by Oliver Hunt.
3252
3253         No new tests because no new behavior.
3254
3255         * html/canvas/CanvasRenderingContext2D.cpp:
3256         (WebCore::normalizeSpaces):
3257
3258 2017-08-30  Andy Estes  <aestes@apple.com>
3259
3260         [Mac] Upstream Accessibility-related WebKitSystemInterface functions
3261         https://bugs.webkit.org/show_bug.cgi?id=176093
3262
3263         Reviewed by Eric Carlson.
3264
3265         * accessibility/mac/AXObjectCacheMac.mm:
3266         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
3267         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3268         (-[WebAccessibilityObjectWrapper unregisterUniqueIdForUIElement]):
3269         (AXObjectIsTextMarker):
3270         (AXObjectIsTextMarkerRange):
3271         (AXTextMarkerRange):
3272         (AXTextMarkerRangeStart):
3273         (AXTextMarkerRangeEnd):
3274         (getBytesFromAXTextMarker):
3275         (isTextMarkerIgnored):
3276         (accessibilityObjectForTextMarker):
3277         (startOrEndTextmarkerForRange):
3278         (nextTextMarkerForCharacterOffset):
3279         (previousTextMarkerForCharacterOffset):
3280         (textMarkerForCharacterOffset):
3281         (characterOffsetForTextMarker):
3282         (textMarkerForVisiblePosition):
3283         (-[WebAccessibilityObjectWrapper textMarkerForFirstPositionInTextControl:]):
3284         (visiblePositionForTextMarker):
3285         (AXAttributeStringSetElement):
3286         * platform/mac/WebCoreSystemInterface.h:
3287         * platform/mac/WebCoreSystemInterface.mm:
3288
3289 2017-08-30  Antti Koivisto  <antti@apple.com>
3290
3291         RenderMultiColumnFlowThread - Avoid render tree mutation during layout
3292         https://bugs.webkit.org/show_bug.cgi?id=176026
3293         <rdar://problem/33402891>
3294
3295         Reviewed by Zalan Bujtas.
3296
3297         Mutations should be done in RenderTreeUpdater.
3298
3299         * rendering/RenderBlockFlow.cpp:
3300         (WebCore::RenderBlockFlow::willCreateColumns const):
3301
3302             Don't create columns for RenderSVGBlock. Before this patch this was avoided because it
3303             has custom layout() function that doesn't call to setComputedColumnCountAndWidth.
3304             Same for mathml and ruby.
3305
3306             Don't create columns for pseudo elements (first-letter mostly).
3307
3308         (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
3309
3310             This now assumes that the multicolumn renderer has been initialized correctly already.
3311
3312         * rendering/RenderBlockFlow.h:
3313         * style/RenderTreeUpdater.cpp:
3314         (WebCore::updateMultiColumnFlowThread):
3315
3316             Create or delte multicolumn renderer after descendants are known.
3317
3318         (WebCore::RenderTreeUpdater::commit):
3319         (WebCore::RenderTreeUpdater::updateAfterDescendants):
3320
3321 2017-08-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
3322
3323         The SVG fragment identifier is not respected if it is a part of an HTTP URL
3324         https://bugs.webkit.org/show_bug.cgi?id=163811
3325
3326         Reviewed by Darin Adler.
3327
3328         If an image is referenced more than once in a page and the URL to that
3329         image is an HTTP URL, one CachedImage is created for all the renderers
3330         even if the original URLs have different fragmentIdentifiers. In this
3331         case the fragment will be removed from the request which is associated
3332         with the shared CachedImage. This CachedImage creates an SVGImage with
3333         a URL but without a fragmentIdentifier. So SVGImage::draw() does not call
3334         FrameView::scrollToFragment() and therefore the viewport is not setup
3335         correctly for displaying the SVG in this case.
3336
3337         The fix is to move the url from the SVGImage to SVGImageForContainer.
3338         Because there is one SVGImageForContainer created for every renderer,
3339         we can move the full URL there. The drawing of an SVGImage has to start
3340         from the SVGImageForContainer::draw() because the SVGImage may not have
3341         an intrinsic size and the SVGImageForContainer is the one which knows
3342         the destination rectangle. So SVGImageForContainer can pass the full url
3343         to SVGImage::drawForContainer() which can be used to scrollToFragment()
3344         before calling SVGImage::draw().
3345         
3346         For clarity and consistency, all setContainerSizeForRenderer() will be 
3347         changed to setContainerContext() and the pair SizeAndZoom will be replaced
3348         by the struct ContainerContext.
3349
3350         Tests: http/tests/svg/svg-fragment-background.html
3351                http/tests/svg/svg-fragment-image.html
3352
3353         * css/CSSCursorImageValue.h:
3354         * css/CSSImageSetValue.cpp:
3355         (WebCore::CSSImageSetValue::fillImageSet):
3356         * css/CSSImageSetValue.h:
3357         * loader/cache/CachedImage.cpp:
3358         (WebCore::CachedImage::didRemoveClient):
3359         (WebCore::CachedImage::switchClientsToRevalidatedResource):
3360         (WebCore::CachedImage::allClientsRemoved):
3361         (WebCore::CachedImage::setContainerContextForClient):
3362         (WebCore::CachedImage::clear):
3363         (WebCore::CachedImage::createImage):
3364         (WebCore::CachedImage::setContainerSizeForRenderer): Deleted.
3365         * loader/cache/CachedImage.h:
3366         * rendering/RenderBoxModelObject.cpp:
3367         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
3368         (WebCore::RenderBoxModelObject::paintNinePieceImage):
3369         * rendering/RenderImage.cpp:
3370         (WebCore::RenderImage::updateInnerContentRect):
3371         (WebCore::RenderImage::repaintOrMarkForLayout):
3372         * rendering/RenderImageResource.cpp:
3373         (WebCore::RenderImageResource::setContainerContext):
3374         (WebCore::RenderImageResource::setContainerSizeForRenderer): Deleted.
3375         * rendering/RenderImageResource.h:
3376         * rendering/RenderImageResourceStyleImage.cpp:
3377         (WebCore::RenderImageResourceStyleImage::setContainerContext):
3378         (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): Deleted.
3379         * rendering/RenderImageResourceStyleImage.h:
3380         * rendering/RenderListMarker.cpp:
3381         (WebCore::RenderListMarker::updateContent):
3382         * rendering/shapes/ShapeOutsideInfo.cpp:
3383         (WebCore::ShapeOutsideInfo::createShapeForImage const):
3384         * rendering/style/StyleCachedImage.cpp:
3385         (WebCore::StyleCachedImage::imageURL):
3386         (WebCore::StyleCachedImage::setContainerContextForRenderer):
3387         (WebCore::StyleCachedImage::setContainerSizeForRenderer): Deleted.
3388         * rendering/style/StyleCachedImage.h:
3389         * rendering/style/StyleGeneratedImage.h:
3390         * rendering/style/StyleImage.h:
3391         * rendering/svg/RenderSVGImage.cpp:
3392         (WebCore::RenderSVGImage::updateImageViewport):
3393         * svg/SVGImageElement.h:
3394         * svg/graphics/SVGImage.cpp:
3395         (WebCore::SVGImage::SVGImage):
3396         (WebCore::SVGImage::drawForContainer):
3397         (WebCore::SVGImage::drawPatternForContainer):
3398         (WebCore::SVGImage::draw):
3399         (WebCore::SVGImage::dump const): Deleted.
3400         * svg/graphics/SVGImage.h:
3401         * svg/graphics/SVGImageCache.cpp:
3402         (WebCore::SVGImageCache::setContainerContextForClient):
3403         (WebCore::SVGImageCache::setContainerSizeForRenderer): Deleted.
3404         * svg/graphics/SVGImageCache.h:
3405         * svg/graphics/SVGImageForContainer.cpp:
3406         (WebCore::SVGImageForContainer::size const):
3407         (WebCore::SVGImageForContainer::draw):
3408         (WebCore::SVGImageForContainer::drawPattern):
3409         * svg/graphics/SVGImageForContainer.h:
3410
3411 2017-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3412
3413         REGRESSION(r210287) On drop, event.dataTransfer.getData("text") returns an empty string when dragging an image
3414         https://bugs.webkit.org/show_bug.cgi?id=170637
3415         <rdar://problem/31347248>
3416
3417         Reviewed by Ryosuke Niwa.
3418
3419         In r210287, the behavior of DragData::containsFiles was changed to return true if NSFilesPromisePboardType is
3420         present in the pasteboard. This means that we will consider images dragged from web content, for which we add
3421         the NSFilesPromisePboardType UTI, as containing files on the pasteboard; this, in turn, means we'll initialize
3422         the DataTransfer upon drop with m_forFileDrag set to true. Due to early returns in getData() and setData() to
3423         deny data access when dropping a dragged file, this means the page won't ever get access to the URL in the
3424         pasteboard due to the presence of the NSFilesPromisePboardType UTI.
3425