ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingR...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-11-27  Chris Dumez  <cdumez@apple.com>
2
3         ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingRegistration(WebCore::ServiceWorkerClientIdentifier const&) + 141
4         https://bugs.webkit.org/show_bug.cgi?id=180049
5
6         Reviewed by Brady Eidson.
7
8         SWServer::serviceWorkerStoppedControllingClient() was failing to remove the client from the
9         SWServerRegistration in some cases. This is because we relied on the Service Worker Identifier
10         to get the SWServerRegistration, via the corresponding SWServerServiceWorker object. However,
11         It is possible for the SWServerServiceWorker to have been destroyed already.
12
13         In serviceWorkerStartedControllingClient / serviceWorkerStoppedControllingClient, we now
14         pass the registration identifier, so that we are able to look up the registration directly,
15         without going through the service worker object.
16
17         No new tests, already covered by imported/w3c/web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https.html.
18
19         * dom/ScriptExecutionContext.cpp:
20         (WebCore::ScriptExecutionContext::setActiveServiceWorker):
21         * workers/service/ServiceWorker.h:
22         * workers/service/ServiceWorkerContainer.cpp:
23         (WebCore::ServiceWorkerContainer::addRegistration):
24         (WebCore::ServiceWorkerContainer::removeRegistration):
25         * workers/service/ServiceWorkerData.cpp:
26         (WebCore::ServiceWorkerData::isolatedCopy const):
27         * workers/service/ServiceWorkerData.h:
28         (WebCore::ServiceWorkerData::encode const):
29         (WebCore::ServiceWorkerData::decode):
30         * workers/service/server/SWClientConnection.h:
31         * workers/service/server/SWServer.cpp:
32         (WebCore::SWServer::addRegistration):
33         (WebCore::SWServer::removeRegistration):
34         (WebCore::SWServer::clearAll):
35         (WebCore::SWServer::Connection::addServiceWorkerRegistrationInServer):
36         (WebCore::SWServer::Connection::removeServiceWorkerRegistrationInServer):
37         (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient):
38         (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient):
39         (WebCore::SWServer::addClientServiceWorkerRegistration):
40         (WebCore::SWServer::removeClientServiceWorkerRegistration):
41         (WebCore::SWServer::serviceWorkerStartedControllingClient):
42         (WebCore::SWServer::serviceWorkerStoppedControllingClient):
43         (WebCore::SWServer::installContextData):
44         * workers/service/server/SWServer.h:
45         * workers/service/server/SWServerWorker.cpp:
46         (WebCore::SWServerWorker::SWServerWorker):
47         * workers/service/server/SWServerWorker.h:
48
49 2017-11-27  Tim Horton  <timothy_horton@apple.com>
50
51         REGRESSION (r225142): Crashes when command clicking or force touching links
52         https://bugs.webkit.org/show_bug.cgi?id=180055
53         <rdar://problem/35703910>
54
55         Reviewed by Wenson Hsieh.
56
57         No new tests; affects an existing API test.
58
59         * editing/mac/DictionaryLookup.mm:
60         (WebCore::tokenRange):
61         The 'options' out argument from tokenRangeForString is autoreleased.
62
63 2017-11-27  Dean Jackson  <dino@apple.com>
64
65         Implement OffscreenCanvas.getContext("webgl")
66         https://bugs.webkit.org/show_bug.cgi?id=180050
67         <rdar://problem/35705473>
68
69         Reviewed by Sam Weinig.
70
71         Implement enough of getContext("webgl") to actually return an
72         active WebGLRenderingContext, even though it isn't actually
73         hooked up to draw.
74
75         Introduce a new type, WebGLCanvas, which is a variant of HTMLCanvasElement
76         and OffscreenCanvas, so that it can be exposed by the 'canvas' attribute
77         on WebGLRenderingContext.
78
79         At the moment we still assume that all uses of WebGLRenderingContext come
80         from HTMLCanvasElement, so add a bunch of logic to detect that case.
81
82         Updated the existing (proposed) WPT.
83
84         * html/OffscreenCanvas.cpp:
85         (WebCore::OffscreenCanvas::getContext): Implement enough of getContext to
86         return a WebGLRenderingContext.
87         * html/OffscreenCanvas.h: Use the new OffscreenRenderingContext type, even
88         though it's just a WebGLRenderingContext at the moment.
89
90         * html/canvas/WebGLRenderingContextBase.cpp:
91         (WebCore::WebGLRenderingContextBase::canvas): Now returns a WebGLCanvas.
92         (WebCore::WebGLRenderingContextBase::htmlCanvas): Helper to get the HTMLCanvasElement if it exists.
93         (WebCore::WebGLRenderingContextBase::offscreenCanvas): Ditto for OffscreenCanvas.
94         (WebCore::WebGLRenderingContextBase::checkForContextLossHandling): Guard for htmlCanvas().
95         (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
96         (WebCore::WebGLRenderingContextBase::setupFlags):
97         (WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
98         (WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
99         (WebCore::WebGLRenderingContextBase::markContextChanged):
100         (WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver):
101         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
102         (WebCore::WebGLRenderingContextBase::reshape):
103         (WebCore::WebGLRenderingContextBase::compileShader):
104         (WebCore::WebGLRenderingContextBase::isContextLostOrPending):
105         (WebCore::WebGLRenderingContextBase::readPixels):
106         (WebCore::WebGLRenderingContextBase::loseContextImpl):
107         (WebCore::WebGLRenderingContextBase::printToConsole):
108         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
109         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
110         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
111         (WebCore::WebGLRenderingContextBase::clampedCanvasSize):
112         * html/canvas/WebGLRenderingContextBase.h: Define WebGLCanvas.
113         * html/canvas/WebGLRenderingContextBase.idl:
114
115         * inspector/InspectorInstrumentation.h: Handle the variant options, although leave OffscreenCanvas
116         unimplemented for the moment.
117         (WebCore::InspectorInstrumentation::didEnableExtension):
118         (WebCore::InspectorInstrumentation::didCreateProgram):
119         (WebCore::InspectorInstrumentation::willDeleteProgram):
120         (WebCore::InspectorInstrumentation::isShaderProgramDisabled):
121         * inspector/agents/InspectorCanvasAgent.cpp:
122         (WebCore::InspectorCanvasAgent::didEnableExtension):
123         (WebCore::InspectorCanvasAgent::didCreateProgram):
124
125 2017-11-27  Michael Catanzaro  <mcatanzaro@igalia.com>
126
127         Unreviewed, fix an improper #include
128
129         * platform/network/soup/NetworkStorageSessionSoup.cpp:
130
131 2017-11-27  Alex Christensen  <achristensen@webkit.org>
132
133         imported/w3c/web-platform-tests/url/failure.html crashes on debug builds
134         https://bugs.webkit.org/show_bug.cgi?id=172337
135
136         Reviewed by Chris Dumez.
137
138         There were two problems:
139         1. Invalid URLs can contain non-ASCII characters in its UTF8 representation.
140         We should not put these URLs into content extension finite state machines.  They won't load anyways.
141         2. If we don't have any content extensions installed, we still call String.utf8 unnecessarily.  Let's not.
142
143         * contentextensions/ContentExtensionsBackend.cpp:
144         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
145
146 2017-11-27  Simon Fraser  <simon.fraser@apple.com>
147
148         Use TextStream's indent tracking, rather than passing indent to all the externalRepresentation() functions
149         https://bugs.webkit.org/show_bug.cgi?id=180027
150
151         Reviewed by Jon Lee.
152
153         Remove all the indent arguments, and make use of TextStream::IndentScope to control
154         output indentation.
155         
156         Add an indent stream manipulator so you can say
157           ts << indent << "text"
158         to write the indent.
159
160         * platform/graphics/filters/FEBlend.cpp:
161         (WebCore::FEBlend::externalRepresentation const):
162         * platform/graphics/filters/FEBlend.h:
163         * platform/graphics/filters/FEColorMatrix.cpp:
164         (WebCore::FEColorMatrix::externalRepresentation const):
165         * platform/graphics/filters/FEColorMatrix.h:
166         * platform/graphics/filters/FEComponentTransfer.cpp:
167         (WebCore::FEComponentTransfer::externalRepresentation const):
168         * platform/graphics/filters/FEComponentTransfer.h:
169         * platform/graphics/filters/FEComposite.cpp:
170         (WebCore::FEComposite::externalRepresentation const):
171         * platform/graphics/filters/FEComposite.h:
172         * platform/graphics/filters/FEConvolveMatrix.cpp:
173         (WebCore::FEConvolveMatrix::externalRepresentation const):
174         * platform/graphics/filters/FEConvolveMatrix.h:
175         * platform/graphics/filters/FEDiffuseLighting.cpp:
176         (WebCore::FEDiffuseLighting::externalRepresentation const):
177         * platform/graphics/filters/FEDiffuseLighting.h:
178         * platform/graphics/filters/FEDisplacementMap.cpp:
179         (WebCore::FEDisplacementMap::externalRepresentation const):
180         * platform/graphics/filters/FEDisplacementMap.h:
181         * platform/graphics/filters/FEDropShadow.cpp:
182         (WebCore::FEDropShadow::externalRepresentation const):
183         * platform/graphics/filters/FEDropShadow.h:
184         * platform/graphics/filters/FEFlood.cpp:
185         (WebCore::FEFlood::externalRepresentation const):
186         * platform/graphics/filters/FEFlood.h:
187         * platform/graphics/filters/FEGaussianBlur.cpp:
188         (WebCore::FEGaussianBlur::externalRepresentation const):
189         * platform/graphics/filters/FEGaussianBlur.h:
190         * platform/graphics/filters/FEMerge.cpp:
191         (WebCore::FEMerge::externalRepresentation const):
192         * platform/graphics/filters/FEMerge.h:
193         * platform/graphics/filters/FEMorphology.cpp:
194         (WebCore::FEMorphology::externalRepresentation const):
195         * platform/graphics/filters/FEMorphology.h:
196         * platform/graphics/filters/FEOffset.cpp:
197         (WebCore::FEOffset::externalRepresentation const):
198         * platform/graphics/filters/FEOffset.h:
199         * platform/graphics/filters/FESpecularLighting.cpp:
200         (WebCore::FESpecularLighting::externalRepresentation const):
201         * platform/graphics/filters/FESpecularLighting.h:
202         * platform/graphics/filters/FETile.cpp:
203         (WebCore::FETile::externalRepresentation const):
204         * platform/graphics/filters/FETile.h:
205         * platform/graphics/filters/FETurbulence.cpp:
206         (WebCore::FETurbulence::externalRepresentation const):
207         * platform/graphics/filters/FETurbulence.h:
208         * platform/graphics/filters/FilterEffect.cpp:
209         (WebCore::FilterEffect::externalRepresentation const):
210         * platform/graphics/filters/FilterEffect.h:
211         * platform/graphics/filters/SourceAlpha.cpp:
212         (WebCore::SourceAlpha::externalRepresentation const):
213         * platform/graphics/filters/SourceAlpha.h:
214         * platform/graphics/filters/SourceGraphic.cpp:
215         (WebCore::SourceGraphic::externalRepresentation const):
216         * platform/graphics/filters/SourceGraphic.h:
217         * rendering/RenderTreeAsText.cpp:
218         (WebCore::write):
219         (WebCore::writeLayer):
220         (WebCore::writeLayerRenderers):
221         (WebCore::writeLayers):
222         (WebCore::externalRepresentation):
223         * rendering/RenderTreeAsText.h:
224         * rendering/svg/SVGRenderTreeAsText.cpp:
225         (WebCore::writeSVGInlineTextBox):
226         (WebCore::writeSVGInlineTextBoxes):
227         (WebCore::writeStandardPrefix):
228         (WebCore::writeChildren):
229         (WebCore::writeSVGResourceContainer):
230         (WebCore::writeSVGContainer):
231         (WebCore::write):
232         (WebCore::writeSVGText):
233         (WebCore::writeSVGInlineText):
234         (WebCore::writeSVGImage):
235         (WebCore::writeSVGGradientStop):
236         (WebCore::writeResources):
237         * rendering/svg/SVGRenderTreeAsText.h:
238         * svg/graphics/filters/SVGFEImage.cpp:
239         (WebCore::FEImage::externalRepresentation const):
240         * svg/graphics/filters/SVGFEImage.h:
241
242 2017-11-27  Chris Dumez  <cdumez@apple.com>
243
244         Give Document a strongly typed identifier instead of a uint64_t
245         https://bugs.webkit.org/show_bug.cgi?id=180041
246
247         Reviewed by Youenn Fablet.
248
249         Give Document a strongly typed identifier instead of a uint64_t, for clarity.
250
251         * WebCore.xcodeproj/project.pbxproj:
252         * dom/Document.cpp:
253         (WebCore::m_identifier):
254         * dom/Document.h:
255         (WebCore::Document::identifier const):
256         * dom/DocumentIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h.
257         * workers/service/ServiceWorkerClientIdentifier.h:
258         (WebCore::ServiceWorkerClientIdentifier::toString const):
259         (WebCore::ServiceWorkerClientIdentifier::encode const):
260         (WebCore::ServiceWorkerClientIdentifier::decode):
261         * workers/service/server/SWClientConnection.cpp:
262         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
263         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
264         * workers/service/server/SWClientConnection.h:
265         * workers/service/server/SWServer.cpp:
266         (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient):
267         (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient):
268         (WebCore::SWServer::serviceWorkerStartedControllingClient):
269         (WebCore::SWServer::serviceWorkerStoppedControllingClient):
270         * workers/service/server/SWServer.h:
271         * workers/service/server/SWServerRegistration.cpp:
272         (WebCore::SWServerRegistration::addClientUsingRegistration):
273         (WebCore::SWServerRegistration::removeClientUsingRegistration):
274         * workers/service/server/SWServerRegistration.h:
275
276 2017-11-27  Simon Fraser  <simon.fraser@apple.com>
277
278         Optimize FEDisplacementMap
279         https://bugs.webkit.org/show_bug.cgi?id=180023
280
281         Reviewed by Sam Weinig.
282
283         Make FEDisplacementMap about 3x faster by operating on whole pixels rather than
284         individual channels. There's no per-channel logic once the srcX and srcY are computed.
285         
286         Other sundry cleanup.
287
288         * platform/graphics/ColorUtilities.h:
289         (WebCore::byteOffsetOfPixel): Will use this in more places in future.
290         * platform/graphics/filters/FEDisplacementMap.cpp:
291         (WebCore::FEDisplacementMap::platformApplySoftware):
292         * platform/graphics/filters/FEDisplacementMap.h:
293         (WebCore::FEDisplacementMap::xChannelIndex const):
294         (WebCore::FEDisplacementMap::yChannelIndex const):
295
296 2017-11-27  Tim Horton  <timothy_horton@apple.com>
297
298         One too many zeroes in macOS version number in FeatureDefines
299         https://bugs.webkit.org/show_bug.cgi?id=180011
300
301         Reviewed by Dan Bernstein.
302
303         * Configurations/FeatureDefines.xcconfig:
304
305 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
306
307         [CoordGraphics] CoordinatedGraphicsLayer doesn't need to inherit from TextureMapperPlatformLayer::Client
308         https://bugs.webkit.org/show_bug.cgi?id=180036
309
310         Reviewed by Carlos Garcia Campos.
311
312         There's no reason CoordinatedGraphicsLayer should inherit from
313         TextureMapperPlatformLayer::Client. CoordinatedGraphicsLayer objects are
314         not used anywhere through that type, and all the overridden methods are
315         empty anyway. The TextureMapperPlatformLayer::Client class (along with
316         TextureMapperPlatformLayer) is nowadays only used in the direct
317         TextureMapper implementation of GraphicsLayer.
318
319         No new tests -- no change in behavior.
320
321         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
322         (WebCore::CoordinatedGraphicsLayer::platformLayerWillBeDestroyed): Deleted.
323         (WebCore::CoordinatedGraphicsLayer::setPlatformLayerNeedsDisplay): Deleted.
324         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
325
326 2017-11-27  Antoine Quint  <graouts@apple.com>
327
328         Pressing the space bar while watching a fullscreen video doesn't play or pause
329         https://bugs.webkit.org/show_bug.cgi?id=180033
330         <rdar://problem/33610443>
331
332         Reviewed by Eric Carlson.
333
334         We register a "keydown" event to track when the space bar is pressed, and if the media is playing
335         in fullscreen, we toggle playback. This does not interfere with full keyboard access since activating
336         one of the media controls using the keyboard will not let the events we register for be dispatched
337         this far along the event dispatch phase.
338
339         Test: media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html
340
341         * Modules/modern-media-controls/media/media-controller.js:
342         (MediaController):
343         (MediaController.prototype.togglePlayback): Add a catch() statement since calling play() could sometime
344         lead to some extraneous unhandled promise console logging that pollutes test output.
345         (MediaController.prototype.handleEvent):
346
347 2017-11-27  Simon Fraser  <simon.fraser@apple.com>
348
349         Optimize FEMorphology
350         https://bugs.webkit.org/show_bug.cgi?id=180020
351
352         Reviewed by Sam Weinig.
353
354         Use const PaintingData&.
355         Compute all components at once.
356         Avoid Vector<> capacity changes during the pixel loop.
357         Tweak the parallel jobs scaling.
358         Templatize the the inner loop functions that compute min or max based
359         on the filter type to avoid conditionals in tight loops.
360         
361         This is about a 4x speedup before the parallel jobs tweaking. With fixed parallelism,
362         a 200x200 filter went from 15ms to about 1ms with these changes.
363
364         * platform/graphics/ColorUtilities.h:
365         (WebCore::ColorComponents::fromRGBA):
366         (WebCore::ColorComponents::toRGBA const):
367         (WebCore::perComponentMax):
368         (WebCore::perComponentMin):
369         * platform/graphics/filters/FEColorMatrix.cpp:
370         (WebCore::FEColorMatrix::platformApplySoftware): Remove some old perf logging code.
371         TimingScope now does something similar.
372         * platform/graphics/filters/FEMorphology.cpp:
373         (WebCore::pixelArrayIndex):
374         (WebCore::minOrMax):
375         (WebCore::columnExtremum):
376         (WebCore::kernelExtremum):
377         (WebCore::FEMorphology::platformApplyGeneric):
378         (WebCore::FEMorphology::platformApplyWorker):
379         (WebCore::FEMorphology::platformApply):
380         (WebCore::FEMorphology::platformApplySoftware):
381         (WebCore::shouldSupersedeExtremum): Deleted.
382         * platform/graphics/filters/FEMorphology.h:
383
384 2017-11-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
385
386         [EME][GStreamer] Change the ClearKey's SystemID value
387         https://bugs.webkit.org/show_bug.cgi?id=180007
388
389         Reviewed by Xabier Rodriguez-Calvar.
390
391         Use 1077efec-c0b2-4d02-ace3-3c1e52e2fb4b instead of
392         58147ec8-0423-4659-92e6-f52c5ce8c3cc, as is specified in W3C.
393         https://www.w3.org/TR/eme-initdata-cenc/#common-system-definition
394
395         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
396
397 2017-11-27  Javier Fernandez  <jfernandez@igalia.com>
398
399         [css-grid] Display issues with child with max-width
400         https://bugs.webkit.org/show_bug.cgi?id=178973
401
402         Reviewed by Darin Adler.
403
404         We have an utility function to compute the grid item's margins
405         when the item still needs to layout. We used the function
406         RenderStyle::hasMarings to decide whether such margin computation
407         worths. However, we need that function to operate on a specific
408         axis, hence I added a new function adding such logic.
409
410         Additionally, we must treat any 'auto' margin as 0px during the
411         tracks sizing algorithm, as the CSS Grid spec states:
412
413           - https://drafts.csswg.org/css-grid/#auto-margins
414
415         Test: fast/css-grid-layout/auto-margins-ignored-during-track-sizing.html
416
417         * rendering/GridLayoutFunctions.cpp:
418         (WebCore::GridLayoutFunctions::childHasMargin): New funciton with axis dependent logic.
419         (WebCore::GridLayoutFunctions::computeMarginLogicalSizeForChild): Ignore auto margins.
420         (WebCore::GridLayoutFunctions::marginLogicalSizeForChild): Ignore auto margins.
421
422 2017-11-26  Simon Fraser  <simon.fraser@apple.com>
423
424         feImage as filter input has skewed colors
425         https://bugs.webkit.org/show_bug.cgi?id=180021
426
427         Reviewed by Sam Weinig.
428         
429         Using an <feImage> as a filter input sometimes results in incorrect colors, because
430         the image is being sourced as linearRGB when it should always be sRGB.
431         
432         Fix by setting the result colorspace in FEImage before we allocate the output
433         buffer.
434
435         Tests: svg/filters/feImage-color-fidelity-expected.svg
436                svg/filters/feImage-color-fidelity.svg
437
438         * svg/graphics/filters/SVGFEImage.cpp:
439         (WebCore::FEImage::platformApplySoftware):
440
441 2017-11-26  Minsheng Liu  <lambda@liu.ms>
442
443         Cleanup code for RenderMathMLUnderOver::layoutBlock
444         https://bugs.webkit.org/show_bug.cgi?id=179681
445
446         Reviewed by Frédéric Wang.
447
448         The patch removes some unnecessary calls to layoutIfNeeds() and guards the change
449         with assertion. Since there is no behavior change, no new tests are required.
450
451         * rendering/mathml/RenderMathMLUnderOver.cpp:
452         (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
453         (WebCore::RenderMathMLUnderOver::layoutBlock):
454         (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Deleted.
455         * rendering/mathml/RenderMathMLUnderOver.h:
456
457 2017-11-26  Simon Fraser  <simon.fraser@apple.com>
458
459         Use more Uint8ClampedArray& and constness in filter and image buffer code
460         https://bugs.webkit.org/show_bug.cgi?id=180008
461
462         Reviewed by Darin Adler.
463
464         Use references to Uint8ClampedArrays rather than pointers where necessary.
465         
466         Use const for source data buffers when possible, and uint8_t for the underlying
467         data type.
468         
469         Fix a bug in FEGaussianBlur where the output of the last blur pass wasn't
470         copied to the result buffer, which required a test adjustment.
471
472         * html/canvas/CanvasRenderingContext2D.cpp:
473         (WebCore::CanvasRenderingContext2D::putImageData):
474         * platform/graphics/ImageBuffer.cpp:
475         (WebCore::ImageBuffer::genericConvertToLuminanceMask):
476         * platform/graphics/ImageBuffer.h:
477         * platform/graphics/ShadowBlur.cpp:
478         (WebCore::ShadowBlur::blurShadowBuffer):
479         * platform/graphics/cairo/ImageBufferCairo.cpp:
480         (WebCore::ImageBuffer::putByteArray):
481         * platform/graphics/cg/ImageBufferCG.cpp:
482         (WebCore::ImageBuffer::putByteArray):
483         * platform/graphics/cg/ImageBufferDataCG.cpp:
484         (WebCore::ImageBufferData::getData const):
485         (WebCore::ImageBufferData::putData):
486         * platform/graphics/cg/ImageBufferDataCG.h:
487         * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
488         (WebCore::FEBlend::platformApplySoftware):
489         * platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h:
490         (WebCore::FEComposite::computeArithmeticPixelsNeon):
491         (WebCore::FEComposite::platformArithmeticNeon):
492         * platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h:
493         (WebCore::boxBlurNEON):
494         * platform/graphics/cpu/arm/filters/NEONHelpers.h:
495         (WebCore::loadRGBA8AsFloat):
496         * platform/graphics/filters/FEColorMatrix.cpp:
497         (WebCore::effectApplyAccelerated):
498         (WebCore::effectType):
499         (WebCore::FEColorMatrix::platformApplySoftware):
500         * platform/graphics/filters/FEComponentTransfer.cpp:
501         (WebCore::FEComponentTransfer::platformApplySoftware):
502         * platform/graphics/filters/FEComposite.cpp:
503         (WebCore::computeArithmeticPixels):
504         (WebCore::FEComposite::platformArithmeticSoftware):
505         (WebCore::FEComposite::platformApplySoftware):
506         * platform/graphics/filters/FEComposite.h:
507         * platform/graphics/filters/FEConvolveMatrix.cpp:
508         (WebCore::setDestinationPixels):
509         (WebCore::FEConvolveMatrix::fastSetInteriorPixels):
510         (WebCore::FEConvolveMatrix::fastSetOuterPixels):
511         (WebCore::FEConvolveMatrix::platformApplySoftware):
512         * platform/graphics/filters/FEConvolveMatrix.h:
513         * platform/graphics/filters/FEDisplacementMap.cpp:
514         (WebCore::FEDisplacementMap::platformApplySoftware):
515         * platform/graphics/filters/FEDropShadow.cpp:
516         (WebCore::FEDropShadow::platformApplySoftware):
517         * platform/graphics/filters/FEGaussianBlur.cpp:
518         (WebCore::boxBlurAlphaOnly):
519         (WebCore::boxBlur):
520         (WebCore::accelerateBoxBlur):
521         (WebCore::standardBoxBlur):
522         (WebCore::FEGaussianBlur::platformApplyGeneric):
523         (WebCore::FEGaussianBlur::platformApplyWorker):
524         (WebCore::FEGaussianBlur::platformApply):
525         (WebCore::FEGaussianBlur::platformApplySoftware):
526         * platform/graphics/filters/FEGaussianBlur.h:
527         * platform/graphics/filters/FELighting.cpp:
528         (WebCore::FELighting::drawLighting):
529         (WebCore::FELighting::platformApplySoftware):
530         * platform/graphics/filters/FELighting.h:
531         * platform/graphics/filters/FEMorphology.cpp:
532         (WebCore::columnExtremum):
533         (WebCore::FEMorphology::platformApplyGeneric):
534         (WebCore::FEMorphology::platformApplyDegenerate):
535         (WebCore::FEMorphology::platformApplySoftware):
536         * platform/graphics/filters/FEMorphology.h:
537         * platform/graphics/filters/FETurbulence.cpp:
538         (WebCore::FETurbulence::fillRegion const):
539         (WebCore::FETurbulence::fillRegionWorker):
540         (WebCore::FETurbulence::platformApplySoftware):
541         * platform/graphics/filters/FETurbulence.h:
542         * platform/graphics/filters/FilterEffect.cpp:
543         (WebCore::FilterEffect::forceValidPreMultipliedPixels):
544         (WebCore::FilterEffect::imageBufferResult):
545         (WebCore::FilterEffect::unmultipliedResult):
546         (WebCore::FilterEffect::premultipliedResult):
547         (WebCore::FilterEffect::copyImageBytes const):
548         (WebCore::copyPremultiplyingAlpha):
549         (WebCore::copyUnpremultiplyingAlpha):
550         (WebCore::FilterEffect::copyUnmultipliedResult):
551         (WebCore::FilterEffect::copyPremultipliedResult):
552         * platform/graphics/filters/FilterEffect.h:
553         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
554         (WebCore::ImageBufferData::putData):
555         * platform/graphics/win/ImageBufferDataDirect2D.h:
556
557 2017-11-25  Zalan Bujtas  <zalan@apple.com>
558
559         Make RenderSnapshottedPlugIn ISO allocated
560         https://bugs.webkit.org/show_bug.cgi?id=180010
561         <rdar://problem/35671977>
562
563         Reviewed by David Kilzer.
564
565         RenderEmbeddedObject, the base class is ISO allocated since r224537. 
566
567         * rendering/RenderSnapshottedPlugIn.cpp:
568         * rendering/RenderSnapshottedPlugIn.h:
569
570 2016-08-05  Darin Adler  <darin@apple.com>
571
572         Fix some minor problems in the StringImpl header
573         https://bugs.webkit.org/show_bug.cgi?id=160630
574
575         Reviewed by Brent Fulgham.
576
577         * html/HTMLOptionElement.cpp:
578         (WebCore::HTMLOptionElement::text): Use stripLeadingAndTrailingHTMLSpaces
579         instead of stripWhiteSpace(isHTMLSpace).
580         (WebCore::HTMLOptionElement::value): Ditto.
581         (WebCore::HTMLOptionElement::label): Ditto.
582         (WebCore::HTMLOptionElement::displayLabel): Ditto.
583         * loader/FrameLoader.cpp:
584         (WebCore::FrameLoader::didBeginDocument): Use stripLeadingAndTrailingHTMLSpaces
585         instead of calling the general purpose one and passing isHTMLSpace.
586         * platform/network/HTTPParsers.h:
587         (WebCore::stripLeadingAndTrailingHTTPSpaces): Updated to use the
588         new name, stripLeadingAndTrailingCharacters.
589
590 2017-11-23  Darin Adler  <darin@apple.com>
591
592         Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby
593         https://bugs.webkit.org/show_bug.cgi?id=179981
594
595         Reviewed by Sam Weinig.
596
597         * accessibility/AXObjectCache.cpp:
598         (WebCore::AXObjectCache::rangeMatchesTextNearRange): Pass { } instead of 0.
599         * accessibility/AccessibilityObject.cpp:
600         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Use { }
601         instead of | to construct value.
602         * editing/Editor.cpp:
603         (WebCore::Editor::findString): Use contains instead of & to test an option.
604         (WebCore::Editor::rangeOfString): Ditto.
605         (WebCore::Editor::countMatchesForText): Ditto.
606         * editing/EditorCommand.cpp:
607         (WebCore::executeFindString): Use { } instead of | to construct value.
608         * editing/FindOptions.h: Use OptionSet for type.
609         * editing/TextIterator.cpp:
610         (WebCore::SearchBuffer::SearchBuffer): Use contains instead of &. Also use -= instead
611         of &= coupled with ~ to remove a flag.
612         (WebCore::SearchBuffer::isWordEndMatch const): Ditto.
613         (WebCore::SearchBuffer::isWordStartMatch const): Ditto.
614         (WebCore::SearchBuffer::search): Ditto.
615         (WebCore::findIteratorOptions): Ditto.
616         (WebCore::findClosestPlainText): Ditto.
617         (WebCore::findPlainText): Ditto.
618
619         * editing/mac/DictionaryLookup.h: Changed optional dictionary out arguments to
620         RetainPtr<NSDictionary>. Before, they were returning a retained object, but callers
621         did not seem to realize that.
622         * editing/mac/DictionaryLookup.mm:
623         (WebCore::tokenRange): Added helper. Takes care of doing adoptNS on the options
624         dictionary, and also handles the Objective-C exception possibility cleanly. Also
625         fixed the exception case to return NSNotFound instead of a zero-length range at
626         the location we are searching, which is what the code expects.
627         (WebCore::DictionaryLookup::rangeForSelection): Refactored to use the tokenRange
628         helper function, and also to do much less work when the options pointer is null.
629         (WebCore::DictionaryLookup::rangeAtHitTestResult): Use the tokenRange helper
630         function and also use auto a bunch to tighten up the code a bit.
631         (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
632
633         * page/DOMWindow.cpp:
634         (WebCore::DOMWindow::find const): Use |= instead of | to build find options.
635         * page/Page.cpp:
636         (WebCore::Page::findString): Use contains instead of & and also - instead of
637         & combined with ~.
638         (WebCore::Page::findStringMatchingRanges): Ditto.
639         (WebCore::Page::rangeOfString): Ditto.
640
641         * page/mac/EventHandlerMac.mm:
642         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
643         Pass nullptr to indicate we don't need the options dictionary. The code before
644         was passing a pointer to a null, which meant we would do the work to get the
645         options dictionary, not use it, and also leak it.
646
647         * testing/Internals.cpp:
648         (WebCore::Internals::rangeOfStringNearLocation): Pass { } instead of 0.
649         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Pass nullptr to
650         indicate we don't need the options dictionary as above.
651         (WebCore::parseFindOptions): Initialize options without an explicit 0, since
652         an OptionSet starts out empty rather than uninitialized.
653
654 2017-11-24  Antti Koivisto  <antti@apple.com>
655
656         Style resolution spin due to calc() values always comparing inequal (seen on arstechnica.com)
657         https://bugs.webkit.org/show_bug.cgi?id=179982
658         <rdar://problem/35677991>
659
660         Reviewed by Darin Adler.
661
662         Test: transitions/transition-with-calc-spin.html
663
664         Something like calc(100% - 10px) would compare inequal to itself. This causes the implicit animation engine think that
665         there is a new target value after style resolution and restart the transition. Starting the transition triggers another style
666         resolution on zero duration timer and so on.
667
668         * platform/CalculationValue.cpp:
669         (WebCore::operator==):
670         * platform/CalculationValue.h:
671
672         Deep compare the child vectors.
673
674 2017-11-24  Antoine Quint  <graouts@apple.com>
675
676         Captions move when <video> with no controls is hovered
677         https://bugs.webkit.org/show_bug.cgi?id=178600
678         <rdar://problem/35112309>
679
680         Reviewed by Jer Noble.
681
682         We should only reduce the text tracks container height to make room for the controls
683         bar when controls are enabled.
684
685         Tests: media/modern-media-controls/text-tracks/text-tracks-height-no-controls.html
686                media/modern-media-controls/text-tracks/text-tracks-height-with-controls.html
687
688         * Modules/modern-media-controls/controls/text-tracks.css:
689         (video[controls]::-webkit-media-text-track-container.visible-controls-bar):
690         (video::-webkit-media-text-track-container.visible-controls-bar): Deleted.
691
692 2017-11-23  Simon Fraser  <simon.fraser@apple.com>
693
694         Some FilterEffect cleanup and logging
695         https://bugs.webkit.org/show_bug.cgi?id=179932
696
697         Reviewed by Darin Adler.
698         
699         Rename the FilterEffect functions that get the result of the filter
700         to have "result" in the name.
701         
702         Re-order FilterEffect member variables and use initializers. webkit.org/b/45614
703         is closed so remove the comment about things moving to RenderSVGResourceFilterPrimitive.
704         
705         Add a virtual filterName() function for use by logging.
706         
707         Add a Filters log channel. Log some stuff.
708         
709         Rename RenderSVGResourceFilter::m_filter to m_rendererFilterDataMap.
710
711         * platform/Logging.h:
712         * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
713         (WebCore::FEBlend::platformApplySoftware):
714         * platform/graphics/filters/FEBlend.cpp:
715         (WebCore::FEBlend::platformApplySoftware):
716         * platform/graphics/filters/FEBlend.h:
717         * platform/graphics/filters/FEColorMatrix.cpp:
718         (WebCore::FEColorMatrix::platformApplySoftware):
719         * platform/graphics/filters/FEColorMatrix.h:
720         * platform/graphics/filters/FEComponentTransfer.cpp:
721         (WebCore::FEComponentTransfer::platformApplySoftware):
722         * platform/graphics/filters/FEComponentTransfer.h:
723         * platform/graphics/filters/FEComposite.cpp:
724         (WebCore::FEComposite::platformApplySoftware):
725         * platform/graphics/filters/FEComposite.h:
726         * platform/graphics/filters/FEConvolveMatrix.cpp:
727         (WebCore::FEConvolveMatrix::platformApplySoftware):
728         * platform/graphics/filters/FEConvolveMatrix.h:
729         * platform/graphics/filters/FEDisplacementMap.cpp:
730         (WebCore::FEDisplacementMap::platformApplySoftware):
731         * platform/graphics/filters/FEDisplacementMap.h:
732         * platform/graphics/filters/FEDropShadow.cpp:
733         (WebCore::FEDropShadow::platformApplySoftware):
734         * platform/graphics/filters/FEDropShadow.h:
735         * platform/graphics/filters/FEFlood.h:
736         * platform/graphics/filters/FEGaussianBlur.cpp:
737         (WebCore::FEGaussianBlur::platformApplySoftware):
738         * platform/graphics/filters/FEGaussianBlur.h:
739         * platform/graphics/filters/FELighting.cpp:
740         (WebCore::FELighting::platformApplySoftware):
741         * platform/graphics/filters/FELighting.h:
742         * platform/graphics/filters/FEMerge.cpp:
743         (WebCore::FEMerge::platformApplySoftware):
744         * platform/graphics/filters/FEMerge.h:
745         * platform/graphics/filters/FEMorphology.cpp:
746         (WebCore::FEMorphology::platformApplyDegenerate):
747         (WebCore::FEMorphology::platformApplySoftware):
748         * platform/graphics/filters/FEMorphology.h:
749         * platform/graphics/filters/FEOffset.cpp:
750         (WebCore::FEOffset::platformApplySoftware):
751         * platform/graphics/filters/FEOffset.h:
752         * platform/graphics/filters/FETile.cpp:
753         (WebCore::FETile::platformApplySoftware):
754         * platform/graphics/filters/FETile.h:
755         * platform/graphics/filters/FETurbulence.cpp:
756         (WebCore::operator<<):
757         * platform/graphics/filters/FETurbulence.h:
758         * platform/graphics/filters/FilterEffect.cpp:
759         (WebCore::FilterEffect::FilterEffect):
760         (WebCore::FilterEffect::imageBufferResult):
761         (WebCore::FilterEffect::unmultipliedResult):
762         (WebCore::FilterEffect::premultipliedResult):
763         (WebCore::FilterEffect::copyImageBytes const): This can be const. It'a also crazy
764         to mark a large, slow function like this as 'inline'.
765         (WebCore::FilterEffect::copyUnmultipliedResult):
766         (WebCore::FilterEffect::copyPremultipliedResult):
767         (WebCore::FilterEffect::createImageBufferResult):
768         (WebCore::FilterEffect::createUnmultipliedImageResult):
769         (WebCore::FilterEffect::createPremultipliedImageResult):
770         (WebCore::FilterEffect::transformResultColorSpace):
771         (WebCore::FilterEffect::asImageBuffer): Deleted.
772         (WebCore::FilterEffect::asUnmultipliedImage): Deleted.
773         (WebCore::FilterEffect::asPremultipliedImage): Deleted.
774         (WebCore::FilterEffect::copyImageBytes): Deleted.
775         (WebCore::FilterEffect::copyUnmultipliedImage): Deleted.
776         (WebCore::FilterEffect::copyPremultipliedImage): Deleted.
777         * platform/graphics/filters/FilterEffect.h:
778         * platform/graphics/filters/SourceAlpha.cpp:
779         (WebCore::SourceAlpha::platformApplySoftware):
780         * platform/graphics/filters/SourceAlpha.h:
781         * platform/graphics/filters/SourceGraphic.h:
782         * rendering/FilterEffectRenderer.cpp:
783         (WebCore::FilterEffectRenderer::output const):
784         * rendering/svg/RenderSVGResourceFilter.cpp:
785         (WebCore::RenderSVGResourceFilter::removeAllClientsFromCache):
786         (WebCore::RenderSVGResourceFilter::removeClientFromCache):
787         (WebCore::RenderSVGResourceFilter::applyResource):
788         (WebCore::RenderSVGResourceFilter::postApplyResource):
789         (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged):
790         (WebCore::RenderSVGResourceFilter::drawingRegion const):
791         (WebCore::operator<<):
792         * rendering/svg/RenderSVGResourceFilter.h:
793         (WebCore::FilterData::FilterData): Deleted.
794         * svg/graphics/filters/SVGFEImage.h:
795
796 2017-11-24  Antoine Quint  <graouts@apple.com>
797
798         [Web Animations] Allow getComputedStyle() to return animated values for accelerated animations
799         https://bugs.webkit.org/show_bug.cgi?id=179975
800         <rdar://problem/35676811>
801
802         Reviewed by Dean Jackson.
803
804         In case we're running an accelerated animation, we are not blending RenderStyles as the animation
805         progresses and thus we need to hook into computeRenderStyleForProperty() to query the DocumentTimeline
806         for the animated style of running accelerated animations where we blend styles manually for the
807         animation's current time.
808
809         Test: http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle.html
810
811         * animation/DocumentTimeline.cpp:
812         (WebCore::DocumentTimeline::animatedStyleForRenderer): Iterate through all running accelerated animations
813         for the element to which the provided renderer is attached and ask for their animated styles.
814         * animation/DocumentTimeline.h:
815         * animation/KeyframeEffect.cpp:
816         (WebCore::KeyframeEffect::getAnimatedStyle): Manually blend all animated properties and populate the provided
817         RenderStyle with their values, creating the RenderStyle if needed.
818         * animation/KeyframeEffect.h:
819         * css/CSSComputedStyleDeclaration.cpp:
820         (WebCore::computeRenderStyleForProperty): Query the DocumentTimeline for accelerated animated properties in
821         case such animations are running, otherwise let the CSS animation controller report the animated values.
822
823 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
824
825         [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer
826         https://bugs.webkit.org/show_bug.cgi?id=179977
827
828         Reviewed by Carlos Garcia Campos.
829
830         CoordinatedGraphicsLayer::updateContentBuffers() retrieves a RefPtr<CoordinatedBuffer>
831         from the CompositingCoordinator. This pointer should never be null since if no
832         existing UpdateAtlas can provide the necessary memory area, a fresh UpdateAtlas is
833         created and its buffer returned. This can't fail in theory since the tiles that are
834         being updated are smaller than the UpdateAtlas area.
835
836         The CoordinatedGraphicsLayerClient::getCoordinatedBuffer() method is updated to
837         always return a Ref<CoordinatedBuffer> value. Code in updateContentBuffers() is
838         updated to remove a null-check on what is now the Ref<CoordinatedBuffer> value.
839
840         No new tests -- no change in functionality.
841
842         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
843         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
844         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
845
846 2017-11-23  Antoine Quint  <graouts@apple.com>
847
848         [Web Animations] Perform accelerated animations when possible
849         https://bugs.webkit.org/show_bug.cgi?id=179973
850         <rdar://problem/34953922>
851
852         Reviewed by Dean Jackson.
853
854         When we're entering and leaving the active duration of an animation effect, we now check
855         whether the animation can be accelerated, using the existing CSSPropertyAnimation::animationOfPropertyIsAccelerated()
856         utility, and start and stop animations using the startAnimation() and animationFinished() functions on RenderBoxModelObject.
857
858         This patch is only a first step towards full support for accelerated animations,
859         there are two known issues at the moment. Because we're not blending the styles to perform
860         the animation, getComputedStyle() will not return the animated value (webkit.org/b/179974).
861         Additionally, if other animations happen to run later during the active state of an animation
862         that can run accelerated, we will not fall back to software-only animation for this
863         element and these animations will appear not to run (webkit.org/b/179975). These will be
864         addressed in follow-up patches.
865
866         Tests: webanimations/left-and-opacity-animation-yields-no-compositing.html
867                webanimations/opacity-animation-no-longer-composited-upon-completion.html
868                webanimations/opacity-animation-yields-compositing.html
869                webanimations/width-and-opacity-separate-animation-yields-no-compositing.html
870
871         * animation/DocumentTimeline.cpp:
872         (WebCore::DocumentTimeline::updateAnimations): Check in the map of pending accelerated animations
873         to see if any animation requires toggling their active state after their styles have been invalidated.
874         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): New function to
875         let animations indicate that they need to have their accelerated backing animation toggled after
876         style invalidation has been completed.
877         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): This function is used
878         in RenderLayerCompositor::requiresCompositingForAnimation() to identify whether an element requires
879         hardware compositing due to running accelerated animations. We check all running animations for the
880         provided element to see if they can all be running accelerated and return true in this situation only.
881         * animation/DocumentTimeline.h:
882         * animation/KeyframeEffect.cpp:
883         (WebCore::KeyframeEffect::applyAtLocalTime): Identify if we're crossing into or out of the active state
884         for an animation and check if it will be or has been running accelerated such that we can notify the
885         DocumentTimeline, through the associated animation, that the accelerated backing animation will need to
886         be toggled after style invalidation has been completed.
887         (WebCore::KeyframeEffect::shouldRunAccelerated): Check that all properties for this animation
888         effect can be accelerated according to CSSPropertyAnimation::animationOfPropertyIsAccelerated().
889         (WebCore::KeyframeEffect::startOrStopAccelerated): Start or stop the associated accelerated
890         animation through the associated element's RenderBoxModelObject renderer.
891         * animation/KeyframeEffect.h:
892         * animation/WebAnimation.cpp:
893         (WebCore::WebAnimation::acceleratedRunningStateDidChange): Called from AnimationEffect::applyAtLocalTime(),
894         we forward to the DocumentTimeline the information that the animation will cross an active state boundary while
895         allowing to be backed by hardware compositing.
896         (WebCore::WebAnimation::startOrStopAccelerated): Forward to the associated KeyframeEffect that accelerated
897         animation backing should be toggled.
898         * animation/WebAnimation.h:
899         * rendering/RenderLayerCompositor.cpp:
900         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Check via the renderer's element's
901         DocumentTimeline that all running animations for this particular element are accelerated to ensure that
902         the element will be hardware-composited.
903
904 2017-11-23  Fujii Hironori  <Hironori.Fujii@sony.com>
905
906         [Win] PasteboardWin.cpp(653): error C2039: 'containsOnlyASCII': is not a member of 'WTF::String'
907         https://bugs.webkit.org/show_bug.cgi?id=179991
908
909         Unreviewed build fix.
910
911         No new tests (No behaviour change).
912
913         * platform/win/PasteboardWin.cpp:
914         (WebCore::Pasteboard::writeURLToDataObject): Renamed containsOnlyASCII() to isAllASCII().
915
916 2017-11-23  Carlos Alberto Lopez Perez  <clopez@igalia.com>
917
918         [GTK] [Debug] Fix build after r225117.
919         https://bugs.webkit.org/show_bug.cgi?id=179907
920
921         Unreviewed build fix.
922
923         r225117 renamed containsOnlyASCII() to isAllASCII().
924         And this reference was not updated for the GTK Debug build.
925
926         No new tests, its a build fix.
927
928         * loader/archive/mhtml/MHTMLArchive.cpp:
929         (WebCore::MHTMLArchive::generateMHTMLData):
930
931 2017-11-23  Simon Fraser  <simon.fraser@apple.com>
932
933         FELighting cleanup and optimization
934         https://bugs.webkit.org/show_bug.cgi?id=179933
935
936         Reviewed by Darin Adler.
937
938         Make FELighting about 25% faster by maintaining an "alpha" window of the alpha
939         values of the 9 pixels surrounding the current pixel, and sliding this window over
940         when moving to the next pixel. This avoids reading the same alpha values from the original
941         buffer multiple times.
942
943         Clean up LightSource and subclasses, adding SPECIALIZE_TYPE_TRAITS macros,
944         and turning updatePaintingData() into a function with no side effects that returns
945         the required data.
946
947         Remove explicit 'inline' keywords, allowing the compiler to make inlining decisions.
948
949         * platform/graphics/cpu/arm/filters/FELightingNEON.h:
950         (WebCore::FELighting::platformApplyNeon):
951         * platform/graphics/filters/DistantLightSource.cpp:
952         (WebCore::DistantLightSource::initPaintingData):
953         (WebCore::DistantLightSource::computePixelLightingData const):
954         (WebCore::DistantLightSource::updatePaintingData): Deleted.
955         * platform/graphics/filters/DistantLightSource.h:
956         * platform/graphics/filters/FELighting.cpp:
957         (WebCore::FELighting::LightingData::interiorNormal const):
958         (WebCore::FELighting::setPixel):
959         (WebCore::FELighting::setPixelInternal):
960         (WebCore::FELighting::platformApplyGenericPaint):
961         (WebCore::FELighting::platformApplyGeneric):
962         (WebCore::FELighting::platformApply):
963         (WebCore::FELighting::drawLighting):
964         (WebCore::FELighting::inlineSetPixel): Deleted.
965         * platform/graphics/filters/FELighting.h:
966         (WebCore::FELighting::AlphaWindow::topLeft const):
967         (WebCore::FELighting::AlphaWindow::left const):
968         (WebCore::FELighting::AlphaWindow::bottomLeft const):
969         (WebCore::FELighting::AlphaWindow::top const):
970         (WebCore::FELighting::AlphaWindow::center const):
971         (WebCore::FELighting::AlphaWindow::bottom const):
972         (WebCore::FELighting::AlphaWindow::setTop):
973         (WebCore::FELighting::AlphaWindow::setCenter):
974         (WebCore::FELighting::AlphaWindow::setBottom):
975         (WebCore::FELighting::AlphaWindow::setTopRight):
976         (WebCore::FELighting::AlphaWindow::setRight):
977         (WebCore::FELighting::AlphaWindow::setBottomRight):
978         (WebCore::FELighting::AlphaWindow::shiftRow):
979         (WebCore::FELighting::AlphaWindow::shift):
980         * platform/graphics/filters/LightSource.h:
981         * platform/graphics/filters/PointLightSource.cpp:
982         (WebCore::PointLightSource::computePixelLightingData const):
983         (WebCore::PointLightSource::updatePaintingData): Deleted.
984         * platform/graphics/filters/PointLightSource.h:
985         * platform/graphics/filters/SpotLightSource.cpp:
986         (WebCore::SpotLightSource::initPaintingData):
987         (WebCore::SpotLightSource::computePixelLightingData const):
988         (WebCore::SpotLightSource::updatePaintingData): Deleted.
989         * platform/graphics/filters/SpotLightSource.h:
990
991 2017-11-23  Simon Fraser  <simon.fraser@apple.com>
992
993         Add support for CanvasPattern.setTransform()
994         https://bugs.webkit.org/show_bug.cgi?id=179935
995
996         Reviewed by Sam Weinig.
997         
998         Add support for setTransform() on CanvasPattern, per
999         <https://html.spec.whatwg.org/multipage/canvas.html#dom-canvaspattern-settransform>
1000         It uses [MayThrowException] since the "validate and fixup" steps for DOMMatrix can throw
1001         an exception.
1002         
1003         Under the hood, the transform is just pushed onto Pattern as the patternSpaceTransform().
1004         
1005         Minor cleanup in Pattern.
1006
1007         Test: fast/canvas/canvas-pattern-with-transform.html
1008
1009         * html/canvas/CanvasPattern.cpp:
1010         (WebCore::CanvasPattern::setTransform):
1011         * html/canvas/CanvasPattern.h:
1012         * html/canvas/CanvasPattern.idl:
1013         * platform/graphics/Pattern.h:
1014
1015 2017-11-23  Sam Weinig  <sam@webkit.org>
1016
1017         Remove unneeded ScriptController::processingUserGesture() forwarding functions
1018         https://bugs.webkit.org/show_bug.cgi?id=179954
1019
1020         Reviewed by Darin Adler.
1021
1022         Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia()
1023         with direct calls to the corresponding UserGestureIndicator functions.
1024
1025         * Modules/applepay/ApplePaySession.cpp:
1026         (WebCore::ApplePaySession::create):
1027         (WebCore::ApplePaySession::openPaymentSetup):
1028         * Modules/speech/SpeechSynthesis.cpp:
1029         (WebCore::SpeechSynthesis::speak):
1030         * bindings/js/ScriptController.cpp:
1031         (WebCore::ScriptController::processingUserGesture): Deleted.
1032         (WebCore::ScriptController::processingUserGestureForMedia): Deleted.
1033         * bindings/js/ScriptController.h:
1034         * dom/Document.cpp:
1035         (WebCore::Document::processingUserGestureForMedia const):
1036         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1037         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
1038         * html/ColorInputType.cpp:
1039         (WebCore::ColorInputType::handleDOMActivateEvent):
1040         * html/FileInputType.cpp:
1041         (WebCore::FileInputType::handleDOMActivateEvent):
1042         * html/HTMLFormElement.cpp:
1043         (WebCore::HTMLFormElement::submitFromJavaScript):
1044         * html/HTMLPlugInImageElement.cpp:
1045         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
1046         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
1047         * loader/FrameLoader.cpp:
1048         (WebCore::FrameLoader::submitForm):
1049         (WebCore::shouldOpenExternalURLsPolicyToApply):
1050         * page/DOMWindow.cpp:
1051         (WebCore::DOMWindow::allowPopUp):
1052         (WebCore::DOMWindow::setLocation):
1053         (WebCore::DOMWindow::createWindow):
1054         (WebCore::DOMWindow::open):
1055         * page/PointerLockController.cpp:
1056         (WebCore::PointerLockController::requestPointerLock):
1057
1058 2017-11-22  Dean Jackson  <dino@apple.com>
1059
1060         Add a base class for HTMLCanvasElement and OffscreenCanvas
1061         https://bugs.webkit.org/show_bug.cgi?id=179701
1062         <rdar://problem/35545195>
1063
1064         Post-review updates from Darin Adler review.
1065
1066         * html/CanvasBase.cpp:
1067         (WebCore::CanvasBase::asHTMLCanvasElement): Deleted. Replaced by having the call
1068         sites get the reference and do the correct downcast<>.
1069         * html/CanvasBase.h: Remove asHTMLCanvasElement. Add pure virtual ref/deref functions
1070         so they can be overridden by subclasses. Unfortunately they can't be called ref/deref otherwise
1071         they conflict with Node.
1072         * html/HTMLCanvasElement.h: Add the type traits, so is<HTMLCanvasElement>(canvasBase) will
1073         work.
1074         * html/HTMLTagNames.in: Specify the <canvas> element as having custom type traits.
1075         * html/OffscreenCanvas.h: Lots of overrides to finals.
1076         * html/canvas/CanvasRenderingContext.cpp: Use canvasBase.de/refCanvasBase rather than
1077         casting.
1078         (WebCore::CanvasRenderingContext::ref):
1079         (WebCore::CanvasRenderingContext::deref):
1080         * html/canvas/CanvasRenderingContext.h: Lots of overrides to finals.
1081         * html/canvas/CanvasRenderingContext2D.h:
1082         * html/canvas/ImageBitmapRenderingContext.cpp:
1083         (WebCore::ImageBitmapRenderingContext::canvas const):
1084         * html/canvas/WebGLRenderingContextBase.cpp:
1085         (WebCore::WebGLRenderingContextBase::create):
1086         (WebCore::WebGLRenderingContextBase::canvas):
1087         * html/canvas/WebGPURenderingContext.cpp:
1088         (WebCore::WebGPURenderingContext::canvas const):
1089         * inspector/InspectorInstrumentation.h:
1090         (WebCore::InspectorInstrumentation::recordCanvasAction):
1091         * inspector/agents/InspectorCanvasAgent.cpp:
1092         (WebCore::InspectorCanvasAgent::recordCanvasAction):
1093
1094 2017-11-23  Darin Adler  <darin@apple.com>
1095
1096         Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
1097         https://bugs.webkit.org/show_bug.cgi?id=179907
1098
1099         Reviewed by Sam Weinig.
1100
1101         * Modules/plugins/YouTubePluginReplacement.cpp:
1102         (WebCore::hasCaseInsensitivePrefix): Deleted.
1103         (WebCore::processAndCreateYouTubeURL): Use startsWithLettersIgnoringASCIICase.
1104
1105         * Modules/websockets/WebSocketHandshake.cpp:
1106         (WebCore::WebSocketHandshake::readHTTPHeaders): Use isAllASCII.
1107
1108         * accessibility/atk/AccessibilityObjectAtk.cpp:
1109         (WebCore::AccessibilityObject::getLengthForTextRange const): Use text().length().
1110
1111         * accessibility/AXObjectCache.cpp:
1112         (WebCore::AXObjectCache::traverseToOffsetInRange): Use isHTMLSpace instead of
1113         isSpaceOrNewline since the code is trying to skip collapsible HTML spaces, not
1114         arbitrary Unicode whitespace.
1115         * accessibility/AccessibilityList.cpp:
1116         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers): Use
1117         isAllSpecialCharacters<isHTMLSpace> for the same reason as above.
1118
1119         * accessibility/AccessibilityNodeObject.cpp:
1120         (WebCore::AccessibilityNodeObject::isSearchField const): Use containsIgnoringASCIICase.
1121
1122         * accessibility/AccessibilityObject.cpp:
1123         (WebCore::AccessibilityObject::accessibilityObjectContainsText const): Use
1124         new findPlainText function exported from TextIterator so this can share the
1125         same search matching logic used to find text in webpages.
1126         (WebCore::AccessibilityObject::selectText): Use capitalize and its return value
1127         rather than makeCapitalize modifying a string in place.
1128
1129         * accessibility/AccessibilityRenderObject.cpp:
1130         (WebCore::objectInclusionFromAltText): Use isAllSpecialCharacters<isHTMLSpace>
1131         for the same reason as above.
1132         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): Ditto.
1133
1134         * bindings/js/JSDOMConvertStrings.cpp:
1135         (WebCore::stringToByteString): Use isAllLatin1.
1136
1137         * contentextensions/ContentExtensionParser.cpp:
1138         (WebCore::ContentExtensions::containsOnlyASCIIWithNoUppercase): Use
1139         StringView::codeUnits instead of String::at.
1140
1141         * contentextensions/ContentExtensionsBackend.cpp:
1142         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
1143         Use isAllASCII.
1144         * contentextensions/URLFilterParser.cpp:
1145         (WebCore::ContentExtensions::URLFilterParser::addPattern): Ditto.
1146
1147         * css/CSSFontFaceSrcValue.cpp:
1148         (WebCore::CSSFontFaceSrcValue::isSupportedFormat const): Use protocolIs and
1149         endsWithIgnoringASCIICase.
1150
1151         * css/DOMCSSNamespace.cpp:
1152         (WebCore::valueWithoutImportant): Use endsWithIgnoringASCIICase.
1153
1154         * css/parser/CSSPropertyParser.cpp:
1155         (WebCore::parseGridTemplateAreasRow): Use isAllSpecialCharacters<isCSSSpace>,
1156         for the preflight, which matches what the actual parsing code uses.
1157
1158         * dom/CharacterData.cpp:
1159         (WebCore::CharacterData::containsOnlyWhitespace const): Deleted. Callers can
1160         efficiently get at the data and do this kind of check on the data directly.
1161         * dom/CharacterData.h: Updated for the above.
1162
1163         * dom/DataTransfer.cpp:
1164         (WebCore::normalizeType): Use startsWith since the string is already converted
1165         to ASCII lowercase.
1166
1167         * dom/Position.cpp:
1168         (WebCore::Position::leadingWhitespacePosition const): Use isHTMLSpace since
1169         since the code is trying to check for collapsible HTML spaces, not general
1170         Unicode spaces. Other call sites of isSpaceOrNewline need to be checked for
1171         this, but I did not fix them all at this time.
1172         (WebCore::Position::trailingWhitespacePosition const): Ditto.
1173
1174         * editing/Editor.cpp:
1175         (WebCore::Editor::editorUIUpdateTimerFired): Use noBreakSpace.
1176
1177         * editing/FrameSelection.cpp:
1178         (WebCore::FrameSelection::debugRenderer const): Use text().length() instead
1179         of textLength.
1180         (WebCore::FrameSelection::selectionAtWordStart const): Use noBreakSpace.
1181         (WebCore::FrameSelection::wordSelectionContainingCaretSelection): Ditto.
1182         (WebCore::FrameSelection::actualSelectionAtSentenceStart const): Ditto.
1183
1184         * editing/TextIterator.cpp:
1185         (WebCore::textNodeOffsetInFlow): Use text().length().
1186         (WebCore::TextIterator::handleTextNode): Ditto.
1187         (WebCore::collapsedSpaceLength): Updated since RenderText::text now returns
1188         a reference rather than a pointer.
1189         (WebCore::findPlainText): Added. Uses SearchBuffer to search for one string
1190         within another. Exported so accessibility code can do this operation.
1191         * editing/TextIterator.h: Updated for the above.
1192
1193         * editing/TypingCommand.cpp:
1194         (WebCore::TypingCommand::markMisspellingsAfterTyping): Use noBreakSpace.
1195
1196         * editing/VisibleUnits.cpp:
1197         (WebCore::findStartOfParagraph): Updated since RenderText::text now returns
1198         a reference.
1199         (WebCore::findEndOfParagraph): Ditto.
1200
1201         * editing/cocoa/HTMLConverter.mm:
1202         (HTMLConverter::_processText): Use String::characterAt instead of String::at.
1203         Use capitalize instead of makeCapitalized.
1204
1205         * editing/cocoa/WebContentReaderCocoa.mm:
1206         (WebCore::stripMicrosoftPrefix): Use findIgnoringASCIICase.
1207
1208         * html/Autofill.cpp:
1209         (WebCore::AutofillData::createFromHTMLFormControlElement): Use
1210         startsWithLettersIgnoringASCIICase.
1211
1212         * html/BaseTextInputType.cpp:
1213         (WebCore::BaseTextInputType::patternMismatch const): Removed explicit
1214         TextCaseSensitive since it now is the default, and needed to touch this anyway
1215         because the enumeration is now in a different namespace.
1216
1217         * html/EmailInputType.cpp:
1218         (WebCore::isValidEmailAddress): Updated to use JSC::Yarr::TextCaseInsensitive.
1219
1220         * html/HTMLObjectElement.cpp:
1221         (WebCore::HTMLObjectElement::hasFallbackContent const): Use
1222         isAllSpecialCharacters<isHTMLSpace>.
1223         (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use
1224         startsWithLettersIgnoringASCIICase.
1225         (WebCore::HTMLObjectElement::hasValidClassId): Use protocolIs.
1226         (WebCore::preventsParentObjectFromExposure): Use isAllSpecialCharacters<isHTMLSpace>.
1227
1228         * html/parser/HTMLConstructionSite.cpp:
1229         (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype):
1230         Use startsWithLettersIgnoringASCIICase.
1231
1232         * html/parser/HTMLMetaCharsetParser.cpp:
1233         (WebCore::extractCharset): Use findIgnoringASCIICase.
1234
1235         * html/parser/XSSAuditor.cpp:
1236         (WebCore::XSSAuditor::isContainedInRequest): Use containsIgnoringASCIICase.
1237
1238         * html/track/WebVTTParser.cpp:
1239         (WebCore::WebVTTParser::hasRequiredFileIdentifier): Don't pass the length to
1240         the String::startsWith function. There has never been a version of that function
1241         that takes the length, there is no need to pass the length since the function
1242         handles null-terminated strings like the one here, and in the past the length
1243         has been getting converted to a boolean making the comparison be case sensitive.
1244         Removing the argument entirely leaves it case sensitive.
1245
1246         * inspector/InspectorNodeFinder.cpp:
1247         (WebCore::InspectorNodeFinder::matchesElement): Use startsWithIgnoringASCIICase
1248         and endsWithIgnoringASCIICase.
1249
1250         * inspector/InspectorStyleSheet.cpp:
1251         (WebCore::selectorsFromSource): Use JSC::Yarr::TextCaseSensitive.
1252
1253         * inspector/agents/InspectorDOMAgent.cpp:
1254         (WebCore::containsOnlyHTMLWhitespace): Made this a non-member function
1255         and reimplemented using isAllSpecialCharacters<isHTMLSpace>().
1256         (WebCore::InspectorDOMAgent::innerFirstChild): Use containsOnlyHTMLWhitespace.
1257         (WebCore::InspectorDOMAgent::innerNextSibling): Ditto.
1258         (WebCore::InspectorDOMAgent::innerPreviousSibling): Ditto.
1259         (WebCore::InspectorDOMAgent::innerChildNodeCount): Ditto.
1260         (WebCore::InspectorDOMAgent::didInsertDOMNode): Ditto.
1261         (WebCore::InspectorDOMAgent::didRemoveDOMNode): Ditto.
1262         * inspector/agents/InspectorDOMAgent.h: Updated for above change.
1263
1264         * loader/appcache/ApplicationCacheStorage.cpp:
1265         (WebCore::ApplicationCacheStorage::shouldStoreResourceAsFlatFile):
1266         Use startsWithLettersIgnoringASCIICase.
1267
1268         * page/Base64Utilities.cpp:
1269         (WebCore::Base64Utilities::btoa): Use isAllLatin1.
1270
1271         * page/Frame.cpp:
1272         (WebCore::createRegExpForLabels): Removed TextCaseSensitive argument since
1273         that is now the default and also used JSC::Yarr::TextCaseInsensitive.
1274         (WebCore::matchLabelsAgainstString): More of the same.
1275
1276         * page/FrameView.cpp:
1277         (WebCore::countRenderedCharactersInRenderObjectWithThreshold): Use
1278         text().length().
1279
1280         * page/SecurityOrigin.cpp:
1281         (WebCore::isFeedWithNestedProtocolInHTTPFamily): Use
1282         startsWithLettersIgnoringASCIICase.
1283
1284         * page/UserContentURLPattern.cpp:
1285         (WebCore::UserContentURLPattern::matchesHost const):
1286         Use endsWithIgnoringASCIICase.
1287         * page/csp/ContentSecurityPolicySource.cpp:
1288         (WebCore::ContentSecurityPolicySource::hostMatches const): Ditto.
1289
1290         * page/csp/ContentSecurityPolicySourceList.cpp:
1291         (WebCore::ContentSecurityPolicySourceList::parseNonceSource):
1292         Use startsWithIgnoringASCIICase.
1293
1294         * page/ios/FrameIOS.mm:
1295         (WebCore::Frame::wordsInCurrentParagraph const): Use noBreakSpace.
1296
1297         * platform/ContentType.cpp:
1298         (WebCore::ContentType::parameter const): Use findIgnoringASCIICase.
1299
1300         * platform/MIMETypeRegistry.cpp:
1301         (WebCore::MIMETypeRegistry::isSupportedFontMIMEType): Use
1302         startsWithLettersIgnoringASCIICase.
1303         (WebCore::MIMETypeRegistry::isSupportedJSONMIMEType): Use
1304         mimeType.endsWithIgnoringASCIICase.
1305         (WebCore::MIMETypeRegistry::isTextMIMEType): Use
1306         startsWithLettersIgnoringASCIICase.
1307         (WebCore::MIMETypeRegistry::isXMLMIMEType): Use endsWithIgnoringASCIICase.
1308         (WebCore::MIMETypeRegistry::isJavaAppletMIMEType): Use
1309         startsWithLettersIgnoringASCIICase.
1310         (WebCore::MIMETypeRegistry::canShowMIMEType): Ditto.
1311
1312         * platform/URL.cpp:
1313         (WebCore::isAllASCII): Renamed from containsOnlyASCII.
1314         (WebCore::appendEncodedHostname): Use isAllASCII.
1315
1316         * platform/URLParser.cpp:
1317         (WebCore::containsOnlyASCII): Deleted.
1318         (WebCore::URLParser::domainToASCII): Use StringImpl::isAllASCII. Changed
1319         to take StringImpl& to guarantee we won't keep doing null checks since
1320         the caller already checks for null.
1321         (WebCore::URLParser::parseHostAndPort): Pass StringImpl&.
1322         * platform/URLParser.h: Updated for above.
1323
1324         * platform/graphics/MediaPlayer.cpp:
1325         (WebCore::MediaPlayer::supportsType): Use endsWithIgnoringASCIICase
1326         and startsWithLettersIgnoringASCIICase.
1327
1328         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1329         (WebCore::validKeySystemRE): Use JSC::Yarr::TextCaseInsensitive.
1330
1331         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1332         (WebCore::FontCache::similarFont): Use containsIgnoringASCIICase for
1333         the Geeza font special cases.
1334
1335         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1336         (WebCore::shouldRejectMIMEType): Use startsWithLettersIgnoringASCIICase.
1337
1338         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1339         (WebCore::GraphicsContext3D::getUnmangledInfoLog): Removed
1340         TextCaseSensitive since it now is the default.
1341
1342         * platform/mac/PublicSuffixMac.mm:
1343         (WebCore::topPrivatelyControlledDomain): Use isAllASCII.
1344
1345         * platform/mac/SSLKeyGeneratorMac.mm:
1346         (WebCore::signedPublicKeyAndChallengeString): Use isAllASCII.
1347
1348         * platform/mac/StringUtilities.mm:
1349         (WebCore::stringMatchesWildcardString): Use JSC::Yarr::TextCaseInsensitive.
1350
1351         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1352         (WebCore::addStringToSHA1): Use isAllASCII.
1353
1354         * platform/network/CacheValidation.cpp:
1355         (WebCore::parseCacheControlDirectives): Use containsIgnoringASCIICase.
1356
1357         * platform/network/HTTPParsers.cpp:
1358         (WebCore::parseHTTPRefresh): Use findIgnoringASCIICase.
1359         (WebCore::findCharsetInMediaType): Ditto.
1360         (WebCore::parseRange): Use startsWithLettersIgnoringASCIICase.
1361
1362         * platform/network/curl/AuthenticationChallengeCurl.cpp:
1363         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
1364         Use findIgnoringASCIICase.
1365         * platform/network/curl/MultipartHandle.cpp:
1366         (WebCore::MultipartHandle::extractBoundary): Ditto.
1367         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1368         (WebCore::ResourceHandleCurlDelegate::handleDataURL): Use
1369         endsWithIgnoringASCIICase.
1370         * platform/network/curl/ResourceResponseCurl.cpp:
1371         (WebCore::ResourceResponse::isAppendableHeader): Use
1372         startsWithLettersIgnoringASCIICase.
1373         (WebCore::ResourceResponse::appendHTTPHeaderField): Ditto.
1374
1375         * platform/win/ClipboardUtilitiesWin.cpp:
1376         (WebCore::extractMarkupFromCFHTML): Use findIgnoringASCIICase.
1377         (WebCore::fragmentFromCFHTML): Ditto.
1378
1379         * rendering/BidiRun.cpp:
1380         (WebCore::BidiRun::BidiRun): Use text().length().
1381         * rendering/HitTestResult.cpp:
1382         (WebCore::HitTestResult::absolutePDFURL const): Use
1383         endsWithIgnoringASCIICase.
1384         * rendering/InlineFlowBox.cpp:
1385         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection): Use text().length().
1386         * rendering/InlineIterator.h:
1387         (WebCore::InlineIterator::fastIncrementInTextNode): Ditto.
1388         (WebCore::InlineIterator::increment): Dtto.
1389         * rendering/InlineTextBox.cpp:
1390         (WebCore::InlineTextBox::isLineBreak const): Updated since RenderText::text
1391         now returns a StringImpl&.
1392         (WebCore::InlineTextBox::selectionStartEnd const): Use text().length().
1393         (WebCore::InlineTextBox::text const): Updated since RenderText::text
1394         now returns a StringImpl&.
1395         * rendering/RenderBlock.cpp:
1396         (WebCore::RenderBlock::constructTextRun): Use text().length().
1397         * rendering/RenderBlockFlow.cpp:
1398         (WebCore::isVisibleRenderText): Use isAllSpecialCharacters<isHTMLSpace>().
1399         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
1400         Use the new trimmedPreferredWidths that returns a structure instead of the
1401         old one with lots of arguments. Also use text().length().
1402         * rendering/RenderBlockLineLayout.cpp:
1403         (WebCore::endsWithHTMLSpaces): Renamed and changed to use isHTMLSpace
1404         instead of isASCIISpace.
1405         (WebCore::reachedEndOfTextRenderer): Use endsWithHTMLSpaces.
1406         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1407         Updated for hcanges to RenderText.
1408         (WebCore::RenderBlockFlow::handleTrailingSpaces): Ditto.
1409         (WebCore::RenderBlockFlow::determineStartPosition): Ditto.
1410
1411         * rendering/RenderCombineText.cpp:
1412         (WebCore::RenderCombineText::combineTextIfNeeded): Use
1413         isAllSpecialCharacters<isHTMLSpace>.
1414         * rendering/RenderLayer.cpp:
1415         (WebCore::RenderLayer::calculateClipRects const): Ditto.
1416
1417         * rendering/RenderListBox.cpp:
1418         (WebCore::bolder): Added. Helper function.
1419         (WebCore::RenderListBox::updateFromElement): Rewrote to
1420         only compute the bolder font once rather than for every item.
1421         (WebCore::RenderListBox::paintItemForeground): Updated for
1422         change to applyTextTransform.
1423
1424         * rendering/RenderMenuList.cpp:
1425         (WebCore::RenderMenuList::adjustInnerStyle): Updated for change
1426         to RenderText::text.
1427         (RenderMenuList::updateOptionsWidth): Updated for change to
1428         applyTextTransform.
1429         (RenderMenuList::itemText const): Ditto.
1430
1431         * rendering/RenderText.cpp:
1432         (WebCore::capitalize): Renamed from makeCapitalized. Changed to
1433         take and return a String instead of taking a String*.
1434         (WebCore::RenderText::RenderText): Use isAllASCII. Also moved
1435         initialization of most non-bitfield members to the class definition.
1436         (WebCore::RenderText::positionForPoint): Use text().
1437         (WebCore::RenderText::widthFromCache const): Ditto.
1438         (WebCore::RenderText::hangablePunctuationStartWidth const): Ditto.
1439         (WebCore::RenderText::hangablePunctuationEndWidth const): Ditto.
1440         (WebCore::RenderText::isHangableStopOrComma): Ditto.
1441         (WebCore::RenderText::firstCharacterIndexStrippingSpaces const): Ditto.
1442         (WebCore::RenderText::lastCharacterIndexStrippingSpaces const): Ditto.
1443         (WebCore::RenderText::trimmedPreferredWidths): Changed to return values
1444         in a structure instead of taking lots of arguments.
1445         (WebCore::RenderText::computePreferredLogicalWidths): Updated to use
1446         the text() function.
1447         (WebCore::isAllCollapsibleWhitespace): Added.
1448         (WebCore::RenderText::isAllCollapsibleWhitespace const): Updated to
1449         use a tighter loop.
1450         (WebCore::isAllPossiblyCollapsibleWhitespace): Added.
1451         (WebCore::RenderText::containsOnlyHTMLWhitespace const): Updated to
1452         use a tighter loop. Renamed from containsOnlyWhitespace.
1453         (WebCore::RenderText::setTextWithOffset): Updated to  use text().
1454         (WebCore::isInlineFlowOrEmptyText): Rewrote to be easier to read.
1455         (WebCore::RenderText::previousCharacter const): Got rid of unneeded
1456         null check and simplified.
1457         (WebCore::applyTextTransform): Changed to return a String rather
1458         than modifying one that is passed in.
1459         (WebCore::RenderText::setRenderedText): Updated use of applyTextTransform.
1460         (WebCore::RenderText::secureText): More of the same.
1461         (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const): Ditto.
1462         (WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const): Ditto.
1463         (WebCore::RenderText::width const): Ditto.
1464         (WebCore::RenderText::collectSelectionRectsForLineBoxes): Ditto.
1465         (WebCore::RenderText::previousOffset const): Ditto.
1466         (WebCore::RenderText::previousOffsetForBackwardDeletion const): Ditto.
1467         (WebCore::RenderText::nextOffset const): Ditto.
1468         (WebCore::RenderText::computeCanUseSimpleFontCodePath const): Ditto.
1469         (WebCore::RenderText::stringView const): Ditto.
1470
1471         * rendering/RenderText.h: Made some more members private and final.
1472         Updated for above, including adding the Widths structure. Got rid of the
1473         textLength function, which existed as a workaround before we could mark
1474         a function like length final. Made the text function return a StringImpl&,
1475         which is good since the m_text string is never null, and so callers end
1476         up using StringImpl directly and saving null checks. Removed functions
1477         that are not needed, including is8Bit, characters8, characters16,
1478         uncheckedCharacterAt, operator[], and isAllASCII.
1479
1480         * rendering/RenderTextFragment.cpp:
1481         (WebCore::RenderTextFragment::setText): Use text().length().
1482         * rendering/RenderTextLineBoxes.cpp:
1483         (WebCore::RenderTextLineBoxes::caretMaxOffset const): Ditto.
1484         (WebCore::RenderTextLineBoxes::positionForPoint const): Ditto.
1485         (WebCore::RenderTextLineBoxes::setSelectionState): Ditto.
1486         (WebCore::RenderTextLineBoxes::absoluteQuads const): Ditto.
1487         * rendering/SimpleLineLayout.cpp:
1488         (WebCore::SimpleLineLayout::canUseForFontAndText): Ditto.
1489         * rendering/SimpleLineLayoutCoverage.cpp:
1490         (WebCore::SimpleLineLayout::textLengthForSubtree): Ditto.
1491         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Ditto.
1492         * rendering/SimpleLineLayoutFlowContents.cpp:
1493         (WebCore::SimpleLineLayout::initializeSegments): Ditto.
1494         * rendering/SimpleLineLayoutFunctions.cpp:
1495         (WebCore::SimpleLineLayout::textOffsetForPoint): Ditto.
1496         * rendering/SimpleLineLayoutFunctions.h:
1497         (WebCore::SimpleLineLayout::findCaretMaximumOffset): Ditto.
1498         * rendering/line/BreakingContext.h:
1499         (WebCore::shouldAddBorderPaddingMargin): Ditto.
1500         (WebCore::shouldSkipWhitespaceAfterStartObject): Ditto.
1501         (WebCore::iteratorIsBeyondEndOfRenderCombineText): Ditto.
1502         (WebCore::textWidth): Ditto.
1503         (WebCore::BreakingContext::handleText): Ditto.
1504         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Ditto.
1505         * rendering/line/TrailingObjects.cpp:
1506         (WebCore::TrailingObjects::updateWhitespaceCollapsingTransitionsForTrailingBoxes): Ditto.
1507
1508         * rendering/mathml/RenderMathMLFenced.cpp:
1509         (WebCore::RenderMathMLFenced::updateFromElement): Removed stray use of "unsigned int".
1510
1511         * rendering/svg/RenderSVGInlineText.cpp:
1512         (WebCore::RenderSVGInlineText::characterStartsNewTextChunk const): Use text().length().
1513         (WebCore::RenderSVGInlineText::positionForPoint): Ditto.
1514         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
1515         (WebCore::processRenderSVGInlineText): Ditto.
1516         * rendering/svg/SVGTextLayoutEngine.cpp:
1517         (WebCore::SVGTextLayoutEngine::currentLogicalCharacterAttributes): Ditto.
1518         * rendering/svg/SVGTextQuery.cpp:
1519         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures const): Ditto.
1520
1521         * style/RenderTreeUpdater.cpp:
1522         (WebCore::RenderTreeUpdater::updateRenderTree): Use isAllSpecialCharacters<isHTMLSpace>.
1523         (WebCore::RenderTreeUpdater::textRendererIsNeeded): Ditto.
1524
1525         * svg/SVGTests.cpp:
1526         (WebCore::SVGTests::hasFeatureForLegacyBindings): Use startsWithLettersIgnoringASCIICase.
1527         * xml/parser/XMLDocumentParserLibxml2.cpp:
1528         (WebCore::shouldAllowExternalLoad): Ditto.
1529
1530 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1531
1532         [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
1533         https://bugs.webkit.org/show_bug.cgi?id=179972
1534
1535         Reviewed by Carlos Garcia Campos.
1536
1537         During layer flushes, when a CoordinatedGraphicsLayer's tiled backing store
1538         has dirty tiles that need to be updated, the following chain of calls would
1539         be invoked to perform the painting, starting in
1540         CoordinatedGraphicsLayer::updateContentBuffers():
1541         |- CoordinatedGraphicsLayer::updateContentBuffers()
1542          |- TiledBackingStore::updateTileBuffers()
1543           |- Tile::updateBackBuffer()
1544            |- CoordinatedGraphicsLayer::paintToSurface()
1545             |- CompositingCoordinator::paintToSurface()
1546              |- UpdateAtlas::paintOnAvailableBuffer()
1547               |- ThreadSafeCoordinatedSurface::paintToSurface()
1548                |- Tile::paintToSurfaceContext()
1549                 |- CoordinatedGraphicsLayer::tiledBackingStorePaint()
1550                  |- GraphicsLayer::paintGraphicsLayerContents()
1551
1552         That's a bit much.
1553
1554         In CoordinatedGraphicsLayer::updateContentBuffers(), we now first retrieve
1555         all the dirty layers in our TiledBackingStore. We then iterate through them,
1556         first establishing their ID and then retrieving an available CoordinatedBuffer
1557         that we can use for painting. The CoordinatedBuffer is retrieved through
1558         CompositingCoordinator, which is still caching these buffers via UpdateAtlas
1559         objects.
1560
1561         With a CoordinatedBuffer available, we can then proceed with painting. The
1562         painting context has to be properly set up to paint into the correct area of
1563         the given buffer, and the alpha channel, if necessary, has to be addressed.
1564         After properly positioning and scaling ourselves on the given context, we
1565         can proceed with the GraphicsLayer::paintGraphicsLayerContents() call.
1566
1567         What's left is filling out the missing SurfaceUpdateInfo information which is
1568         then passed to the updateTile() method that properly registers the tile
1569         update we've just performed. The tile itself is marked clean. After the
1570         iteration, we call the didUpdateTileBuffers() method in case any successful
1571         tile update was indeed performed, incrementing the repaint counter.
1572
1573         That's it -- we clipped 8 calls from the call chain. We can now also remove
1574         the CoordinatedBuffer::Client interface, as well as slim down the
1575         TiledBackingStore interface. The Tile class is cleaned up a bit, with methods
1576         shifted into a more sensible order.
1577
1578         No new tests -- no change in functionality.
1579
1580         * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:
1581         * platform/graphics/texmap/coordinated/CoordinatedBuffer.h:
1582         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1583         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
1584         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
1585         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaint): Deleted.
1586         (WebCore::CoordinatedGraphicsLayer::paintToSurface): Deleted.
1587         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1588         * platform/graphics/texmap/coordinated/Tile.cpp:
1589         (WebCore::Tile::ensureTileID):
1590         (WebCore::Tile::isDirty const):
1591         (WebCore::Tile::invalidate):
1592         (WebCore::Tile::markClean):
1593         (WebCore::Tile::updateBackBuffer): Deleted.
1594         (WebCore::Tile::paintToSurfaceContext): Deleted.
1595         * platform/graphics/texmap/coordinated/Tile.h:
1596         (WebCore::Tile::tileID const):
1597         (WebCore::Tile::dirtyRect const):
1598         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1599         (WebCore::TiledBackingStore::dirtyTiles):
1600         (WebCore::TiledBackingStore::updateTileBuffers): Deleted.
1601         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1602         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1603
1604 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1605
1606         [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations
1607         https://bugs.webkit.org/show_bug.cgi?id=179970
1608
1609         Reviewed by Carlos Garcia Campos.
1610
1611         Drop CoordinatedBuffer::painToSurface() in favor of a simpler
1612         GraphicsContext reference getter that returns a reference to the
1613         GraphicsContext object of the internal ImageBuffer.
1614
1615         Remove the ImageBackingSurfaceClient class that only acted as a relay
1616         that enabled a CoordinatedBuffer to draw an image through its context.
1617         Instead, we use the GraphicsContext of the allocated CoordinatedBuffer
1618         to draw the image directly. We still use a rectangle whose size
1619         matches the size of the given Image as the clipping area and as the
1620         source and destination rectangle for the image.
1621
1622         No new tests -- no change in behavior.
1623
1624         * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:
1625         (WebCore::CoordinatedBuffer::context):
1626         (WebCore::CoordinatedBuffer::paintToSurface): Deleted.
1627         * platform/graphics/texmap/coordinated/CoordinatedBuffer.h:
1628         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1629         (WebCore::CoordinatedImageBacking::update):
1630         (WebCore::ImageBackingSurfaceClient::ImageBackingSurfaceClient): Deleted.
1631
1632 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1633
1634         [CoordGraphics] TiledBackingStore: use a reference to the client
1635         https://bugs.webkit.org/show_bug.cgi?id=179969
1636
1637         Reviewed by Carlos Garcia Campos.
1638
1639         TiledBackingStore should keep a C++ reference to the TiledBackingStoreClient
1640         object, and not a pointer. client() method is updated to reflect that, and
1641         uses of this method and the member variable are updated accordingly.
1642
1643         No new tests -- no change in behavior.
1644
1645         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1646         (WebCore::CoordinatedGraphicsLayer::createBackingStore):
1647         * platform/graphics/texmap/coordinated/Tile.cpp:
1648         (WebCore::Tile::~Tile):
1649         (WebCore::Tile::updateBackBuffer):
1650         (WebCore::Tile::paintToSurfaceContext):
1651         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1652         (WebCore::TiledBackingStore::TiledBackingStore):
1653         (WebCore::TiledBackingStore::updateTileBuffers):
1654         (WebCore::TiledBackingStore::createTiles):
1655         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1656         (WebCore::TiledBackingStore::client):
1657
1658 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1659
1660         [CoordGraphics] Early tile buffer update in TiledBackingStore::createTiles() is unnecessary
1661         https://bugs.webkit.org/show_bug.cgi?id=179968
1662
1663         Reviewed by Carlos Garcia Campos.
1664
1665         Under CoordinatedGraphicsLayer::updateContentBuffers(), the TiledBackingStore
1666         object has the createTilesIfNeeded() method invoked, if necessary. This
1667         invokes createTiles(), where the edge tiles are resized if necessary, and
1668         the missing tiles are created. If any of those two cases is fulfilled, the
1669         updateTileBuffers() method is invoked, updating any dirty tiles (i.e. the
1670         ones that were resized or newly-created).
1671
1672         This specific invocation of updateTileBuffers() is not needed since it's the
1673         very next method that's invoked on the TiledBackingStore object by
1674         CoordinatedGraphicsLayer::updateContentBuffers(). It's therefore removed,
1675         and the resizeEdgeTiles() method is changed to not return any value.
1676
1677         No new tests -- no change in behavior.
1678
1679         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1680         (WebCore::TiledBackingStore::createTiles):
1681         (WebCore::TiledBackingStore::resizeEdgeTiles):
1682         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1683
1684 2017-11-23  Antti Koivisto  <antti@apple.com>
1685
1686         RenderBlockFlow::layoutRunsAndFloatsInRange is O(n^2) for runs of inlines without any text
1687         https://bugs.webkit.org/show_bug.cgi?id=179950
1688
1689         Reviewed by Simon Fraser.
1690
1691         It calls createBidiRunsForLine for each line. createBidiRunsForLine traverses past the end of the line until
1692         it finds the end of the current bidi run. If there is no text in the flow, it never finds anything and traverses
1693         the entire flow. This is O(n^2) for the number of renderers in the flow.
1694
1695         Tested by PerformanceTests/Layout/inline-layout-no-text.html
1696
1697         * platform/text/BidiResolver.h:
1698         (WebCore::BidiResolverBase::needsContinuePastEnd const):
1699         (WebCore::BidiResolverBase::needsContinuePastEndInternal const):
1700         (WebCore::DerivedClass>::createBidiRunsForLine):
1701
1702             When past end of line call needsContinuePastEnd() to see if we need to continue searching for the end of the bidi run.
1703
1704         * rendering/InlineIterator.h:
1705         (WebCore::InlineBidiResolver::needsContinuePastEndInternal const):
1706
1707             InlineBidiResolver only returns runs up to the last renderer on the line and can bail out.
1708
1709 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1710
1711         [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
1712         https://bugs.webkit.org/show_bug.cgi?id=179967
1713
1714         Reviewed by Carlos Garcia Campos.
1715
1716         Roll the CoordinatedSurface and ThreadSafeCoordinatedSurface classes
1717         into one CoordinatedBuffer class.
1718
1719         CoordinatedBuffer class mimics CoordinatedSurface in providing the
1720         Client class that allows specifying how the client should paint using a
1721         GraphicsContext object. supportsAlpha() and size() methods are also
1722         present, as well as paintToSurface(). uploadImage() retrieves the
1723         Image that's created from the contained ImageBuffer, allowing the user
1724         to then manually upload the buffer data onto the GPU.
1725
1726         CoordinatedBuffer otherwise serves as a drop-in replacement for the
1727         CoordinatedSurface class, and the remaining changes in the
1728         CoordiantedGraphics code reflect that.
1729
1730         No new tests -- no change in behavior.
1731
1732         * platform/TextureMapper.cmake:
1733         * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp: Added.
1734         (WebCore::CoordinatedBuffer::create):
1735         (WebCore::CoordinatedBuffer::CoordinatedBuffer):
1736         (WebCore::CoordinatedBuffer::paintToSurface):
1737         (WebCore::CoordinatedBuffer::uploadImage):
1738         * platform/graphics/texmap/coordinated/CoordinatedBuffer.h: Added.
1739         (WebCore::CoordinatedBuffer::supportsAlpha const):
1740         (WebCore::CoordinatedBuffer::size const):
1741         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1742         (WebCore::CoordinatedGraphicsLayer::paintToSurface):
1743         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1744         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1745         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1746         (WebCore::CoordinatedImageBacking::update):
1747         (WebCore::CoordinatedImageBacking::releaseSurfaceIfNeeded):
1748         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
1749         * platform/graphics/texmap/coordinated/CoordinatedSurface.cpp: Removed.
1750         * platform/graphics/texmap/coordinated/CoordinatedSurface.h: Removed.
1751         * platform/graphics/texmap/coordinated/Tile.h:
1752         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1753
1754 2017-11-22  Simon Fraser  <simon.fraser@apple.com>
1755
1756         FEComponentTransfer cleanup and optimization
1757         https://bugs.webkit.org/show_bug.cgi?id=179952
1758
1759         Reviewed by Darin Adler.
1760
1761         Change terminology for FEComponentTransfer to be more explicit about the fact
1762         that it's creating and using lookup tables. Use std::array for the lookup tables.
1763         
1764         Use uint8_t instead of unsigned char.
1765         
1766         Avoid confusing arrays for channels in computeLookupTables; just setup the lut for
1767         each channel manually.
1768         
1769         This is about 1.25x faster than before.
1770
1771         * platform/graphics/filters/FEComponentTransfer.cpp:
1772         (WebCore::FEComponentTransfer::computeIdentityTable):
1773         (WebCore::FEComponentTransfer::computeTabularTable):
1774         (WebCore::FEComponentTransfer::computeDiscreteTable):
1775         (WebCore::FEComponentTransfer::computeLinearTable):
1776         (WebCore::FEComponentTransfer::computeGammaTable):
1777         (WebCore::FEComponentTransfer::platformApplySoftware):
1778         (WebCore::FEComponentTransfer::computeLookupTables):
1779         (WebCore::operator<<):
1780         (WebCore::identity): Deleted.
1781         (WebCore::table): Deleted.
1782         (WebCore::discrete): Deleted.
1783         (WebCore::linear): Deleted.
1784         (WebCore::gamma): Deleted.
1785         (WebCore::FEComponentTransfer::getValues): Deleted.
1786         * platform/graphics/filters/FEComponentTransfer.h:
1787         (WebCore::ComponentTransferFunction::ComponentTransferFunction): Deleted.
1788
1789 2017-11-22  Javier Fernandez  <jfernandez@igalia.com>
1790
1791         [css-grid] Refactoring and new namespace with grid related utility functions
1792         https://bugs.webkit.org/show_bug.cgi?id=179633
1793
1794         Reviewed by Darin Adler.
1795
1796         Added a new namespace with several utility functions to share logic
1797         between RenderGrid and GridTrackSizingAlgorithm.
1798
1799         No new tests, since no new functionality is added.
1800
1801         * Sources.txt:
1802         * WebCore.xcodeproj/project.pbxproj:
1803         * rendering/GridLayoutUtils.cpp: Added.
1804         (WebCore::GridLayoutUtils::computeMarginLogicalSizeForChild):
1805         (WebCore::GridLayoutUtils::marginLogicalSizeForChild):
1806         (WebCore::GridLayoutUtils::isOrthogonalChild):
1807         (WebCore::GridLayoutUtils::flowAwareDirectionForChild):
1808         * rendering/GridLayoutUtils.h: Added.
1809         * rendering/GridTrackSizingAlgorithm.cpp:
1810         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild const):
1811         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
1812         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
1813         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
1814         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1815         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
1816         * rendering/RenderGrid.cpp:
1817         (WebCore::RenderGrid::layoutBlock):
1818         (WebCore::RenderGrid::placeItemsOnGrid const):
1819         (WebCore::RenderGrid::layoutPositionedObject):
1820         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching const):
1821         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1822         (WebCore::RenderGrid::isInlineBaselineAlignedChild const):
1823         (WebCore::RenderGrid::firstLineBaseline const):
1824         (WebCore::RenderGrid::columnAxisPositionForChild const):
1825         (WebCore::RenderGrid::rowAxisPositionForChild const):
1826         (WebCore::RenderGrid::columnAxisOffsetForChild const):
1827         (WebCore::RenderGrid::rowAxisOffsetForChild const):
1828         (WebCore::RenderGrid::findChildLogicalPosition const):
1829
1830 2017-11-22  Ali Juma  <ajuma@chromium.org>
1831
1832         Implement VisualViewport API attributes
1833         https://bugs.webkit.org/show_bug.cgi?id=179385
1834
1835         Reviewed by Frédéric Wang.
1836
1837         Add a visualViewport attribute to Window, and implement the VisualViewport
1838         interface (https://wicg.github.io/visual-viewport/#the-visualviewport-interface).
1839
1840         This is behind a newly-added VisualViewportAPI experimental feature flag.
1841
1842         Tests: fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html
1843                fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html
1844                fast/visual-viewport/viewport-dimensions-iframe.html
1845                fast/visual-viewport/viewport-dimensions-under-page-zoom.html
1846                fast/visual-viewport/viewport-dimensions.html
1847
1848         * CMakeLists.txt:
1849         * DerivedSources.cpp:
1850         * DerivedSources.make:
1851         * Sources.txt:
1852         * WebCore.xcodeproj/project.pbxproj:
1853         * bindings/js/WebCoreBuiltinNames.h:
1854         * dom/EventTargetFactory.in:
1855         * page/DOMWindow.cpp:
1856         (WebCore::DOMWindow::~DOMWindow):
1857         (WebCore::DOMWindow::resetDOMWindowProperties):
1858         (WebCore::DOMWindow::visualViewport const):
1859         * page/DOMWindow.h:
1860         * page/DOMWindow.idl:
1861         * page/Settings.yaml:
1862         * page/VisualViewport.cpp: Added.
1863         (WebCore::VisualViewport::VisualViewport):
1864         (WebCore::VisualViewport::eventTargetInterface const):
1865         (WebCore::VisualViewport::scriptExecutionContext const):
1866         (WebCore::getFrameViewAndLayoutIfNonNull):
1867         (WebCore::VisualViewport::offsetLeft const):
1868         (WebCore::VisualViewport::offsetTop const):
1869         (WebCore::VisualViewport::pageLeft const):
1870         (WebCore::VisualViewport::pageTop const):
1871         (WebCore::VisualViewport::width const):
1872         (WebCore::VisualViewport::height const):
1873         (WebCore::VisualViewport::scale const):
1874         * page/VisualViewport.h: Added.
1875         * page/VisualViewport.idl: Added.
1876
1877 2017-11-22  Manuel Rego Casasnovas  <rego@igalia.com>
1878
1879         Available height is wrong for positioned elements with "box-sizing: border-box"
1880         https://bugs.webkit.org/show_bug.cgi?id=178783
1881
1882         Reviewed by Darin Adler.
1883
1884         These methods were returning a wrong value for positioned items
1885         in combination with "box-sizing: border-box".
1886         The problem was that if the height of the element is given
1887         by its offset properties (top and bottom) we don't need to call
1888         adjustContentBoxLogicalHeightForBoxSizing().
1889
1890         Tests: fast/box-sizing/fill-available.html
1891                fast/box-sizing/replaced.html
1892
1893         * rendering/RenderBox.cpp:
1894         (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
1895         (WebCore::RenderBox::availableLogicalHeightUsing const):
1896
1897 2017-11-22  Christopher Reid  <chris.reid@sony.com>
1898
1899         WebCoreObjCExtras.h is being included in too many places
1900         https://bugs.webkit.org/show_bug.cgi?id=179931
1901
1902         Reviewed by Darin Adler.
1903
1904         No new tests no change in behavior.
1905
1906         Fixing cases where WebCoreObjCExtras.h is imported but not used.
1907
1908         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1909         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1910         * platform/mac/WebCoreNSURLExtras.mm:
1911
1912 2017-11-22  Antoine Quint  <graouts@apple.com>
1913
1914         [Web Animations] Adopt KeyframeList in KeyframeEffect
1915         https://bugs.webkit.org/show_bug.cgi?id=179941
1916         <rdar://problem/35666924>
1917
1918         Reviewed by Darin Adler.
1919
1920         KeyframeEffect used to model its keyframes by creating a new Keyframe struct and storing them in a Vector<Keyframe>.
1921         However, there already is a way to model keyframes in WebCore using the KeyframeList class. We now adopt this class
1922         in KeyframeEffect, which makes it possible to run hardware-composited animations using RenderBoxModelObject::startAnimation()
1923         in a follow-up patch, since this function expects a KeyframeList.
1924
1925         No news tests, this is an internals change and does not yield any changes in Web content.
1926
1927         * animation/KeyframeEffect.cpp:
1928         (WebCore::KeyframeEffect::KeyframeEffect): Create a default m_keyframes at construction time.
1929         (WebCore::KeyframeEffect::processKeyframes): Create a temporary KeyframeList as we parse keyframes passed from the JS API
1930         and assign it to m_keyframes upon successful parsing. We also use cssPropertyId to refer to a CSSPropertyID to make the code
1931         clearer and ensure there is no confusion with JS properties that we manipulate in this function.
1932         (WebCore::KeyframeEffect::computeStackingContextImpact): Use the list of CSS properties exposed on KeyframeList directly rather
1933         than enumerating each keyframe and use cssPropertyId to refer to individual CSSPropertyID values for consistency.
1934         (WebCore::KeyframeEffect::applyAtLocalTime): Use the list of CSS properties exposed on KeyframeList directly rather than
1935         using the properties specified on the first keyframe only. We also remove a stale FIXME comment which was addressed in r224957.
1936         * animation/KeyframeEffect.h: Remove the Keyframe struct and change the type of m_keyframes from Vector<Keyframe> to KeyframeList.
1937         * rendering/style/KeyframeList.h:
1938         (WebCore::KeyframeList::KeyframeList): We remove the default insertions at KeyframeList construction time since it requires
1939         an immediate call to clear() when doing any meaningful work with a KeyframeList. We also add the default move assignment operator
1940         to allow KeyframeEffect::processKeyframes() to make a move assignment from the temporary keyframe list we build at parsing to the
1941         member variable.
1942
1943 2017-11-22  Commit Queue  <commit-queue@webkit.org>
1944
1945         Unreviewed, rolling out r225093.
1946         https://bugs.webkit.org/show_bug.cgi?id=179938
1947
1948         Compilation failed on WinCairo 64-bit Release (Requested by
1949         fredw on #webkit).
1950
1951         Reverted changeset:
1952
1953         "Implement VisualViewport API attributes"
1954         https://bugs.webkit.org/show_bug.cgi?id=179385
1955         https://trac.webkit.org/changeset/225093
1956
1957 2017-11-21  Ali Juma  <ajuma@chromium.org>
1958
1959         Implement VisualViewport API attributes
1960         https://bugs.webkit.org/show_bug.cgi?id=179385
1961
1962         Reviewed by Frédéric Wang.
1963
1964         Add a visualViewport attribute to Window, and implement the VisualViewport
1965         interface (https://wicg.github.io/visual-viewport/#the-visualviewport-interface).
1966
1967         This is behind a newly-added VisualViewportAPI experimental feature flag.
1968
1969         Tests: fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html
1970                fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html
1971                fast/visual-viewport/viewport-dimensions-iframe.html
1972                fast/visual-viewport/viewport-dimensions-under-page-zoom.html
1973                fast/visual-viewport/viewport-dimensions.html
1974
1975         * CMakeLists.txt:
1976         * DerivedSources.cpp:
1977         * DerivedSources.make:
1978         * Sources.txt:
1979         * WebCore.xcodeproj/project.pbxproj:
1980         * bindings/js/WebCoreBuiltinNames.h:
1981         * dom/EventTargetFactory.in:
1982         * page/DOMWindow.cpp:
1983         (WebCore::DOMWindow::~DOMWindow):
1984         (WebCore::DOMWindow::resetDOMWindowProperties):
1985         (WebCore::DOMWindow::visualViewport const):
1986         * page/DOMWindow.h:
1987         * page/DOMWindow.idl:
1988         * page/Settings.yaml:
1989         * page/VisualViewport.cpp: Added.
1990         (WebCore::VisualViewport::VisualViewport):
1991         (WebCore::VisualViewport::eventTargetInterface const):
1992         (WebCore::VisualViewport::scriptExecutionContext const):
1993         (WebCore::getFrameViewAndLayoutIfNonNull):
1994         (WebCore::VisualViewport::offsetLeft const):
1995         (WebCore::VisualViewport::offsetTop const):
1996         (WebCore::VisualViewport::pageLeft const):
1997         (WebCore::VisualViewport::pageTop const):
1998         (WebCore::VisualViewport::width const):
1999         (WebCore::VisualViewport::height const):
2000         (WebCore::VisualViewport::scale const):
2001         * page/VisualViewport.h: Added.
2002         * page/VisualViewport.idl: Added.
2003
2004 2017-11-21  Frederic Wang  <fwang@igalia.com>
2005
2006         Async frame scrolling: handle fixed root backgrounds in frames
2007         https://bugs.webkit.org/show_bug.cgi?id=176261
2008
2009         Based on patch by Simon Fraser <simon.fraser@apple.com>
2010         Reviewed by Antonio Gomes.
2011
2012         For frames with tiled backing, we register a slow-repaint object because we hit
2013         RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
2014         view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
2015         ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
2016         called. It also removes the opaque background of non-main frames with tiled backing.
2017         This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.
2018
2019         Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
2020
2021         * rendering/RenderLayerBacking.cpp:
2022         (WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
2023         tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
2024         (WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
2025         return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
2026         repaint object previously registered for this frame. Also add an ASSERT to ensure that a
2027         fixed root background is only set for frames with async scrolling.
2028         (WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
2029         of background and opaqueness to the main frame.
2030
2031 2017-11-21  Zan Dobersek  <zdobersek@igalia.com>
2032
2033         Drop ENABLE_IMAGE_DECODER_DOWN_SAMPLING code
2034         https://bugs.webkit.org/show_bug.cgi?id=179921
2035
2036         Reviewed by Carlos Garcia Campos.
2037
2038         Drop the ENABLE_IMAGE_DECODER_DOWN_SAMPLING code, along with the build
2039         guard definitions in WTF and CMake.
2040
2041         This was apparently in use in the Qt port, but since then no port
2042         enables this. It's not exposed in the Xcode build, and the CMake option
2043         is disabled by default, with no way to enable it through build-webkit.
2044
2045         While the code guarded with this build guard is removed, there's still
2046         code in the ScalableImageDecoder class that only operated when this
2047         feature was enabled. This should be addressed in the future, after
2048         evaluating the need for this scaling capability.
2049
2050         No new tests -- no change in behavior.
2051
2052         * platform/graphics/Image.cpp:
2053         (WebCore::Image::adjustSourceRectForDownSampling const): Deleted.
2054         * platform/graphics/Image.h:
2055         * platform/graphics/cairo/CairoOperations.cpp:
2056         (WebCore::Cairo::drawNativeImage):
2057         * platform/image-decoders/ScalableImageDecoder.h:
2058         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2059         (WebCore::JPEGImageReader::decode):
2060         * platform/image-decoders/png/PNGImageDecoder.cpp:
2061         (WebCore::PNGImageDecoder::rowAvailable):
2062         (WebCore::PNGImageDecoder::frameComplete):
2063
2064 2017-11-21  Commit Queue  <commit-queue@webkit.org>
2065
2066         Unreviewed, rolling out r225089.
2067         https://bugs.webkit.org/show_bug.cgi?id=179937
2068
2069         This patch caused compilation failures (Requested by fredw on
2070         #webkit).
2071
2072         Reverted changeset:
2073
2074         "Async frame scrolling: handle fixed root backgrounds in
2075         frames"
2076         https://bugs.webkit.org/show_bug.cgi?id=176261
2077         https://trac.webkit.org/changeset/225089
2078
2079 2017-11-21  Frederic Wang  <fwang@igalia.com>
2080
2081         Async frame scrolling: handle fixed root backgrounds in frames
2082         https://bugs.webkit.org/show_bug.cgi?id=176261
2083
2084         Based on patch by Simon Fraser <simon.fraser@apple.com>
2085         Reviewed by Antonio Gomes.
2086
2087         For frames with tiled backing, we register a slow-repaint object because we hit
2088         RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
2089         view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
2090         ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
2091         called. It also removes the opaque background of non-main frames with tiled backing.
2092         This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.
2093
2094         Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
2095
2096         * rendering/RenderLayerBacking.cpp:
2097         (WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
2098         tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
2099         (WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
2100         return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
2101         repaint object previously registered for this frame. Also add an ASSERT to ensure that a
2102         fixed root background is only set for frames with async scrolling.
2103         (WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
2104         of background and opaqueness to the main frame.
2105
2106 2017-11-21  Simon Fraser  <simon.fraser@apple.com>
2107
2108         Some FELighting cleanup
2109         https://bugs.webkit.org/show_bug.cgi?id=179924
2110
2111         Reviewed by Sam Weinig.
2112
2113         Make the normal-computation functions const and have them return an IntSize.
2114         Replace bit shifting with multiply by two (compilers know how to do this, folks).
2115
2116         * platform/graphics/filters/FELighting.cpp:
2117         (WebCore::FELighting::LightingData::topLeftNormal const):
2118         (WebCore::FELighting::LightingData::topRowNormal const):
2119         (WebCore::FELighting::LightingData::topRightNormal const):
2120         (WebCore::FELighting::LightingData::leftColumnNormal const):
2121         (WebCore::FELighting::LightingData::interiorNormal const):
2122         (WebCore::FELighting::LightingData::rightColumnNormal const):
2123         (WebCore::FELighting::LightingData::bottomLeftNormal const):
2124         (WebCore::FELighting::LightingData::bottomRowNormal const):
2125         (WebCore::FELighting::LightingData::bottomRightNormal const):
2126         (WebCore::FELighting::inlineSetPixel):
2127         (WebCore::FELighting::setPixel):
2128         (WebCore::FELighting::platformApplyGenericPaint):
2129         (WebCore::FELighting::drawLighting):
2130         (WebCore::FELighting::LightingData::topLeft): Deleted.
2131         (WebCore::FELighting::LightingData::topRow): Deleted.
2132         (WebCore::FELighting::LightingData::topRight): Deleted.
2133         (WebCore::FELighting::LightingData::leftColumn): Deleted.
2134         (WebCore::FELighting::LightingData::interior): Deleted.
2135         (WebCore::FELighting::LightingData::rightColumn): Deleted.
2136         (WebCore::FELighting::LightingData::bottomLeft): Deleted.
2137         (WebCore::FELighting::LightingData::bottomRow): Deleted.
2138         (WebCore::FELighting::LightingData::bottomRight): Deleted.
2139         * platform/graphics/filters/FELighting.h:
2140
2141 2017-11-21  Christopher Reid  <chris.reid@sony.com>
2142
2143         [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras
2144         https://bugs.webkit.org/show_bug.cgi?id=179504
2145
2146         Reviewed by Darin Adler.
2147
2148         No new tests no change in behavior.
2149
2150         Removed WebCoreNSStringExtras.
2151         Replaced calls to string helpers in WebCoreNSStringExtras with calls to WTF::String.
2152         Moved filenameByFixingIllegalCharacters into LoaderNSURLExtras.
2153         Moved preferredBundleLocalizationName into WebKitLegacy.
2154
2155         * PlatformMac.cmake: Removed WebCoreNSStringExtras.mm
2156         * SourcesCocoa.txt: Removed WebCoreNSStringExtras.mm
2157         * WebCore.xcodeproj/project.pbxproj: Removed WebCoreNSStringExtras
2158         * loader/mac/LoaderNSURLExtras.h:
2159         * loader/mac/LoaderNSURLExtras.mm:
2160         * platform/graphics/mac/FontCacheMac.mm:
2161         * platform/mac/PasteboardMac.mm:
2162         * platform/mac/WebCoreNSURLExtras.mm:
2163
2164 2017-11-21  Simon Fraser  <simon.fraser@apple.com>
2165
2166         Use vImage to do alpha premultiplication/unpremultiplication in FilterEffect
2167         https://bugs.webkit.org/show_bug.cgi?id=179928
2168
2169         Reviewed by Tim Horton.
2170
2171         The vImage functions are about twice as fast as the existing code.
2172
2173         * platform/graphics/filters/FilterEffect.cpp:
2174         (WebCore::copyPremultiplyingAlpha):
2175         (WebCore::copyUnpremultiplyingAlpha):
2176         (WebCore::FilterEffect::copyUnmultipliedImage):
2177         (WebCore::FilterEffect::copyPremultipliedImage):
2178
2179 2017-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2180
2181         [GLIB] Test FileMonitorTest.DetectChangeAndThenDelete sometimes crashes
2182         https://bugs.webkit.org/show_bug.cgi?id=179909
2183
2184         Reviewed by Michael Catanzaro.
2185
2186         The problem sems to be that the GFileMonitor is created in the main thread, but destroyed in the WorkQueue
2187         thread. We can create the monitor in the WorkQueue thread and do the monitoring there.
2188
2189         Fixes unit test FileMonitorTest.DetectChangeAndThenDelete.
2190
2191         * platform/glib/FileMonitorGLib.cpp:
2192         (WebCore::FileMonitor::FileMonitor): Create the GFileMonitor in the WorkQueue.
2193         (WebCore::FileMonitor::didChange): No need to dispatch the handler in the WorkQueue, since this is now called in
2194         the WorkQueue.
2195
2196 2017-11-21  Zan Dobersek  <zdobersek@igalia.com>
2197
2198         [Cairo] drawNativeImage(), drawPattern() in CairoOperations should operate directly with cairo_surface_t objects
2199         https://bugs.webkit.org/show_bug.cgi?id=179888
2200
2201         Reviewed by Carlos Garcia Campos.
2202
2203         Cairo::drawNativeImage() should receive a valid cairo_surface_t pointer
2204         and work with that, instead of using a NativeImagePtr. Callers are thus
2205         forced to pass the pointer into the drawNativeImage() call, and the
2206         CairoOperations implementation file drops the need to know about the
2207         NativeImagePtr type alias.
2208
2209         Cairo::drawPattern() now accepts pointer to the cairo_surface_t object,
2210         along with an IntSize object that descibes the surface's size. This way
2211         it's up to the caller to retrieve any valid native image for the current
2212         frame and pass that to the drawPattern() call. The need to use IntSize
2213         here is strange, but we should investigate this later.
2214
2215         No new tests -- no change in behavior.
2216
2217         * platform/graphics/cairo/CairoOperations.cpp:
2218         (WebCore::Cairo::drawNativeImage):
2219         (WebCore::Cairo::drawPattern):
2220         * platform/graphics/cairo/CairoOperations.h: Include the Cairo header.
2221         Also fix forward declaration of Cairo::drawGlyphs().
2222         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2223         (WebCore::GraphicsContext::drawNativeImage):
2224         (WebCore::GraphicsContext::drawPattern):
2225         * platform/graphics/cairo/NativeImageCairo.cpp:
2226         (WebCore::drawNativeImage): Execute operation through GraphicsContext,
2227         kicking into effect any recording that could be done this way.
2228
2229 2017-11-21  Zan Dobersek  <zdobersek@igalia.com>
2230
2231         [Cairo] Gradient::fill() should only operate on PlatformContextCairo
2232         https://bugs.webkit.org/show_bug.cgi?id=179887
2233
2234         Reviewed by Carlos Garcia Campos.
2235
2236         In Gradient::fill(), directly invoke Cairo::save() and Cairo::restore(),
2237         instead of doing so indirectly through GraphicsContext::save() and
2238         GraphicsContext::restore(). The latter pair stashes the internal state
2239         that's managed in GraphicsContext, but that doesn't get modified at all
2240         in this case.
2241
2242         No new tests -- no change in behavior.
2243
2244         * platform/graphics/cairo/GradientCairo.cpp:
2245         (WebCore::Gradient::fill):
2246
2247 2017-11-21  Frederic Wang  <fwang@igalia.com>
2248
2249         Remove unintentionally committed .orig file.
2250         https://bugs.webkit.org/show_bug.cgi?id=174131
2251
2252         Unreviewed, fix previous commit.
2253
2254         * rendering/mathml/RenderMathMLScripts.cpp.orig: Removed.
2255
2256 2017-11-21  Frederic Wang  <fwang@igalia.com>
2257
2258         ASSERTION FAILED: !needsLayout() in WebCore::RenderMathMLScripts::firstLineBaseline
2259         https://bugs.webkit.org/show_bug.cgi?id=174131
2260
2261         Reviewed by Alejandro G. Castro.
2262
2263         RenderMathMLScripts::firstLineBaseline() has an ASSERT at the beginning to ensure that the function
2264         is called after the element was laid out. However, this is not respected by HTML table layout as
2265         RenderBlock::firstLineBaseline() is called for elements in a table cell before they are laid out.
2266         This happens for example for RenderGrid::firstLineBaseline() and probably for other renderers.
2267         Additionally, RenderMathMLScripts::firstLineBaseline() only involves calling firstLineBaseline();
2268         logicalTop() or logicalHeight() on the first child box so it is safe to call it before layout, even
2269         if the return value might be wrong at that time. This patch removes this too restrictive ASSERT for
2270         RenderMathMLScripts, for consistency with other implementations of firstLineBaseline().
2271
2272         Test: mathml/cells-and-scripts-crash.html
2273
2274         * rendering/mathml/RenderMathMLScripts.cpp:
2275         (WebCore::RenderMathMLScripts::firstLineBaseline const): Remove the ASSERT.
2276
2277 2017-11-20  Mario Sanchez Prada  <mario@endlessm.com>
2278
2279         [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager
2280         https://bugs.webkit.org/show_bug.cgi?id=177932
2281
2282         Reviewed by Carlos Garcia Campos.
2283
2284         Implemented setCookie(), getCookies() and deleteCookie() in the Soup
2285         backend, and refactored some utility functions and conversions out of
2286         NetworkStorageSessionSoup into a new CookieSoup.cpp file, so
2287         that we now can convert between SoupCookie* and WebCore::Cookie
2288         easily from anywhere (this is now needed from the UI Process).
2289
2290         * platform/Cookie.h: Add declarations for the new conversions.
2291         * platform/SourcesSoup.txt: Add CookieSoup.cpp.
2292         * platform/network/soup/CookieSoup.cpp: Added.
2293         (WebCore::Cookie::Cookie): New constructor, creates a WebCore::Cookie out of a SoupCookie*.
2294         (WebCore::msToSoupDate): Moved from NetworkStorageSessionSoup.cpp.
2295         (WebCore::Cookie::toSoupCookie): New, based on toSoupCookie() from NetworkStorageSessionSoup.cpp.
2296         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2297         (WebCore::NetworkStorageSession::setCookies): Used the new implicit conversion.
2298         (WebCore::NetworkStorageSession::setCookie): Newly implemented.
2299         (WebCore::NetworkStorageSession::deleteCookie): Newly implemented.
2300         (WebCore::NetworkStorageSession::getCookies): Newly implemented.
2301
2302 2017-11-20  Zalan Bujtas  <zalan@apple.com>
2303
2304         Remove slow repaint object from FrameView when style changes.
2305         https://bugs.webkit.org/show_bug.cgi?id=179871
2306
2307         Reviewed by Antti Koivisto.
2308
2309         The "oldStyleSlowScroll" value does not need to be computed. We already know its value
2310         by checking the HashSet. This code is also unnecessarily complicated and error prone
2311         (could lead to UAF errors by leaving stale renderers in the slow paint list).
2312
2313         Test: fast/repaint/slow-repaint-object-crash.html
2314
2315         * rendering/RenderElement.cpp:
2316         (WebCore::RenderElement::styleWillChange):
2317
2318 2017-11-20  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2319
2320         [WPE] GLContextEGLWPE.cpp:44:96: error: invalid cast from type ‘GLNativeWindowType {aka long long unsigned int}’ to type ‘EGLNativeWindowType {aka unsigned int}
2321         https://bugs.webkit.org/show_bug.cgi?id=179511
2322
2323         Reviewed by Žan Doberšek.
2324
2325         r217208 changed the definition of GLNativeWindowType from EGLNativeWindowType to uint64_t for platform WPE.
2326         This built fine on a 64-bit platform since uint64_t matches the size of a pointer, but fails on 32-bits.
2327
2328         This switches back the definition to EGLNativeWindowType.
2329         And we need to include <EGL/eglplatform.h> first in order to get a definition for EGLNativeWindowType itself.
2330
2331         This commit pretty much reverts the changes r217208 did on platform/graphics/GLContext.h
2332
2333         No new tests, it is a build fix.
2334
2335         * platform/graphics/GLContext.h:
2336
2337 2017-11-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2338
2339         Remove ENABLE_ALLINONE_BUILD option
2340         https://bugs.webkit.org/show_bug.cgi?id=179823
2341
2342         Reviewed by Darin Adler.
2343
2344         * CMakeLists.txt:
2345
2346 2017-11-20  Emilio Cobos Álvarez  <emilio@crisal.io>
2347
2348         Incorrect computed style in pseudo-elements with display: contents
2349         https://bugs.webkit.org/show_bug.cgi?id=179812
2350
2351         Reviewed by Antti Koivisto.
2352
2353         Bug 178513 gave them an anon renderer as the main renderer. Unfortunately, the
2354         style of that box is exposed via getComputedStyle, so that needs to be handled
2355         somehow to return the correct style.
2356
2357         Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
2358
2359         * css/CSSComputedStyleDeclaration.cpp:
2360         (WebCore::ComputedStyleExtractor::styledRenderer const):
2361           Don't return a display: contents pseudo anon box.
2362         * dom/Element.cpp:
2363         (WebCore::Element::hasDisplayContents const):
2364           Just look at the rare data style.
2365         (WebCore::Element::existingComputedStyle const):
2366           Look at the rare data first. This also fixes an inefficiency in the
2367           sense that before then we'd compare the anon box style to the
2368           pseudo-element style during style update, that may be more changes
2369           than needed.
2370         * style/RenderTreeUpdaterGeneratedContent.cpp:
2371         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
2372         * style/StyleTreeResolver.cpp:
2373         (WebCore::Style::TreeResolver::resolvePseudoStyle):
2374           Move the anon box creation to render tree update instead of style
2375           resolution.
2376
2377 2017-11-19  Tim Horton  <timothy_horton@apple.com>
2378
2379         Remove unused TOUCH_ICON_LOADING feature flag
2380         https://bugs.webkit.org/show_bug.cgi?id=179873
2381
2382         Reviewed by Simon Fraser.
2383
2384         * Configurations/FeatureDefines.xcconfig:
2385
2386 2017-11-19  Tim Horton  <timothy_horton@apple.com>
2387
2388         Remove unused LEGACY_VENDOR_PREFIXES feature flag
2389         https://bugs.webkit.org/show_bug.cgi?id=179872
2390
2391         Reviewed by Darin Adler.
2392
2393         * Configurations/FeatureDefines.xcconfig:
2394
2395 2017-11-18  Darin Adler  <darin@apple.com>
2396
2397         Eliminate some cases of double hashing, other related refactoring
2398         https://bugs.webkit.org/show_bug.cgi?id=179867
2399
2400         Reviewed by Sam Weinig.
2401
2402         * Modules/indexeddb/IDBTransaction.cpp:
2403         (WebCore::IDBTransaction::objectStore): Use get instead of find.
2404
2405         * Modules/mediasource/MediaSourceRegistry.cpp:
2406         (WebCore::MediaSourceRegistry::unregisterURL): Use take instead of find/remove.
2407
2408         * accessibility/AXObjectCache.cpp:
2409         (WebCore::AXObjectCache::~AXObjectCache): Call setAXObjectID instead of
2410         using the removeAXID, which doesn't do anything else useful in the destructor.
2411         (WebCore::AXObjectCache::remove): Use take instead of get/remove. Also rearrange
2412         logic to eliminate the removeAXID function.
2413         (WebCore::AXObjectCache::removeAXID): Deleted. This only did two things,
2414         setAXObjectID(0) and remove from m_idsInUse, and was only called in one place
2415         besides the destructor. Clearer to not have this funtion.
2416         (WebCore::AXObjectCache::visiblePositionForTextMarkerData): Use m_idsInUse
2417         directly instead of using a function.
2418
2419         * accessibility/AXObjectCache.h: Deleted removeAXID and isIDinUse.
2420
2421         * dom/Document.cpp:
2422         (WebCore::Document::removedLastRef): Call UserActionElementSet::clear instead
2423         of UserActionElementSet::documentDidRemoveLastRef; new name fo the same function.
2424         (WebCore::Document::updateHoverActiveState): Use a reference when calling
2425         setInActiveChain.
2426
2427         * dom/Element.cpp:
2428         (WebCore::Element::isUserActionElementInActiveChain const): Pass reference
2429         instead of pointer.
2430         (WebCore::Element::isUserActionElementActive const): Ditto.
2431         (WebCore::Element::isUserActionElementFocused const): Ditto.
2432         (WebCore::Element::isUserActionElementHovered const): Ditto.
2433         (WebCore::Element::setActive): Ditto.
2434         (WebCore::Element::setFocus): Ditto.
2435         (WebCore::Element::setHovered): Ditto.
2436         (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer): Ditto.
2437
2438         * dom/GenericEventQueue.cpp:
2439         (WebCore::GenericEventQueue::resume): Removed unneeded speical case for
2440         empty vector.
2441
2442         * dom/ProcessingInstruction.cpp:
2443         (WebCore::ProcessingInstruction::checkStyleSheet): Updated now that
2444         parseAttributes returns an optional instead of using a boolean "OK" out argument.
2445
2446         * dom/SelectorQuery.cpp:
2447         (WebCore::SelectorQueryCache::add): Use get instead of find.
2448
2449         * dom/UserActionElementSet.cpp:
2450         (WebCore::UserActionElementSet::didDetach): Deleted. Moved to class definition and
2451         named clearActiveAndHovered.
2452         (WebCore::UserActionElementSet::clear): Renamed documentDidRemoveLastRef to clear.
2453         (WebCore::UserActionElementSet::hasFlag const): Renamed from hasFlags and also
2454         take reference and enumeration instead of pointer and unsigned. Makes it clearer
2455         this does not allow null and that it works on a single flag, not a set of flags.
2456         (WebCore::UserActionElementSet::clearFlags): Changed argument types to reference
2457         and OptionSet to make it clear this works on a set of flags.
2458         (WebCore::UserActionElementSet::setFlags): Ditto.
2459
2460         * dom/UserActionElementSet.h: Updated for changes above. Also made some name
2461         changes, and used an enum class instead of an enum.
2462
2463         * html/BaseCheckableInputType.cpp:
2464         (WebCore::BaseCheckableInputType::saveFormControlState const): Updated since
2465         FormControlState is now just a vector, not a class.
2466         * html/FileInputType.cpp:
2467         (WebCore::FileInputType::filesFromFormControlState): Ditto.
2468         (WebCore::FileInputType::restoreFormControlState): Removed unneeded check that
2469         valueSize is a multiple of 2. Code will ignore any extra strings at the end, so
2470         there is no need for the validity check.
2471
2472         * html/FormController.cpp:
2473         (WebCore::serializeFormControlStateTo): Made a non-member function since
2474         FormControlState is now just a vector, not a class.
2475         (WebCore::deserializeFormControlState): Ditto. Also return optional instead
2476         of relying on a special failure state.
2477         (WebCore::SavedFormState::deserialize): Updated for above changes.
2478         (WebCore::SavedFormState::serializeTo const): Ditto.
2479         (WebCore::SavedFormState::appendControlState): Use add instead of both find and add
2480         to avoid double hashing.
2481         (WebCore::SavedFormState::takeControlState): Removed unneeded check for empty
2482         hash table and tweaked coding style.
2483         (WebCore::SavedFormState::referencedFilePaths const): Renamed to remove "get".
2484         (WebCore::FormKeyGenerator::formKey): Use ensure instead of find and add.
2485         (WebCore::FormController::formElementsCharacterCount const): Don't call
2486         saveFormControlState for non-text-form-controls since we ignored those values.
2487         (WebCore::FormController::willDeleteForm): Take a reference.
2488         (WebCore::FormController::restoreControlStateFor): Update since FormControlState
2489         is now a vector.
2490         (WebCore::FormController::restoreControlStateIn): Use is/downcast and update
2491         since FormControlState is now a vector.
2492         (WebCore::FormController::referencedFilePaths): Renamed to remove "get".
2493         (WebCore::FormController::registerFormElementWithState):Take a reference.
2494         (WebCore::FormController::unregisterFormElementWithState): Ditto.
2495
2496         * html/FormController.h: Removed FormControlState class since it was just a
2497         Vector<String> with various unneeded features, such as a "failure" state,
2498         and a never-looked-at type of "skip" or "restore". Updated for other changes
2499         above.
2500
2501         * html/HTMLFormControlElementWithState.cpp:
2502         (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Pass reference.
2503         (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Ditto.
2504         * html/HTMLFormControlElementWithState.h: Updated for the above. Also added
2505         support for using is/downcast on this.
2506
2507         * html/HTMLFormElement.cpp:
2508         (WebCore::HTMLFormElement::~HTMLFormElement): Pass reference.
2509
2510         * html/HTMLSelectElement.cpp:
2511         (WebCore::HTMLSelectElement::saveFormControlState const): Use reserveInitialCapacit
2512         and uncheckedAppend.
2513         (WebCore::HTMLSelectElement::restoreFormControlState): Updated since state is now
2514         a vector.
2515         * html/HTMLTextAreaElement.cpp:
2516         (WebCore::HTMLTextAreaElement::saveFormControlState const): Ditto.
2517         * html/HiddenInputType.cpp:
2518         (WebCore::HiddenInputType::saveFormControlState const): Ditto.
2519         * html/InputType.cpp:
2520         (WebCore::InputType::saveFormControlState const): Ditto.
2521
2522         * inspector/agents/InspectorCSSAgent.cpp:
2523         (WebCore::InspectorCSSAgent::forcePseudoState): Use get instead of find/end and got
2524         rid of uneeded special case. In another overload, ue add and remove instead of
2525         a find followed by a set or a remove.
2526         (WebCore::InspectorCSSAgent::asInspectorStyleSheet): Use ensure instead of find/set.
2527         (WebCore::InspectorCSSAgent::didRemoveDOMNode): Use take instead of find/remove.
2528         (WebCore::InspectorCSSAgent::didModifyDOMAttr): Use get instead of find.
2529         * inspector/agents/InspectorCSSAgent.h: Removed unneeded NodeToInspectorStyleSheet
2530         typedef and changed value type to Ref instead of RefPtr.
2531
2532         * inspector/agents/InspectorDOMAgent.cpp:
2533         (WebCore::InspectorDOMAgent::unbind): Use remove instead of contains/remove.
2534         (WebCore::InspectorDOMAgent::nodeForId): Use isValidKey instead of just checking for
2535         0 and use get instead of find.
2536         (WebCore::InspectorDOMAgent::setAttributesAsText): Take out bogus const.
2537         (WebCore::InspectorDOMAgent::moveTo): Ditto.
2538         (WebCore::InspectorDOMAgent::resolveNode): Ditto.
2539         (WebCore::InspectorDOMAgent::isWhitespace): Added FIXME. Use is<Text> instead of
2540         slower nodeType.
2541         * inspector/agents/InspectorDOMAgent.h: Removed bogus const.
2542
2543         * inspector/agents/InspectorLayerTreeAgent.cpp:
2544         (WebCore::InspectorLayerTreeAgent::bind): Use ensure instead of get/set.
2545         (WebCore::InspectorLayerTreeAgent::unbind): Use take instead of find/remove.
2546         (WebCore::InspectorLayerTreeAgent::bindPseudoElement): Use ensure instead of get/set.
2547         (WebCore::InspectorLayerTreeAgent::unbindPseudoElement): Use take instead of
2548         find/remove.
2549
2550         * inspector/agents/InspectorPageAgent.cpp:
2551         (WebCore::InspectorPageAgent::getCookies): Use add instead of contains/add.
2552         (WebCore::InspectorPageAgent::frameDetached): Use take instead of find/remove.
2553         (WebCore::InspectorPageAgent::frameId): Use ensure instead of get/set.
2554         (WebCore::InspectorPageAgent::loaderId): Use ensure instead of get/set.
2555         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin): Got rid of unneeded
2556         local variable.
2557
2558         * loader/cache/CachedResourceLoader.cpp:
2559         (WebCore::CachedResourceLoader::sessionID const): Tweaked coding style and added
2560         a null check for page.
2561         (WebCore::CachedResourceLoader::requestResource): Call page directly on the frame
2562         instead of first getting the main frame. Also use take instead of find/remove.
2563         (WebCore::CachedResourceLoader::removeCachedResource): Rewrite assertion.
2564
2565         * platform/graphics/FontGenericFamilies.cpp:
2566         (WebCore::setGenericFontFamilyForScript): Use remove instead of find/remove.
2567         Simplified the logic a bit in the add case.
2568
2569         * platform/graphics/ca/GraphicsLayerCA.cpp:
2570         (WebCore::GraphicsLayerCA::pauseAnimation): Use add instead of find/add.
2571         Removed code that said "if (action != Remove) action = Pause" since that is a
2572         no-op; there are only two actions, Remove and Pause.
2573
2574         * rendering/RenderThemeMac.mm:
2575         (WebCore::RenderThemeMac::mediaControlsScript): Use makeString instead of StringBuilder.
2576         (WebCore::RenderThemeMac::systemColor const): Rewrote to use ensure instead of add.
2577         Also crunched the code a little.
2578
2579         * testing/Internals.cpp:
2580         (WebCore::Internals::getReferencedFilePaths const): Updated function name.
2581
2582         * xml/parser/XMLDocumentParser.h: Updated for change below.
2583         * xml/parser/XMLDocumentParserLibxml2.cpp:
2584         (WebCore::attributesStartElementNsHandler): Updated to use std::optional instead of
2585         a separate boolean for AttributeParseState.
2586         (WebCore::parseAttributes): Ditto. Also changed the return value to work the same way.
2587
2588 2017-11-19  Sam Weinig  <sam@webkit.org>
2589
2590         Clean up gradient code in preparation for conic gradients
2591         https://bugs.webkit.org/show_bug.cgi?id=179595
2592
2593         Reviewed by Darin Adler.
2594
2595         - Switches Gradient to use a Varient with type specific data structs and makes the 
2596           points / radii immutable.
2597         - Replaces CSSGradientValue::addStops with template function CSSGradientValue::computeStops
2598           which dispatches to a helper adoptor struct which is passed in for gradient type specific
2599           values, rather than switching on type in the function itself. In addition, the function no
2600           longer mutates a Gradient, but rather mutates type specific the data struct (e.g. Linear or
2601           Radial for now).
2602
2603         * css/CSSGradientValue.cpp:
2604         (WebCore::LinearGradientAdaptor::LinearGradientAdaptor):
2605         (WebCore::RadialGradientAdaptor::RadialGradientAdaptor):
2606
2607             Add helper structs for the now templatized CSSGradientValue::computeStops that
2608             implement type specific functionality.
2609
2610         (WebCore::CSSGradientValue::computeStops):
2611         
2612             Renamed from addStops. Now takes a GradientAdaptor wrapper which abstracts out
2613             the gradient type specific functionlity.
2614         
2615         (WebCore::CSSLinearGradientValue::createGradient):
2616         (WebCore::CSSRadialGradientValue::createGradient):
2617         (WebCore::CSSConicGradientValue::createGradient):
2618         
2619             Update to call computeStops and use new Gradient create function. 
2620         
2621         * css/CSSGradientValue.h:
2622         
2623             Update for new signature for computeStops.
2624         
2625         * html/canvas/CanvasGradient.cpp:
2626         (WebCore::CanvasGradient::CanvasGradient):
2627         
2628             Update to use new Gradient create function.
2629         
2630         * inspector/InspectorCanvas.cpp:
2631         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
2632         
2633             Update to get gradient point / radii information from the data accessor.
2634
2635         * platform/graphics/Gradient.cpp:
2636         (WebCore::Gradient::Gradient):
2637         
2638             Update constructors to the new data structs.
2639         
2640         (WebCore::Gradient::type const):
2641         
2642             Add helper to get the type of the varient, need for inspector code.
2643         
2644         (WebCore::Gradient::adjustParametersForTiledDrawing):
2645         (WebCore::Gradient::isZeroSize const):
2646         (WebCore::Gradient::hash const):
2647         
2648             Update to switch on the underlying variant to get data values.
2649         
2650         (WebCore::Gradient::addColorStop):
2651         
2652             Simplify by having one addColorStop call the other.
2653             
2654         (WebCore::Gradient::setSortedColorStops):
2655         
2656             Added. Replaces setStopsSorted. Used now that CSSGradientValue computes and sorts
2657             its color stops before creating the gradient.
2658
2659         * platform/graphics/Gradient.h:
2660         (WebCore::Gradient::create):
2661         
2662             Replace create functions with ones that take data structs.
2663         
2664         (WebCore::Gradient::data const):
2665
2666             Add accessor for the underlying variant.
2667
2668         (WebCore::Gradient::isRadial const): Deleted.
2669         
2670             Replaced by type accessor.
2671         
2672         (WebCore::Gradient::p0 const): Deleted.
2673         (WebCore::Gradient::p1 const): Deleted.
2674         (WebCore::Gradient::setP0): Deleted.
2675         (WebCore::Gradient::setP1): Deleted.
2676         (WebCore::Gradient::startRadius const): Deleted.
2677         (WebCore::Gradient::endRadius const): Deleted.
2678         (WebCore::Gradient::setStartRadius): Deleted.
2679         (WebCore::Gradient::setEndRadius): Deleted.
2680         
2681             Point and radii are now immutable.
2682         
2683         (WebCore::Gradient::setStopsSorted): Deleted.
2684         
2685             Replaced by setSortedColorStops function.
2686         
2687         * platform/graphics/GraphicsContext.cpp:
2688         (WebCore::GraphicsContext::fillRect):
2689         
2690             Pass the GraphicsContext by reference.
2691         
2692         * platform/graphics/cairo/GradientCairo.cpp:
2693         (WebCore::Gradient::createPlatformGradient):
2694
2695             Update to switch on the underlying variant to get data values.
2696
2697         (WebCore::Gradient::fill):
2698         
2699             Pass the GraphicsContext by reference.
2700         
2701         * platform/graphics/cg/GradientCG.cpp:
2702         (WebCore::Gradient::platformDestroy):
2703         
2704             Use nullptr.
2705         
2706         (WebCore::Gradient::fill):
2707         
2708             Pass the GraphicsContext by reference.
2709         
2710         (WebCore::Gradient::paint):
2711
2712             Update to switch on the underlying variant to get data values.
2713
2714         * platform/graphics/cg/GraphicsContextCG.cpp:
2715         (WebCore::GraphicsContext::fillPath):
2716         (WebCore::GraphicsContext::strokePath):
2717         (WebCore::GraphicsContext::fillRect):
2718         (WebCore::GraphicsContext::strokeRect):
2719         
2720             Pass the GraphicsContext by reference.
2721         
2722         * platform/graphics/win/GradientDirect2D.cpp:
2723         (WebCore::Gradient::generateGradient):
2724
2725             Update to switch on the underlying variant to get data values.
2726         
2727         (WebCore::Gradient::fill):
2728     
2729             Pass the GraphicsContext by reference.
2730         
2731         * rendering/RenderThemeIOS.mm:
2732         (WebCore::RenderThemeIOS::paintProgressBar):
2733         * rendering/svg/RenderSVGResourceLinearGradient.cpp:
2734         (WebCore::RenderSVGResourceLinearGradient::buildGradient const):
2735         * rendering/svg/RenderSVGResourceRadialGradient.cpp:
2736         (WebCore::RenderSVGResourceRadialGradient::buildGradient const):
2737         
2738             Update for new Gradient create function signature.
2739
2740 2017-11-19  Simon Fraser  <simon.fraser@apple.com>
2741
2742         Use TypedArrayView's setRange() in FETurbulence
2743         https://bugs.webkit.org/show_bug.cgi?id=179878
2744
2745         Reviewed by Sam Weinig.
2746
2747         Writing the 4 component values at once makes the function about 10% faster.
2748
2749         * platform/graphics/filters/FETurbulence.cpp:
2750         (WebCore::FETurbulence::fillRegion const):
2751
2752 2017-11-18  Chris Dumez  <cdumez@apple.com>
2753
2754         ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
2755         https://bugs.webkit.org/show_bug.cgi?id=179846
2756
2757         Reviewed by Darin Adler.
2758
2759         We have seen crashes on the bots in SWServerJobQueue because methods such as scriptContextStarted()
2760         can get called after the jobQueue has been cleared. This is because when a jobQueue is cleared,
2761         an asynchronous operation may be pending (e.g. script fetch, service worker starting, install event).
2762
2763         To address the issue, we now pass the identifier of the job that started the asynchronous operation
2764         when calling the methods on SWServerJobQueue. If the identifier does not match the identifier of
2765         the current job in the JobQueue, we ignore it.
2766
2767         This patch also starts using a strongly typed identifier (ServiceWorkerJobIdentifier) for
2768         ServiceWorkerJob, instead of a uint64_t. It also introduces a ServiceWorkerJobDataIdentifier type
2769         which contains both a SWServerConnectionIdentifier and a ServiceWorkerJobIdentifier. This is useful
2770         because ServiceWorkerJobData is passed to the StorageProcess and it needs a globally unique identifier.
2771         ServiceWorkerJobIdentifier is only guaranteed to be unique within a single WebProcess. Augmenting it
2772         with the SWServerConnectionIdentifier of the WebProcess makes it globally unique.
2773
2774         No new tests, unskipped exiting test.
2775
2776         * WebCore.xcodeproj/project.pbxproj:
2777         * workers/service/ServiceWorkerContainer.cpp:
2778         (WebCore::ServiceWorkerContainer::scheduleJob):
2779         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2780         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2781         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2782         (WebCore::ServiceWorkerContainer::jobDidFinish):
2783         * workers/service/ServiceWorkerContainer.h:
2784         * workers/service/ServiceWorkerContextData.cpp:
2785         (WebCore::ServiceWorkerContextData::isolatedCopy const):
2786         * workers/service/ServiceWorkerContextData.h:
2787         (WebCore::ServiceWorkerContextData::encode const):
2788         (WebCore::ServiceWorkerContextData::decode):
2789         * workers/service/ServiceWorkerFetchResult.h:
2790         (WebCore::ServiceWorkerFetchResult::encode const):
2791         (WebCore::ServiceWorkerFetchResult::decode):
2792         * workers/service/ServiceWorkerJob.h:
2793         (WebCore::ServiceWorkerJob::identifier const):
2794         * workers/service/ServiceWorkerJobData.cpp:
2795         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
2796         (WebCore::ServiceWorkerJobData::isolatedCopy const):
2797         * workers/service/ServiceWorkerJobData.h:
2798         (WebCore::ServiceWorkerJobData::connectionIdentifier const):
2799         (WebCore::ServiceWorkerJobData::identifier const):
2800         (WebCore::ServiceWorkerJobData::encode const):
2801         (WebCore::ServiceWorkerJobData::decode):
2802         * workers/service/ServiceWorkerJobDataIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerFetchResult.h.
2803         (WebCore::ServiceWorkerJobDataIdentifier::operator== const):
2804         (WebCore::ServiceWorkerJobDataIdentifier::loggingString const):
2805         (WebCore::ServiceWorkerJobDataIdentifier::encode const):
2806         (WebCore::ServiceWorkerJobDataIdentifier::decode):
2807         * workers/service/ServiceWorkerTypes.h:
2808         * workers/service/context/SWContextManager.cpp:
2809         (WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
2810         * workers/service/context/SWContextManager.h:
2811         * workers/service/context/ServiceWorkerThread.cpp:
2812         (WebCore::ServiceWorkerThread::fireInstallEvent):
2813         * workers/service/server/SWClientConnection.cpp:
2814         (WebCore::SWClientConnection::scheduleJob):
2815         (WebCore::SWClientConnection::finishedFetchingScript):
2816         (WebCore::SWClientConnection::failedFetchingScript):
2817         (WebCore::SWClientConnection::jobRejectedInServer):
2818         (WebCore::SWClientConnection::registrationJobResolvedInServer):
2819         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
2820         (WebCore::SWClientConnection::startScriptFetchForServer):
2821         * workers/service/server/SWClientConnection.h:
2822         * workers/service/server/SWServer.cpp:
2823         (WebCore::SWServer::Connection::scheduleJobInServer):
2824         (WebCore::SWServer::rejectJob):
2825         (WebCore::SWServer::resolveRegistrationJob):
2826         (WebCore::SWServer::startScriptFetch):
2827         (WebCore::SWServer::scriptFetchFinished):
2828         (WebCore::SWServer::scriptContextFailedToStart):
2829         (WebCore::SWServer::scriptContextStarted):
2830         (WebCore::SWServer::didFinishInstall):
2831         (WebCore::SWServer::updateWorker):
2832         * workers/service/server/SWServer.h:
2833         * workers/service/server/SWServerJobQueue.cpp:
2834         (WebCore::SWServerJobQueue::isCurrentlyProcessingJob const):
2835         (WebCore::SWServerJobQueue::scriptFetchFinished):
2836         (WebCore::SWServerJobQueue::scriptContextFailedToStart):
2837         (WebCore::SWServerJobQueue::scriptContextStarted):
2838         (WebCore::SWServerJobQueue::didFinishInstall):
2839         * workers/service/server/SWServerJobQueue.h:
2840         * workers/service/server/SWServerToContextConnection.cpp:
2841         (WebCore::SWServerToContextConnection::scriptContextFailedToStart):
2842         (WebCore::SWServerToContextConnection::scriptContextStarted):
2843         (WebCore::SWServerToContextConnection::didFinishInstall):
2844         * workers/service/server/SWServerToContextConnection.h:
2845         * workers/service/server/SWServerWorker.cpp:
2846         (WebCore::SWServerWorker::scriptContextFailedToStart):
2847         (WebCore::SWServerWorker::scriptContextStarted):
2848         (WebCore::SWServerWorker::didFinishInstall):
2849         * workers/service/server/SWServerWorker.h:
2850
2851 2017-11-18  Nan Wang  <n_wang@apple.com>
2852
2853         AX: AOM: Implement number type properties
2854         https://bugs.webkit.org/show_bug.cgi?id=179497
2855
2856         Reviewed by Chris Fleizach.
2857
2858         Accessibility Object Model
2859         Explainer: https://wicg.github.io/aom/explainer.html
2860         Spec: https://wicg.github.io/aom/spec/
2861
2862         Implemented the number type properties for Accessibility Object Modal.
2863
2864         Test: accessibility/mac/AOM-number-properties.html
2865
2866         * accessibility/AXObjectCache.cpp:
2867         (WebCore::isNodeAriaVisible):
2868         * accessibility/AccessibilityARIAGrid.cpp:
2869         (WebCore::AccessibilityARIAGrid::isMultiSelectable const):
2870         * accessibility/AccessibilityARIAGridCell.cpp:
2871         (WebCore::AccessibilityARIAGridCell::rowIndexRange const):
2872         (WebCore::AccessibilityARIAGridCell::axRowSpanWithRowIndex const):
2873         (WebCore::AccessibilityARIAGridCell::columnIndexRange const):
2874         (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex const): Deleted.
2875         * accessibility/AccessibilityARIAGridCell.h:
2876         * accessibility/AccessibilityNodeObject.cpp:
2877         (WebCore::AccessibilityNodeObject::isEnabled const):
2878         (WebCore::AccessibilityNodeObject::isMultiSelectable const):
2879         (WebCore::AccessibilityNodeObject::isRequired const):
2880         (WebCore::AccessibilityNodeObject::headingLevel const):
2881         (WebCore::AccessibilityNodeObject::valueForRange const):
2882         (WebCore::AccessibilityNodeObject::maxValueForRange const):
2883         (WebCore::AccessibilityNodeObject::minValueForRange const):
2884         (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
2885         * accessibility/AccessibilityObject.cpp:
2886         (WebCore::AccessibilityObject::intValueForProperty const):
2887         (WebCore::AccessibilityObject::unsignedValueForProperty const):
2888         (WebCore::AccessibilityObject::doubleValueForProperty const):
2889         (WebCore::AccessibilityObject::supportsSetSize const):
2890         (WebCore::AccessibilityObject::supportsPosInSet const):
2891         (WebCore::AccessibilityObject::setSize const):
2892         (WebCore::AccessibilityObject::posInSet const):
2893         (WebCore::AccessibilityObject::supportsARIASetSize const): Deleted.
2894         (WebCore::AccessibilityObject::supportsARIAPosInSet const): Deleted.
2895         (WebCore::AccessibilityObject::ariaSetSize const): Deleted.
2896         (WebCore::AccessibilityObject::ariaPosInSet const): Deleted.
2897         * accessibility/AccessibilityObject.h:
2898         * accessibility/AccessibilityRenderObject.cpp:
2899         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
2900         (WebCore::AccessibilityRenderObject::liveRegionAtomic const):
2901         * accessibility/AccessibilityTable.cpp:
2902         (WebCore::AccessibilityTable::isDataTable const):
2903         (WebCore::AccessibilityTable::axColumnCount const):
2904         (WebCore::AccessibilityTable::axRowCount const):
2905         (WebCore::AccessibilityTable::ariaColumnCount const): Deleted.
2906         (WebCore::AccessibilityTable::ariaRowCount const): Deleted.
2907         * accessibility/AccessibilityTable.h:
2908         * accessibility/AccessibilityTableCell.cpp:
2909         (WebCore::AccessibilityTableCell::AccessibilityTableCell):
2910         (WebCore::AccessibilityTableCell::rowIndexRange const):
2911         (WebCore::AccessibilityTableCell::columnIndexRange const):
2912         (WebCore::AccessibilityTableCell::axColumnIndex const):
2913         (WebCore::AccessibilityTableCell::axRowIndex const):
2914         (WebCore::AccessibilityTableCell::axColumnSpan const):
2915         (WebCore::AccessibilityTableCell::axRowSpan const):
2916         (WebCore::AccessibilityTableCell::ariaColumnIndex const): Deleted.
2917         (WebCore::AccessibilityTableCell::ariaRowIndex const): Deleted.
2918         (WebCore::AccessibilityTableCell::ariaColumnSpan const): Deleted.
2919         (WebCore::AccessibilityTableCell::ariaRowSpan const): Deleted.
2920         * accessibility/AccessibilityTableCell.h:
2921         (WebCore::AccessibilityTableCell::setAXColIndexFromRow):
2922         (WebCore::AccessibilityTableCell::setARIAColIndexFromRow): Deleted.
2923         * accessibility/AccessibilityTableRow.cpp:
2924         (WebCore::AccessibilityTableRow::addChildren):
2925         (WebCore::AccessibilityTableRow::axColumnIndex const):
2926         (WebCore::AccessibilityTableRow::axRowIndex const):
2927         (WebCore::AccessibilityTableRow::ariaColumnIndex const): Deleted.
2928         (WebCore::AccessibilityTableRow::ariaRowIndex const): Deleted.
2929         * accessibility/AccessibilityTableRow.h:
2930         * accessibility/AccessibleNode.cpp:
2931         (WebCore::ariaAttributeMap):
2932         (WebCore::isPropertyValueInt):
2933         (WebCore::isPropertyValueUnsigned):
2934         (WebCore::isPropertyValueFloat):
2935         (WebCore::AccessibleNode::setProperty):
2936         (WebCore::AccessibleNode::setOptionalProperty):
2937         (WebCore::AccessibleNode::setStringProperty):
2938         (WebCore::AccessibleNode::optionalValueForProperty):
2939         (WebCore::AccessibleNode::effectiveBoolValueForElement):
2940         (WebCore::AccessibleNode::effectiveIntValueForElement):
2941         (WebCore::AccessibleNode::effectiveUnsignedValueForElement):
2942         (WebCore::AccessibleNode::effectiveDoubleValueForElement):
2943         (WebCore::AccessibleNode::atomic const):
2944         (WebCore::AccessibleNode::setAtomic):
2945         (WebCore::AccessibleNode::setAutocomplete):
2946         (WebCore::AccessibleNode::busy const):
2947         (WebCore::AccessibleNode::setBusy):
2948         (WebCore::AccessibleNode::setChecked):
2949         (WebCore::AccessibleNode::colCount const):
2950         (WebCore::AccessibleNode::setColCount):
2951         (WebCore::AccessibleNode::colIndex const):
2952         (WebCore::AccessibleNode::setColIndex):
2953         (WebCore::AccessibleNode::colSpan const):
2954         (WebCore::AccessibleNode::setColSpan):
2955         (WebCore::AccessibleNode::setCurrent):
2956         (WebCore::AccessibleNode::disabled const):
2957         (WebCore::AccessibleNode::setDisabled):
2958         (WebCore::AccessibleNode::expanded const):
2959         (WebCore::AccessibleNode::setExpanded):
2960         (WebCore::AccessibleNode::setHasPopUp):
2961         (WebCore::AccessibleNode::hidden const):
2962         (WebCore::AccessibleNode::setHidden):
2963         (WebCore::AccessibleNode::setInvalid):
2964         (WebCore::AccessibleNode::setKeyShortcuts):
2965         (WebCore::AccessibleNode::label const):
2966         (WebCore::AccessibleNode::setLabel):
2967         (WebCore::AccessibleNode::level const):
2968         (WebCore::AccessibleNode::setLevel):
2969         (WebCore::AccessibleNode::live const):
2970         (WebCore::AccessibleNode::setLive):
2971         (WebCore::AccessibleNode::modal const):
2972         (WebCore::AccessibleNode::setModal):
2973         (WebCore::AccessibleNode::multiline const):
2974         (WebCore::AccessibleNode::setMultiline):
2975         (WebCore::AccessibleNode::multiselectable const):
2976         (WebCore::AccessibleNode::setMultiselectable):
2977         (WebCore::AccessibleNode::setOrientation):
2978         (WebCore::AccessibleNode::setPlaceholder):
2979         (WebCore::AccessibleNode::posInSet const):
2980         (WebCore::AccessibleNode::setPosInSet):
2981         (WebCore::AccessibleNode::setPressed):
2982         (WebCore::AccessibleNode::readOnly const):
2983         (WebCore::AccessibleNode::setReadOnly):
2984         (WebCore::AccessibleNode::setRelevant):
2985         (WebCore::AccessibleNode::required const):
2986         (WebCore::AccessibleNode::setRequired):
2987         (WebCore::AccessibleNode::setRole):
2988         (WebCore::AccessibleNode::setRoleDescription):
2989         (WebCore::AccessibleNode::rowCount const):
2990         (WebCore::AccessibleNode::setRowCount):
2991         (WebCore::AccessibleNode::rowIndex const):
2992         (WebCore::AccessibleNode::setRowIndex):
2993         (WebCore::AccessibleNode::rowSpan const):
2994         (WebCore::AccessibleNode::setRowSpan):
2995         (WebCore::AccessibleNode::selected const):
2996         (WebCore::AccessibleNode::setSelected):
2997         (WebCore::AccessibleNode::setSize const):
2998         (WebCore::AccessibleNode::setSetSize):
2999         (WebCore::AccessibleNode::setSort):
3000         (WebCore::AccessibleNode::valueMax const):
3001         (WebCore::AccessibleNode::setValueMax):
3002         (WebCore::AccessibleNode::valueMin const):
3003         (WebCore::AccessibleNode::setValueMin):
3004         (WebCore::AccessibleNode::valueNow const):
3005         (WebCore::AccessibleNode::setValueNow):
3006         (WebCore::AccessibleNode::setValueText):
3007         (WebCore::AccessibleNode::boolValueForProperty): Deleted.
3008         (WebCore::AccessibleNode::setBoolProperty): Deleted.
3009         * accessibility/AccessibleNode.h:
3010         * accessibility/AccessibleNode.idl:
3011         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
3012         (webkitAccessibleTableGetNColumns):
3013         (webkitAccessibleTableGetNRows):
3014         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
3015         (webkitAccessibleTableCellGetPosition):
3016         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3017         (webkitAccessibleGetAttributes):
3018         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3019         (-[WebAccessibilityObjectWrapper accessibilityARIARowCount]):
3020         (-[WebAccessibilityObjectWrapper accessibilityARIAColumnCount]):
3021         (-[WebAccessibilityObjectWrapper accessibilityARIARowIndex]):
3022         (-[WebAccessibilityObjectWrapper accessibilityARIAColumnIndex]):
3023         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3024         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
3025         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3026
3027 2017-11-18  Tim Horton  <timothy_horton@apple.com>
3028
3029         Fix typos in closing ENABLE() comments
3030         https://bugs.webkit.org/show_bug.cgi?id=179869
3031
3032         Unreviewed.
3033
3034         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
3035         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
3036
3037 2017-11-18  Maciej Stachowiak  <mjs@apple.com>
3038
3039         Remove TEC support and all TEC-only encodings except EUC-TW (which now uses ICU)
3040         https://bugs.webkit.org/show_bug.cgi?id=179582
3041
3042         Reviewed by Darin Adler.
3043
3044         Already covered by fast/encoding/legacy-tec-encodings.html
3045
3046         * platform/text/TextCodecICU.cpp: Add support for EUC-TW.
3047
3048         Remove all vestiges of TEC text codec and its related autogeneration scripts.
3049         
3050         * DerivedSources.make:
3051         * PlatformMac.cmake:
3052         * SourcesMac.txt:
3053         * WebCore.order:
3054         * WebCore.xcodeproj/project.pbxproj:
3055         * platform/ThreadGlobalData.cpp:
3056         (WebCore::ThreadGlobalData::ThreadGlobalData): No more cached TEC decoder.
3057         (WebCore::ThreadGlobalData::destroy): ditto
3058         * platform/ThreadGlobalData.h:
3059         (WebCore::ThreadGlobalData::ThreadGlobalData::cachedConverterTEC): Deleted.
3060         * platform/text/TextEncodingRegistry.cpp:
3061         (WebCore::extendTextCodecMaps): Don't add TEC decoders on MAc.
3062         * platform/text/mac/CharsetData.h: Removed.
3063         * platform/text/mac/TextCodecMac.cpp: Removed.
3064         * platform/text/mac/TextCodecMac.h: Removed.
3065         * platform/text/mac/character-sets.txt: Removed.
3066         * platform/text/mac/ios-encodings.txt: Removed.
3067         * platform/text/mac/mac-encodings.txt: Removed.
3068         * platform/text/mac/make-charset-table.pl: Removed.
3069
3070 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
3071
3072         Mechanical cleanup of FE* files
3073         https://bugs.webkit.org/show_bug.cgi?id=179868
3074
3075         Reviewed by Wenson Hsieh.
3076
3077         Remove unused dump() functions.
3078         Make overridden member functions in derived classes private.
3079         Make simple getters inline.
3080         
3081         Move common FESpecularLighting and FEDiffuseLighting functions into the 
3082         FELighting base class.
3083
3084         * platform/graphics/filters/FEBlend.cpp:
3085         (WebCore::FEBlend::blendMode const): Deleted.
3086         (WebCore::FEBlend::dump): Deleted.
3087         * platform/graphics/filters/FEBlend.h:
3088         (WebCore::FEBlend::blendMode const):
3089         * platform/graphics/filters/FEColorMatrix.cpp:
3090         (WebCore::FEColorMatrix::type const): Deleted.
3091         (WebCore::FEColorMatrix::values const): Deleted.
3092         (WebCore::FEColorMatrix::dump): Deleted.
3093         * platform/graphics/filters/FEColorMatrix.h:
3094         (WebCore::FEColorMatrix::type const):
3095         (WebCore::FEColorMatrix::values const):
3096         * platform/graphics/filters/FEComponentTransfer.cpp:
3097         (WebCore::FEComponentTransfer::redFunction const): Deleted.
3098         (WebCore::FEComponentTransfer::greenFunction const): Deleted.
3099         (WebCore::FEComponentTransfer::blueFunction const): Deleted.
3100         (WebCore::FEComponentTransfer::alphaFunction const): Deleted.
3101         (WebCore::FEComponentTransfer::dump): Deleted.
3102         * platform/graphics/filters/FEComponentTransfer.h:
3103         (WebCore::FEComponentTransfer::redFunction const):
3104         (WebCore::FEComponentTransfer::greenFunction const):
3105         (WebCore::FEComponentTransfer::blueFunction const):
3106         (WebCore::FEComponentTransfer::alphaFunction const):
3107         * platform/graphics/filters/FEComposite.cpp:
3108         (WebCore::FEComposite::operation const): Deleted.
3109         (WebCore::FEComposite::k1 const): Deleted.
3110         (WebCore::FEComposite::k2 const): Deleted.
3111         (WebCore::FEComposite::k3 const): Deleted.
3112         (WebCore::FEComposite::k4 const): Deleted.
3113         (WebCore::FEComposite::dump): Deleted.
3114         * platform/graphics/filters/FEComposite.h:
3115         (WebCore::FEComposite::operation const):
3116         (WebCore::FEComposite::k1 const):
3117         (WebCore::FEComposite::k2 const):
3118         (WebCore::FEComposite::k3 const):
3119         (WebCore::FEComposite::k4 const):
3120         * platform/graphics/filters/FEConvolveMatrix.cpp:
3121         (WebCore::FEConvolveMatrix::kernelSize const): Deleted.
3122         (WebCore::FEConvolveMatrix::kernel const): Deleted.
3123         (WebCore::FEConvolveMatrix::divisor const): Deleted.
3124         (WebCore::FEConvolveMatrix::bias const): Deleted.
3125         (WebCore::FEConvolveMatrix::targetOffset const): Deleted.
3126         (WebCore::FEConvolveMatrix::edgeMode const): Deleted.
3127         (WebCore::FEConvolveMatrix::kernelUnitLength const): Deleted.
3128         (WebCore::FEConvolveMatrix::preserveAlpha const): Deleted.
3129         (WebCore::FEConvolveMatrix::dump): Deleted.
3130         * platform/graphics/filters/FEConvolveMatrix.h:
3131         (WebCore::FEConvolveMatrix::kernelSize const):
3132         (WebCore::FEConvolveMatrix::kernel const):
3133         (WebCore::FEConvolveMatrix::divisor const):
3134         (WebCore::FEConvolveMatrix::bias const):
3135         (WebCore::FEConvolveMatrix::targetOffset const):
3136         (WebCore::FEConvolveMatrix::edgeMode const):
3137         (WebCore::FEConvolveMatrix::kernelUnitLength const):
3138         (WebCore::FEConvolveMatrix::preserveAlpha const):
3139         * platform/graphics/filters/FEDiffuseLighting.cpp:
3140         (WebCore::FEDiffuseLighting::lightingColor const): Deleted.
3141         (WebCore::FEDiffuseLighting::setLightingColor): Deleted.
3142         (WebCore::FEDiffuseLighting::surfaceScale const): Deleted.
3143         (WebCore::FEDiffuseLighting::setSurfaceScale): Deleted.
3144         (WebCore::FEDiffuseLighting::diffuseConstant const): Deleted.
3145         (WebCore::FEDiffuseLighting::kernelUnitLengthX const): Deleted.
3146         (WebCore::FEDiffuseLighting::setKernelUnitLengthX): Deleted.
3147         (WebCore::FEDiffuseLighting::kernelUnitLengthY const): Deleted.
3148         (WebCore::FEDiffuseLighting::setKernelUnitLengthY): Deleted.
3149         (WebCore::FEDiffuseLighting::lightSource const): Deleted.
3150         (WebCore::FEDiffuseLighting::dump): Deleted.
3151         * platform/graphics/filters/FEDiffuseLighting.h:
3152         (WebCore::FEDiffuseLighting::diffuseConstant const):
3153         * platform/graphics/filters/FEDisplacementMap.cpp:
3154         (WebCore::FEDisplacementMap::xChannelSelector const): Deleted.
3155         (WebCore::FEDisplacementMap::yChannelSelector const): Deleted.
3156         (WebCore::FEDisplacementMap::scale const): Deleted.
3157         (WebCore::FEDisplacementMap::dump): Deleted.
3158         * platform/graphics/filters/FEDisplacementMap.h:
3159         (WebCore::FEDisplacementMap::xChannelSelector const):
3160         (WebCore::FEDisplacementMap::yChannelSelector const):
3161         (WebCore::FEDisplacementMap::scale const):
3162         * platform/graphics/filters/FEDropShadow.cpp:
3163         (WebCore::FEDropShadow::dump): Deleted.
3164         * platform/graphics/filters/FEDropShadow.h:
3165         * platform/graphics/filters/FEFlood.cpp:
3166         (WebCore::FEFlood::floodColor const): Deleted.
3167         (WebCore::FEFlood::floodOpacity const): Deleted.
3168         (WebCore::FEFlood::dump): Deleted.
3169         * platform/graphics/filters/FEFlood.h:
3170         (WebCore::FEFlood::floodColor const):
3171         (WebCore::FEFlood::floodOpacity const):
3172         * platform/graphics/filters/FEGaussianBlur.cpp:
3173         (WebCore::FEGaussianBlur::stdDeviationX const): Deleted.
3174         (WebCore::FEGaussianBlur::stdDeviationY const): Deleted.
3175         (WebCore::FEGaussianBlur::edgeMode const): Deleted.
3176         (WebCore::FEGaussianBlur::dump): Deleted.
3177         * platform/graphics/filters/FEGaussianBlur.h:
3178         (WebCore::FEGaussianBlur::stdDeviationX const):
3179         (WebCore::FEGaussianBlur::stdDeviationY const):
3180         (WebCore::FEGaussianBlur::edgeMode const):
3181         * platform/graphics/filters/FELighting.cpp:
3182         (WebCore::FELighting::setSurfaceScale):
3183         (WebCore::FELighting::setLightingColor):
3184         (WebCore::FELighting::setKernelUnitLengthX):
3185         (WebCore::FELighting::setKernelUnitLengthY):
3186         * platform/graphics/filters/FELighting.h:
3187         (WebCore::FELighting::surfaceScale const):
3188         (WebCore::FELighting::lightingColor const):
3189         (WebCore::FELighting::kernelUnitLengthX const):
3190         (WebCore::FELighting::kernelUnitLengthY const):
3191         (WebCore::FELighting::lightSource const):
3192         * platform/graphics/filters/FEMerge.cpp:
3193         (WebCore::FEMerge::dump): Deleted.
3194         * platform/graphics/filters/FEMerge.h:
3195         * platform/graphics/filters/FEMorphology.cpp:
3196         (WebCore::FEMorphology::dump): Deleted.
3197         * platform/graphics/filters/FEMorphology.h:
3198         * platform/graphics/filters/FEOffset.cpp:
3199         (WebCore::FEOffset::dx const): Deleted.
3200         (WebCore::FEOffset::dy const): Deleted.
3201         (WebCore::FEOffset::dump): Deleted.
3202         * platform/graphics/filters/FEOffset.h:
3203         (WebCore::FEOffset::dx const):
3204         (WebCore::FEOffset::dy const):
3205         * platform/graphics/filters/FESpecularLighting.cpp:
3206         (WebCore::FESpecularLighting::lightingColor const): Deleted.
3207         (WebCore::FESpecularLighting::setLightingColor): Deleted.
3208         (WebCore::FESpecularLighting::surfaceScale const): Deleted.
3209         (WebCore::FESpecularLighting::setSurfaceScale): Deleted.
3210         (WebCore::FESpecularLighting::specularConstant const): Deleted.
3211         (WebCore::FESpecularLighting::specularExponent const): Deleted.
3212         (WebCore::FESpecularLighting::kernelUnitLengthX const): Deleted.
3213         (WebCore::FESpecularLighting::setKernelUnitLengthX): Deleted.
3214         (WebCore::FESpecularLighting::kernelUnitLengthY const): Deleted.
3215         (WebCore::FESpecularLighting::setKernelUnitLengthY): Deleted.
3216         (WebCore::FESpecularLighting::lightSource const): Deleted.
3217         (WebCore::FESpecularLighting::dump): Deleted.
3218         * platform/graphics/filters/FESpecularLighting.h:
3219         (WebCore::FESpecularLighting::specularConstant const):
3220         (WebCore::FESpecularLighting::specularExponent const):
3221         * platform/graphics/filters/FETile.cpp:
3222         (WebCore::FETile::dump): Deleted.
3223         * platform/graphics/filters/FETile.h:
3224         * platform/graphics/filters/FETurbulence.cpp:
3225         (WebCore::FETurbulence::dump): Deleted.
3226         * platform/graphics/filters/FETurbulence.h:
3227         * platform/graphics/filters/FilterEffect.h:
3228         * platform/graphics/filters/SourceAlpha.cpp:
3229         (WebCore::SourceAlpha::dump): Deleted.
3230         * platform/graphics/filters/SourceAlpha.h:
3231         * platform/graphics/filters/SourceGraphic.cpp:
3232         (WebCore::SourceGraphic::dump): Deleted.
3233         * platform/graphics/filters/SourceGraphic.h:
3234         * svg/graphics/filters/SVGFEImage.cpp:
3235         (WebCore::FEImage::dump): Deleted.
3236         * svg/graphics/filters/SVGFEImage.h:
3237
3238 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
3239
3240         Attempt to fix Windows build failures seen in EWS.
3241         
3242         Remove default constructor for ColorComponents, which was ambiguous with the
3243         one that takes 4 values.
3244
3245         * platform/graphics/ColorUtilities.h:
3246
3247 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
3248
3249         Line of garbage pixels at the bottom of an feTurbulence sometimes
3250         https://bugs.webkit.org/show_bug.cgi?id=179866
3251
3252         Reviewed by Wenson Hsieh.
3253         
3254         The ParallelJobs logic was broken in that the sum of the computed job
3255         heights was one too short sometimes. Fix and clean up the logic.
3256
3257         Test: svg/filters/feTurbulence-parallel-jobs.html
3258
3259         * platform/graphics/filters/FETurbulence.cpp:
3260         (WebCore::FETurbulence::platformApplySoftware):
3261
3262 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
3263
3264         Use #pragma once in FE* files.
3265         
3266         Rubber-stamped by Dan Bates.
3267
3268         * platform/graphics/filters/FEBlend.h:
3269         * platform/graphics/filters/FEColorMatrix.h:
3270         * platform/graphics/filters/FEComponentTransfer.h:
3271         * platform/graphics/filters/FEComposite.h:
3272         * platform/graphics/filters/FEConvolveMatrix.h:
3273         * platform/graphics/filters/FEDiffuseLighting.h:
3274         * platform/graphics/filters/FEDisplacementMap.h:
3275         * platform/graphics/filters/FEDropShadow.h:
3276         * platform/graphics/filters/FEFlood.h:
3277         * platform/graphics/filters/FEGaussianBlur.h:
3278         * platform/graphics/filters/FELighting.h:
3279         * platform/graphics/filters/FEMerge.h:
3280         * platform/graphics/filters/FEOffset.h:
3281         * platform/graphics/filters/FESpecularLighting.h:
3282         * platform/graphics/filters/FETile.h:
3283
3284 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
3285
3286         Remove a TimingScope that I left in by mistake.
3287
3288         * platform/graphics/filters/FETurbulence.cpp:
3289         (WebCore::FETurbulence::platformApplySoftware):
3290
3291 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
3292
3293         FETurbulence: round the result according to the spec
3294         https://bugs.webkit.org/show_bug.cgi?id=179865
3295
3296         Reviewed by Zalan Bujtas.
3297
3298         The spec explicitly says that the floating point results are multiplied by 255 then
3299         clamped between 0 and 255, so do this instead of using lroundf().
3300         
3301         This is also faster (about 10%).
3302
3303         * platform/graphics/ColorUtilities.h:
3304         (WebCore::ColorComponents::ColorComponents):
3305         * platform/graphics/filters/FETurbulence.cpp:
3306         (WebCore::toColorComponents):
3307         (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):
3308
3309 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
3310
3311         More FETurbulence cleanup
3312         https://bugs.webkit.org/show_bug.cgi?id=179863
3313
3314         Reviewed by Zalan Bujtas.
3315         
3316         Hoist computation of initial StitchData up to be done once per filter,
3317         not once per pixel. Passing initial StitchData by value to calculateTurbulenceValueForPoint()
3318         ensures that each pixel gets the initial state.
3319         
3320         Also, adjusted baseFrequencyX and baseFrequencyY can be computed just once at the start,
3321         and passed through via PaintingData.
3322         
3323         Change enum TurbulenceType to be an enum class (requiring casts in a couple of places)
3324         and undo the capitalization of the values.
3325
3326         Fix spelling of TURBULANCE -> TURBULENCE in test output.
3327
3328         * platform/graphics/filters/FETurbulence.cpp:
3329         (WebCore::FETurbulence::computeStitching const):
3330         (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):
3331         (WebCore::FETurbulence::fillRegion const):
3332         (WebCore::FETurbulence::fillRegionWorker):
3333         (WebCore::FETurbulence::platformApplySoftware):
3334         (WebCore::operator<<):
3335         * platform/graphics/filters/FETurbulence.h:
3336         (WebCore::FETurbulence::PaintingData::PaintingData):
3337         (WebCore::FETurbulence::StitchData::StitchData): Deleted.
3338         * svg/SVGAnimatedEnumeration.cpp:
3339         (WebCore::enumerationValueForTargetAttribute):
3340         * svg/SVGFETurbulenceElement.cpp:
3341         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
3342         (WebCore::SVGFETurbulenceElement::parseAttribute):
3343         * svg/SVGFETurbulenceElement.h:
3344         (WebCore::SVGPropertyTraits<TurbulenceType>::highestEnumValue):
3345         (WebCore::SVGPropertyTraits<TurbulenceType>::toString):
3346         (WebCore::SVGPropertyTraits<TurbulenceType>::fromString):
3347
3348 2017-11-18  Simon Fraser  <simon.fraser@apple.com>
3349
3350         feTurbulence with stitchTiles is broken
3351         https://bugs.webkit.org/show_bug.cgi?id=179862
3352
3353         Reviewed by Zalan Bujtas.
3354         
3355         The "stitchTiles" logic was broken, and not equivalent to the spec sample code,
3356         because it didn't compute and wrap the bx1 and by1 equivalents separately from
3357         bx0 and by0.
3358         
3359         Annotated the code with the equivalent sample code from the spec for ease of
3360         comparison.
3361         
3362         Also make some functions const.
3363
3364         Test: svg/filters/feTurbulence-stitchTiles.html
3365
3366         * platform/graphics/filters/FETurbulence.cpp: