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