88b978df68ade63a02d30d8d9e69c046689b6fbc
[WebKit.git] / Source / WebCore / ChangeLog
1 2019-12-20  Darin Adler  <darin@apple.com>
2
3         Tidy a bit of StringBuilder usage
4         https://bugs.webkit.org/show_bug.cgi?id=205509
5
6         Reviewed by Sam Weinig.
7
8         * dom/Range.cpp:
9         (WebCore::Range::toString const): Remove redundant range checking and let the
10         StringBuilder::appendSubstring take care of it.
11
12         * editing/MarkupAccumulator.cpp:
13         (WebCore::appendCharactersReplacingEntitiesInternal): Use appendSubstring.
14         (WebCore::MarkupAccumulator::appendNamespace): Use single calls to
15         StringBuilder::append with multiple arguments rather than multiple calls.
16
17 2019-12-31  Zalan Bujtas  <zalan@apple.com>
18
19         [LFC][IFC] Add scrollable overflow rect to Display::LineBox
20         https://bugs.webkit.org/show_bug.cgi?id=205661
21         <rdar://problem/58256282>
22
23         Reviewed by Antti Koivisto.
24
25         Compute layout overflow rect while closing the line and adjusting the rust vertically.
26
27         * layout/displaytree/DisplayInlineRect.h:
28         (WebCore::Display::InlineRect::setBottom):
29         (WebCore::Display::InlineRect::expandVerticallyToContain):
30         * layout/displaytree/DisplayLineBox.h:
31         (WebCore::Display::LineBox::scrollableOverflowRect const):
32         (WebCore::Display::LineBox::logicalTopLeft const):
33         (WebCore::Display::LineBox::setScrollableOverflowRect):
34         * layout/inlineformatting/InlineLineBuilder.cpp:
35         (WebCore::Layout::LineBuilder::alignContentVertically):
36         * layout/integration/LayoutIntegrationLineLayout.cpp:
37         (WebCore::LayoutIntegration::LineLayout::collectOverflow):
38
39 2019-12-31  Zalan Bujtas  <zalan@apple.com>
40
41         [LFC][IFC] Fix imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-014.html
42         https://bugs.webkit.org/show_bug.cgi?id=205657
43         <rdar://problem/58254951>
44
45         Reviewed by Antti Koivisto.
46
47         Use the adjusted available width when justifying the runs during line close.
48
49         * layout/inlineformatting/InlineLineBuilder.cpp:
50         (WebCore::Layout::LineBuilder::justifyRuns const):
51         (WebCore::Layout::LineBuilder::alignHorizontally):
52         * layout/inlineformatting/InlineLineBuilder.h:
53
54 2019-12-31  Antti Koivisto  <antti@apple.com>
55
56         StyleRule accessor in RuleData should return a const reference
57         https://bugs.webkit.org/show_bug.cgi?id=205655
58
59         Reviewed by Zalan Bujtas.
60
61         It is currently a non-const pointer.
62
63         This leads to StyleRule being const in many other places too.
64
65         * css/StyleRule.h:
66         (WebCore::StyleRuleBase::deref const):
67         (WebCore::StyleRuleBase::deref): Deleted.
68
69         Make deref const, matching RefCounted and allowing RefPtr<const StyleRule>
70         
71         * editing/EditingStyle.cpp:
72         (WebCore::styleFromMatchedRulesForElement):
73         * inspector/agents/InspectorCSSAgent.cpp:
74         (WebCore::InspectorCSSAgent::buildObjectForRule):
75         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
76         * inspector/agents/InspectorCSSAgent.h:
77         * style/ElementRuleCollector.cpp:
78         (WebCore::Style::ElementRuleCollector::matchedRuleList const):
79         (WebCore::Style::ElementRuleCollector::transferMatchedRules):
80         (WebCore::Style::ElementRuleCollector::ruleMatches):
81         (WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
82         * style/ElementRuleCollector.h:
83         * style/InspectorCSSOMWrappers.cpp:
84         (WebCore::Style::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
85         * style/InspectorCSSOMWrappers.h:
86         * style/RuleData.cpp:
87         (WebCore::Style::RuleData::RuleData):
88         * style/RuleData.h:
89         (WebCore::Style::RuleData::styleRule const):
90         (WebCore::Style::RuleData::compiledSelector const):
91         (WebCore::Style::RuleData::rule const): Deleted.
92         * style/RuleFeature.cpp:
93         (WebCore::Style::RuleFeature::RuleFeature):
94         (WebCore::Style::RuleFeatureSet::collectFeatures):
95         * style/RuleFeature.h:
96         (WebCore::Style::RuleFeature::RuleFeature): Deleted.
97         * style/RuleSet.cpp:
98         (WebCore::Style::RuleSet::addRule):
99         (WebCore::Style::RuleSet::addStyleRule):
100         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
101         (WebCore::Style::RuleSet::MediaQueryCollector::addRuleIfNeeded):
102         * style/RuleSet.h:
103         * style/StyleResolver.cpp:
104         (WebCore::Style::Resolver::styleRulesForElement):
105         (WebCore::Style::Resolver::pseudoStyleRulesForElement):
106         * style/StyleResolver.h:
107         * style/StyleScopeRuleSets.cpp:
108         (WebCore::Style::makeRuleSet):
109         (WebCore::Style::ensureInvalidationRuleSets):
110
111 2019-12-31  Zalan Bujtas  <zalan@apple.com>
112
113         [LFC][IFC](Regression r253909) Fix fast/text/simple-line-with-br.html
114         https://bugs.webkit.org/show_bug.cgi?id=205653
115         <rdar://problem/58248900>
116
117         Reviewed by Antti Koivisto.
118
119         When the inline content is followed by a line break (e.g. text content<br>), the line
120         break should not initiate a new line unless the line is empty (e.g text content<br><br>).
121         Let's include the line break in the LineCandidateContent so that we can close the line by
122         adding the trailing line break (This is a partial revert of r253909). 
123
124         * layout/inlineformatting/LineLayoutContext.cpp:
125         (WebCore::Layout::nextWrapOpportunity):
126         (WebCore::Layout::LineCandidateContent::inlineRuns const):
127         (WebCore::Layout::LineCandidateContent::trailingLineBreak const):
128         (WebCore::Layout::LineCandidateContent::setTrailingLineBreak):
129         (WebCore::Layout::LineCandidateContent::append):
130         (WebCore::Layout::LineLayoutContext::layoutLine):
131         (WebCore::Layout::LineLayoutContext::nextContentForLine):
132         (WebCore::Layout::LineLayoutContext::tryAddingInlineItems):
133         (WebCore::Layout::LineCandidateContent::runs const): Deleted.
134         (WebCore::Layout::LineCandidateContent::isLineBreak const): Deleted.
135         (WebCore::Layout::LineCandidateContent::setIsLineBreak): Deleted.
136         * layout/inlineformatting/LineLayoutContext.h:
137
138 2019-12-31  youenn fablet  <youenn@apple.com>
139
140         Implement RTC VTB decoders in GPUProcess
141         https://bugs.webkit.org/show_bug.cgi?id=205607
142
143         Reviewed by Eric Carlson.
144
145         Add routine to create a RemoveVideoSample from a pixel buffer.
146         Update LibWebRTCProvider to enable/disable decoding in GPU Process and add internals API.
147
148         Test: webrtc/video-gpuProcess.html
149
150         * platform/graphics/RemoteVideoSample.cpp:
151         (WebCore::RemoteVideoSample::create):
152         * platform/graphics/RemoteVideoSample.h:
153         * platform/graphics/cv/ImageTransferSessionVT.h:
154         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
155         (WebCore::LibWebRTCProvider::setUseGPUProcess):
156         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
157         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
158         * testing/Internals.cpp:
159         (WebCore::Internals::resetToConsistentState):
160         (WebCore::Internals::setUseGPUProcessForWebRTC):
161         * testing/Internals.h:
162         * testing/Internals.idl:
163
164 2019-12-30  Eric Carlson  <eric.carlson@apple.com>
165
166         Create media mime type cache base class to reduce duplicate code
167         https://bugs.webkit.org/show_bug.cgi?id=205632
168         <rdar://problem/58233565>
169
170         Reviewed by Jer Noble.
171
172         No new tests, no functional change.
173         
174         AVStreamDataParserMIMETypeCache and AVAssetMIMETypeCache have a lot of very similar code,
175         so create MIMETypeCache as a base class. Also move most of the logic from 
176         MediaPlayerPrivateMediaSourceAVFObjC::supportsType and MediaPlayerPrivateAVFoundationObjC::supportsType
177         in the caches.
178
179         * Sources.txt:
180         * WebCore.xcodeproj/project.pbxproj:
181
182         * platform/MIMETypeRegistry.cpp:
183         (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType): Call supportsContainerType.
184
185         * platform/graphics/MIMETypeCache.cpp: Added.
186         (WebCore::MIMETypeCache::supportedTypes):
187         (WebCore::MIMETypeCache::supportsContainerType):
188         (WebCore::MIMETypeCache::canDecodeType):
189         (WebCore::MIMETypeCache::canDecodeTypePrivate):
190         (WebCore::MIMETypeCache::setSupportedTypes):
191         (WebCore::MIMETypeCache::addSupportedType):
192         (WebCore::MIMETypeCache::staticContainerTypeList):
193         * platform/graphics/MIMETypeCache.h: Added.
194         (WebCore::MIMETypeCache::isUnsupportedType):
195         (WebCore::MIMETypeCache::isAvailable const):
196         (WebCore::MIMETypeCache::canDecodeTypeInternal):
197         (WebCore::MIMETypeCache::initializeCache):
198
199         * platform/graphics/MediaPlayer.h:
200         (WebCore::MediaEngineSupportParameters::encode const): Drive-by fix - add missing variable.
201
202         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h:
203         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
204         (WebCore::AVAssetMIMETypeCache::isAvailable const):
205         (WebCore::AVAssetMIMETypeCache::canDecodeTypeInternal):
206         (WebCore::AVAssetMIMETypeCache::isUnsupportedType):
207         (WebCore::AVAssetMIMETypeCache::staticContainerTypeList):
208         (WebCore::AVAssetMIMETypeCache::initializeCache):
209         (WebCore::AVAssetMIMETypeCache::setSupportedTypes): Moved to base class.
210         (WebCore::AVAssetMIMETypeCache::types): Moved to base class as supportedTypes.
211         (WebCore::AVAssetMIMETypeCache::supportsContentType): Renamed supportsContainerType.
212         (WebCore::AVAssetMIMETypeCache::canDecodeType): Moved to base class.
213         (WebCore::AVAssetMIMETypeCache::loadMIMETypes): Deleted.
214
215         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h:
216         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm:
217         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeTypeInternal):
218         (WebCore::AVStreamDataParserMIMETypeCache::initializeCache):
219         (WebCore::AVStreamDataParserMIMETypeCache::types): Moved to base class as supportedTypes.
220         (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType): Renamed supportsContainerType.
221         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType): Moved to base class.
222         (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes): Deleted.
223
224         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
225         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
226         (WebCore::ImageDecoderAVFObjC::supportsContainerType): Renamed from supportsContentType.
227         (WebCore::ImageDecoderAVFObjC::canDecodeType):
228         (WebCore::ImageDecoderAVFObjC::supportsContentType): Deleted.
229
230         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
231         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
232         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
233         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
234         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
235         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
236         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
237
238 2019-12-30  Zalan Bujtas  <zalan@apple.com>
239
240         [LFC][Integration] Do not apply trailing whitespace quirk when content is right aligned.
241         https://bugs.webkit.org/show_bug.cgi?id=205634
242         <rdar://problem/58234523>
243
244         Reviewed by Antti Koivisto.
245
246         Apparently we don't always need this quirk. See SimpleLineLayout::createLineRuns.
247
248         * layout/inlineformatting/InlineLineBuilder.cpp:
249         (WebCore::Layout::LineBuilder::removeTrailingCollapsibleContent):
250         * layout/inlineformatting/InlineLineBuilder.h:
251         (WebCore::Layout::LineBuilder::isTextAlignRight const):
252
253 2019-12-30  Brady Eidson  <beidson@apple.com>
254
255         Add WKWebView SPI to evaluate a function with arguments
256         https://bugs.webkit.org/show_bug.cgi?id=205239
257
258         Reviewed by Alex Christensen.
259
260         Covered by new API tests.
261
262         * Headers.cmake:
263         * WebCore.xcodeproj/project.pbxproj:
264         
265         * bindings/js/ExceptionDetails.h:
266         
267         * bindings/js/RunJavaScriptParameters.h: Added.
268         (WebCore::RunJavaScriptParameters::RunJavaScriptParameters):
269         (WebCore::RunJavaScriptParameters::encode const):
270         (WebCore::RunJavaScriptParameters::decode):
271         
272         * bindings/js/ScriptController.cpp:
273         (WebCore::ScriptController::executeScriptInWorldIgnoringException):
274         (WebCore::ScriptController::executeScriptInWorld):
275         (WebCore::ScriptController::callInWorld):
276         (WebCore::ScriptController::executeUserAgentScriptInWorld):
277         (WebCore::ScriptController::executeUserAgentScriptInWorldInternal):
278         (WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld):
279         * bindings/js/ScriptController.h:
280         
281         XPathGrammar changes completely unrelated to the functionality of this patch,
282         but because of our poor #include hygiene these were necessary to keep linuxes building.
283         * xml/XPathGrammar.cpp:
284         * xml/XPathGrammar.y:
285
286 2019-12-30  Antti Koivisto  <antti@apple.com>
287
288         Style invalidation cleanups
289         https://bugs.webkit.org/show_bug.cgi?id=205644
290
291         Reviewed by Zalan Bujtas.
292
293         Move more of the invalidation code from Style::Scope to Style::Invalidator.
294
295         * style/StyleInvalidator.cpp:
296         (WebCore::Style::Invalidator::invalidateStyle):
297         (WebCore::Style::Invalidator::invalidateAllStyle):
298         (WebCore::Style::Invalidator::invalidateHostAndSlottedStyleIfNeeded):
299         * style/StyleInvalidator.h:
300         * style/StyleScope.cpp:
301         (WebCore::Style::Scope::analyzeStyleSheetChange):
302
303         Return StyleSheetChange struct.
304
305         (WebCore::Style::Scope::updateActiveStyleSheets):
306         (WebCore::Style::Scope::invalidateStyleAfterStyleSheetChange):
307
308         Use StyleSheetChange to invalidate the style.
309
310         (WebCore::Style::Scope::updateResolver):
311         (WebCore::Style::Scope::scheduleUpdate):
312         (WebCore::Style::Scope::evaluateMediaQueries):
313         (WebCore::Style::invalidateHostAndSlottedStyleIfNeeded): Deleted.
314         * style/StyleScope.h:
315         (WebCore::Style::Scope::document):
316         (WebCore::Style::Scope::shadowRoot const):
317         (WebCore::Style::Scope::shadowRoot):
318
319 2019-12-30  Zalan Bujtas  <zalan@apple.com>
320
321         [LFC][IFC] Fix imported/w3c/web-platform-tests/css/css-text/white-space/white-space-wrap-after-nowrap-001.html
322         https://bugs.webkit.org/show_bug.cgi?id=205633
323         <rdar://problem/58234239>
324
325         Reviewed by Antti Koivisto.
326
327         When the LineBreaker comes back with Action::Revert (meaning that the line
328         needs to be reverted back to an earlier line wrap opportunity), call LineBuilder::revert and
329         close the line.
330
331         * layout/inlineformatting/InlineLineBreaker.cpp:
332         (WebCore::Layout::LineBreaker::tryWrappingInlineContent const): Return push when the current content can be wrapped.
333         (WebCore::Layout::ContinousContent::ContinousContent):
334         (WebCore::Layout::ContinousContent::lastWrapOpportunityIndex const): Fix the last position logic.
335         * layout/inlineformatting/InlineLineBuilder.cpp:
336         (WebCore::Layout::LineBuilder::revert):
337         (WebCore::Layout::LineBuilder::collectHangingContent):
338         * layout/inlineformatting/InlineLineBuilder.h:
339         * layout/inlineformatting/LineLayoutContext.cpp:
340         (WebCore::Layout::endsWithSoftWrapOpportunity):
341         (WebCore::Layout::LineLayoutContext::layoutLine):
342         (WebCore::Layout::LineLayoutContext::tryAddingFloatItems):
343         (WebCore::Layout::LineLayoutContext::tryAddingInlineItems):
344         (WebCore::Layout::LineLayoutContext::addFloatItems): Deleted.
345         (WebCore::Layout::LineLayoutContext::checkForLineWrapAndCommit): Deleted.
346         * layout/inlineformatting/LineLayoutContext.h:
347
348 2019-12-30  youenn fablet  <youenn@apple.com>
349
350         Ignore URL host for schemes that are not using host information
351         https://bugs.webkit.org/show_bug.cgi?id=205157
352         rdar://problem/57825963
353
354         Reviewed by Darin Adler.
355
356         Tests: http/tests/local/file-url-host.html
357                http/tests/security/about-url-host.html
358                http/tests/security/data-url-host.html
359                http/tests/security/javascript-url-host.html
360
361         Whenever setting the document URL, remove the host information if its scheme is not supposed to have a host.
362         This is done for file, data and about schemes.
363
364         Add internals APIs to test this.
365
366         * dom/Document.cpp:
367         (WebCore::Document::setURL):
368         * page/DOMWindow.h:
369         * page/Location.h:
370         * page/Location.idl:
371         * page/SecurityOrigin.cpp:
372         (WebCore::SecurityOrigin::shouldIgnoreHost):
373         * page/SecurityOrigin.h:
374         * testing/Internals.cpp:
375         (WebCore::Internals::windowLocationHost):
376         * testing/Internals.h:
377         * testing/Internals.idl:
378
379 2019-12-29  Yusuke Suzuki  <ysuzuki@apple.com>
380
381         Unreviewed, build fix after r253938
382         https://bugs.webkit.org/show_bug.cgi?id=205629
383
384         * layout/inlineformatting/InlineLineBuilder.cpp:
385         (WebCore::Layout::LineBuilder::revert):
386
387 2019-12-29  Peng Liu  <peng.liu6@apple.com>
388
389         Tweak the format and comment in the code to support media in GPU process
390         https://bugs.webkit.org/show_bug.cgi?id=205631
391
392         Reviewed by Eric Carlson.
393
394         No new tests, no functional change.
395
396         * platform/graphics/MediaPlayerPrivate.h:
397         (WebCore::MediaPlayerPrivateInterface::platformLayer const):
398         (WebCore::MediaPlayerPrivateInterface::timedMetadata const):
399         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
400         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
401
402 2019-12-29  Eric Carlson  <eric.carlson@apple.com>
403
404         Cleanup media IPC encoders
405         https://bugs.webkit.org/show_bug.cgi?id=205630
406         <rdar://problem/58232173>
407
408         Reviewed by Anders Carlsson.
409
410         No new tests, no functional change.
411
412         * platform/graphics/MediaPlayer.h:
413         (WebCore::MediaEngineSupportParameters::decode):
414
415 2019-12-27  Dean Jackson  <dino@apple.com>
416
417         [WebGL] Add a pure virtual base class for GraphicsContext3D
418         https://bugs.webkit.org/show_bug.cgi?id=205604
419
420         Reviewed by Sam Weinig.
421
422         This is the first step in a series of patches to allow multiple versions
423         of GraphicsContext3D to exist, each using a different backend rendering
424         system. I've added a GraphicsContext3DBase class (that will eventually
425         be named GraphicsContext3D) holding all the WebGL entry points as well
426         as some common helper functions.
427
428         I also took the chance to move some enums into enum classes, which
429         makes it more obvious where things come from. I also removed some
430         unused interfaces: WebGLRenderingContextErrorMessageCallback and
431         WebGLRenderingContextLostMessageCallback.
432
433         The existing GraphicsContext3D now inherits from the base class,
434         but is otherwise nearly identical. The next step will be to make
435         different instances rather than the mix of #if macros we have now.
436         The virtual functions are marked "override" for now, but will become
437         "final" in the instances.
438
439         There should be no change in functionality.
440
441         * Headers.cmake:
442         * Sources.txt:
443         * WebCore.xcodeproj/project.pbxproj:
444         * html/canvas/WebGLProgram.cpp:
445         (WebCore::WebGLProgram::cacheActiveAttribLocations):
446         * html/canvas/WebGLRenderingContextBase.cpp:
447         (WebCore::WebGLRenderingContextBase::initializeNewContext):
448         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
449         (WebCore::WebGLRenderingContextBase::getActiveAttrib):
450         (WebCore::WebGLRenderingContextBase::getActiveUniform):
451         (WebCore::WebGLRenderingContextBase::getContextAttributes):
452         (WebCore::WebGLRenderingContextBase::getUniformLocation):
453         (WebCore::WebGLRenderingContextBase::texImage2DImpl):
454         (WebCore::WebGLRenderingContextBase::texSubImage2DImpl):
455         (WebCore::WebGLRenderingContextBase::texSubImage2D):
456         (WebCore::WebGLRenderingContextBase::texImage2D):
457         (WebCore::WebGLRenderingContextBase::isTexInternalFormatColorBufferCombinationValid):
458         (WebCore::WebGLRenderingContextLostCallback::WebGLRenderingContextLostCallback): Deleted.
459         (WebCore::WebGLRenderingContextErrorMessageCallback::WebGLRenderingContextErrorMessageCallback): Deleted.
460         * html/canvas/WebGLRenderingContextBase.h:
461         * platform/graphics/FormatConverter.cpp:
462         (WebCore::uint8_t>):
463         (WebCore::float>):
464         (WebCore::uint16_t>):
465         (WebCore::FormatConverter::convert):
466         * platform/graphics/GraphicsContext3D.cpp:
467         (WebCore::GraphicsContext3D::ImageExtractor::ImageExtractor):
468         (WebCore::GraphicsContext3D::extractImageData):
469         (WebCore::GraphicsContext3D::extractTextureData):
470         (WebCore::TexelBytesForFormat):
471         (WebCore::GraphicsContext3D::packPixels):
472         (WebCore::GraphicsContext3D::getClearBitsByAttachmentType): Deleted.
473         (WebCore::GraphicsContext3D::getClearBitsByFormat): Deleted.
474         (WebCore::GraphicsContext3D::getChannelBitsByFormat): Deleted.
475         * platform/graphics/GraphicsContext3D.h:
476         (WebCore::GraphicsContext3D::ImageExtractor::imageHtmlDomSource):
477         (WebCore::GraphicsContext3D::platformGraphicsContext3D const): Deleted.
478         (WebCore::GraphicsContext3D::platformTexture const): Deleted.
479         (WebCore::GraphicsContext3D::platformLayer const): Deleted.
480         (WebCore::GraphicsContext3D::hasAlpha): Deleted.
481         (WebCore::GraphicsContext3D::hasColor): Deleted.
482         (WebCore::GraphicsContext3D::srcFormatComesFromDOMElementOrImageData): Deleted.
483         * platform/graphics/GraphicsTypes3D.h:
484         * platform/graphics/angle/GraphicsContext3DANGLE.cpp:
485         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
486         (WebCore::GraphicsContext3D::reshapeFBOs):
487         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
488         (WebCore::GraphicsContext3D::readPixels):
489         (WebCore::GraphicsContext3D::validateDepthStencil):
490         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
491         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
492         (WebCore::GraphicsContext3D::prepareTexture):
493         (WebCore::GraphicsContext3D::readRenderingResults):
494         (WebCore::GraphicsContext3D::reshape):
495         (WebCore::GraphicsContext3D::bindFramebuffer):
496         (WebCore::GraphicsContext3D::copyTexImage2D):
497         (WebCore::GraphicsContext3D::copyTexSubImage2D):
498         (WebCore::GraphicsContext3D::getContextAttributes): Deleted.
499         * platform/graphics/cg/GraphicsContext3DCG.cpp:
500         (WebCore::getSourceDataFormat):
501         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
502         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
503         (WebCore::GraphicsContext3D::create):
504         (WebCore::GraphicsContext3D::createShared):
505         (WebCore::GraphicsContext3D::GraphicsContext3D):
506         (WebCore::GraphicsContext3D::~GraphicsContext3D):
507         (WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable):
508         (WebCore::GraphicsContext3D::makeContextCurrent):
509         (WebCore::GraphicsContext3D::checkGPUStatus):
510         (WebCore::GraphicsContext3D::presentRenderbuffer):
511         (WebCore::GraphicsContext3D::texImageIOSurface2D):
512         (WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore):
513         (WebCore::GraphicsContext3D::updateCGLContext):
514         (WebCore::GraphicsContext3D::screenDidChange):
515         (WebCore::GraphicsContext3D::setContextLostCallback): Deleted.
516         (WebCore::GraphicsContext3D::setErrorMessageCallback): Deleted.
517         * platform/graphics/cocoa/WebGLLayer.mm:
518         (-[WebGLLayer initWithGraphicsContext3D:]):
519         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
520         (-[WebGLLayer bindFramebufferToNextAvailableSurface]):
521         * platform/graphics/cv/TextureCacheCV.mm:
522         (WebCore::TextureCacheCV::create):
523         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
524         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
525         (WebCore::GraphicsContext3D::reshapeFBOs):
526         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
527         (WebCore::GraphicsContext3D::readPixels):
528         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
529         (WebCore::GraphicsContext3D::validateDepthStencil):
530         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
531         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
532         (WebCore::GraphicsContext3D::prepareTexture):
533         (WebCore::GraphicsContext3D::readRenderingResults):
534         (WebCore::GraphicsContext3D::reshape):
535         (WebCore::GraphicsContext3D::bindFramebuffer):
536         (WebCore::GraphicsContext3D::copyTexImage2D):
537         (WebCore::GraphicsContext3D::copyTexSubImage2D):
538         (WebCore::GraphicsContext3D::getContextAttributes): Deleted.
539
540 2019-12-29  Zalan Bujtas  <zalan@apple.com>
541
542         [LFC][IFC] Implement LineBuilder::revert
543         https://bugs.webkit.org/show_bug.cgi?id=205629
544         <rdar://problem/58231425>
545
546         Reviewed by Antti Koivisto.
547
548         LineBuilder::revert simply removes trailing runs, shrinks the line and rebuilds the collapsible content.
549
550         * layout/inlineformatting/InlineLineBuilder.cpp:
551         (WebCore::Layout::HangingContent::width const):
552         (WebCore::Layout::HangingContent::isConditional const):
553         (WebCore::Layout::HangingContent::setIsConditional):
554         (WebCore::Layout::HangingContent::expand):
555         (WebCore::Layout::HangingContent::reset):
556         (WebCore::Layout::LineBuilder::initialize):
557         (WebCore::Layout::LineBuilder::close):
558         (WebCore::Layout::LineBuilder::revert):
559         (WebCore::Layout::LineBuilder::alignHorizontally):
560         (WebCore::Layout::LineBuilder::collectHangingContent):
561         * layout/inlineformatting/InlineLineBuilder.h:
562         (WebCore::Layout::LineBuilder::InlineItemRun::operator== const):
563         (WebCore::Layout::LineBuilder::InlineItemRun::operator!= const):
564         (WebCore::Layout::LineBuilder::HangingContent::width const): Deleted. Remove m_hangingContent so that revert does not need to deal with it.
565         (WebCore::Layout::LineBuilder::HangingContent::isConditional const): Deleted.
566         (WebCore::Layout::LineBuilder::HangingContent::setIsConditional): Deleted.
567         (WebCore::Layout::LineBuilder::HangingContent::expand): Deleted.
568         (WebCore::Layout::LineBuilder::HangingContent::reset): Deleted.
569
570 2019-12-29  Zalan Bujtas  <zalan@apple.com>
571
572         [LFC][IFC] Add LineBreaker::Result::Revert to indicate an earlier line wrap opportunity
573         https://bugs.webkit.org/show_bug.cgi?id=205623
574         <rdar://problem/58228339>
575
576         Reviewed by Antti Koivisto.
577
578         See webkit.org/b/205613 for more info.
579
580         * layout/inlineformatting/InlineLineBreaker.cpp:
581         (WebCore::Layout::LineBreaker::Result::Result):
582         (WebCore::Layout::LineBreaker::tryWrappingInlineContent const):
583         * layout/inlineformatting/InlineLineBreaker.h:
584         * layout/inlineformatting/LineLayoutContext.cpp:
585         (WebCore::Layout::LineLayoutContext::checkForLineWrapAndCommit):
586
587 2019-12-29  Antti Koivisto  <antti@apple.com>
588
589         Make RuleSet refcounted
590         https://bugs.webkit.org/show_bug.cgi?id=205628
591         <rdar://problem/58231798>
592
593         Unreviewed folloup.
594
595         * style/UserAgentStyle.cpp:
596         (WebCore::Style::UserAgentStyle::loadFullDefaultStyle):
597
598         Use deref instead of delete.
599
600 2019-12-29  Antti Koivisto  <antti@apple.com>
601
602         Make RuleSet refcounted
603         https://bugs.webkit.org/show_bug.cgi?id=205628
604
605         Reviewed by Zalan Bujtas.
606
607         For safety, and to support shared ownership.
608
609         Also convert a bunch of places that use raw RuleSet pointers to use Ref/RefPtr instead.
610
611         * style/ElementRuleCollector.cpp:
612         (WebCore::Style::ElementRuleCollector::collectMatchingAuthorRules):
613         (WebCore::Style::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
614         (WebCore::Style::ElementRuleCollector::matchUserRules):
615         * style/ElementRuleCollector.h:
616         * style/RuleSet.cpp:
617         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
618         * style/RuleSet.h:
619         (WebCore::Style::RuleSet::create):
620         (WebCore::Style::RuleSet::RuleSetSelectorPair::RuleSetSelectorPair): Deleted.
621         * style/StyleInvalidator.cpp:
622         (WebCore::Style::Invalidator::Invalidator):
623         (WebCore::Style::Invalidator::collectRuleInformation):
624         (WebCore::Style::Invalidator::invalidateIfNeeded):
625         (WebCore::Style::Invalidator::addToMatchElementRuleSets):
626         * style/StyleInvalidator.h:
627         * style/StyleScopeRuleSets.cpp:
628         (WebCore::Style::ScopeRuleSets::ScopeRuleSets):
629         (WebCore::Style::ScopeRuleSets::updateUserAgentMediaQueryStyleIfNeeded const):
630         (WebCore::Style::ScopeRuleSets::initializeUserStyle):
631         (WebCore::Style::makeRuleSet):
632         (WebCore::Style::ScopeRuleSets::resetAuthorStyle):
633         (WebCore::Style::ensureInvalidationRuleSets):
634         * style/StyleScopeRuleSets.h:
635         (WebCore::Style::ScopeRuleSets::authorStyle const):
636         * style/UserAgentStyle.cpp:
637         (WebCore::Style::UserAgentStyle::loadFullDefaultStyle):
638         (WebCore::Style::UserAgentStyle::loadSimpleDefaultStyle):
639
640 2019-12-29  Zalan Bujtas  <zalan@apple.com>
641
642         [LFC][IFC] Move soft wrap opportunity code out of LineBreaker
643         https://bugs.webkit.org/show_bug.cgi?id=205621
644         <rdar://problem/58227670>
645
646         Reviewed by Antti Koivisto.
647
648         Let's not mix soft and line wrap opportunity logic.
649
650         * layout/inlineformatting/InlineLineBreaker.cpp:
651         (WebCore::Layout::ContinousContent::runs const):
652         (WebCore::Layout::ContinousContent::isEmpty const):
653         (WebCore::Layout::ContinousContent::size const):
654         (WebCore::Layout::ContinousContent::width const):
655         (WebCore::Layout::ContinousContent::nonCollapsibleWidth const):
656         (WebCore::Layout::ContinousContent::hasTrailingCollapsibleContent const):
657         (WebCore::Layout::ContinousContent::isTrailingContentFullyCollapsible const):
658         (WebCore::Layout::LineBreaker::wrapTextContent const):
659         (WebCore::Layout::ContinousContent::ContinousContent):
660         (WebCore::Layout::ContinousContent::hasTextContentOnly const):
661         (WebCore::Layout::ContinousContent::isVisuallyEmptyWhitespaceContentOnly const):
662         (WebCore::Layout::ContinousContent::firstTextRunIndex const):
663         (WebCore::Layout::ContinousContent::lastContentRunIndex const):
664         (WebCore::Layout::ContinousContent::hasNonContentRunsOnly const):
665         (WebCore::Layout::ContinousContent::lastWrapOpportunityIndex const):
666         (WebCore::Layout::ContinousContent::TrailingCollapsibleContent::reset):
667         (WebCore::Layout::endsWithSoftWrapOpportunity): Deleted.
668         (WebCore::Layout::isAtSoftWrapOpportunity): Deleted.
669         (WebCore::Layout::LineBreaker::nextWrapOpportunity): Deleted.
670         (WebCore::Layout::LineBreaker::ContinousContent::ContinousContent): Deleted.
671         (WebCore::Layout::LineBreaker::ContinousContent::hasTextContentOnly const): Deleted.
672         (WebCore::Layout::LineBreaker::ContinousContent::isVisuallyEmptyWhitespaceContentOnly const): Deleted.
673         (WebCore::Layout::LineBreaker::ContinousContent::firstTextRunIndex const): Deleted.
674         (WebCore::Layout::LineBreaker::ContinousContent::lastContentRunIndex const): Deleted.
675         (WebCore::Layout::LineBreaker::ContinousContent::hasNonContentRunsOnly const): Deleted.
676         (WebCore::Layout::LineBreaker::ContinousContent::lastWrapOpportunityIndex const): Deleted.
677         (WebCore::Layout::LineBreaker::ContinousContent::TrailingCollapsibleContent::reset): Deleted.
678         * layout/inlineformatting/InlineLineBreaker.h:
679         (WebCore::Layout::LineBreaker::ContinousContent::runs const): Deleted.
680         (WebCore::Layout::LineBreaker::ContinousContent::isEmpty const): Deleted.
681         (WebCore::Layout::LineBreaker::ContinousContent::size const): Deleted.
682         (WebCore::Layout::LineBreaker::ContinousContent::width const): Deleted.
683         (WebCore::Layout::LineBreaker::ContinousContent::nonCollapsibleWidth const): Deleted.
684         (WebCore::Layout::LineBreaker::ContinousContent::hasTrailingCollapsibleContent const): Deleted.
685         (WebCore::Layout::LineBreaker::ContinousContent::isTrailingContentFullyCollapsible const): Deleted.
686         * layout/inlineformatting/LineLayoutContext.cpp:
687         (WebCore::Layout::endsWithSoftWrapOpportunity):
688         (WebCore::Layout::isAtSoftWrapOpportunity):
689         (WebCore::Layout::nextWrapOpportunity):
690         (WebCore::Layout::LineLayoutContext::nextContentForLine):
691
692 2019-12-28  Zalan Bujtas  <zalan@apple.com>
693
694         [LFC][IFC] Keep track of last line wrap opportunity
695         https://bugs.webkit.org/show_bug.cgi?id=205619
696         <rdar://problem/58227112>
697
698         Reviewed by Antti Koivisto.
699
700         This is in preparation for being able to revert back to an earlier position
701         of the current line as the line wrapping opportunity.
702         (actually the m_lastWrapOpportunity is already taken into use at LineBreaker::wordBreakBehavior)
703
704         * layout/inlineformatting/InlineLineBreaker.cpp:
705         (WebCore::Layout::shouldKeepBeginningOfLineWhitespace):
706         (WebCore::Layout::LineBreaker::shouldWrapInlineContent):
707         (WebCore::Layout::LineBreaker::shouldWrapFloatBox):
708         (WebCore::Layout::LineBreaker::tryWrappingInlineContent const):
709         (WebCore::Layout::LineBreaker::wrapTextContent const):
710         (WebCore::Layout::LineBreaker::wordBreakBehavior const):
711         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
712         (WebCore::Layout::LineBreaker::ContinousContent::lastWrapOpportunityIndex const):
713         * layout/inlineformatting/InlineLineBreaker.h:
714
715 2019-12-25  Dean Jackson  <dino@apple.com>
716
717         [WebGL] Enable ANGLE by default for Cocoa platforms (except simulator)
718         https://bugs.webkit.org/show_bug.cgi?id=205483
719         rdar://56925821
720
721         Reviewed by Simon Fraser.
722
723         Log an error rather than asserting.
724
725         * html/canvas/WebGL2RenderingContext.cpp:
726         (WebCore::WebGL2RenderingContext::getBufferSubData):
727
728 2019-12-28  Zalan Bujtas  <zalan@apple.com>
729
730         [LFC][IFC] Keep the LineBreaker object around until after the line is closed.
731         https://bugs.webkit.org/show_bug.cgi?id=205613
732         <rdar://problem/58222870>
733
734         Reviewed by Antti Koivisto.
735
736         In order to be able to point back to an earlier line wrap opportunity on the line e.g.
737         <div style="white-space: pre"><span style="white-space: normal">earlier_wrap opportunities</span> <span>can't_wrap_this content</span></div>
738         the LineBreaker class needs more context.
739         Currently (taking the example above), if the available space runs out somewhere around the second <span> we would just simply
740         overflow the line since the overflowing content has a style saying "do not wrap".
741         However the line has multiple earlier wrap opportunities inside the first <span>.
742         Since we construct a LineBreaker object for each continuous run 
743
744         1. [container start][earlier_wrap]
745         2. [ ]
746         3. [opportunities][container end]
747         4. [ ]
748         5. [container start][can't_wrap_this]
749         6. [ ]
750         7. [content][container end]
751
752         the LineBreaker does not have enough context to point back to the last line wrap opportunity (after run #3).
753
754         This patch is in preparation for supporting such content. 
755         1. Rename couple of functions and structs
756         2. Move the LineBreaker construction to LineLayoutContext::layoutLine so that we can keep it around for multiple set of runs.
757
758         * layout/inlineformatting/InlineLineBreaker.cpp:
759         (WebCore::Layout::isContentWrappingAllowed):
760         (WebCore::Layout::isContentSplitAllowed):
761         (WebCore::Layout::LineBreaker::isTextContentWrappingAllowed const):
762         (WebCore::Layout::LineBreaker::shouldKeepEndOfLineWhitespace const):
763         (WebCore::Layout::LineBreaker::shouldWrapInlineContent):
764         (WebCore::Layout::isTextContentWrappingAllowed): Deleted.
765         (WebCore::Layout::shouldKeepEndOfLineWhitespace): Deleted.
766         (WebCore::Layout::LineBreaker::breakingContextForInlineContent): Deleted.
767         * layout/inlineformatting/InlineLineBreaker.h:
768         (WebCore::Layout::LineBreaker::setHyphenationDisabled):
769         * layout/inlineformatting/LineLayoutContext.cpp:
770         (WebCore::Layout::isLineConsideredEmpty):
771         (WebCore::Layout::LineLayoutContext::layoutLine):
772         (WebCore::Layout::LineLayoutContext::checkForLineWrapAndCommit):
773         (WebCore::Layout::LineLayoutContext::commitContent):
774         (WebCore::Layout::LineLayoutContext::placeInlineContentOnCurrentLine): Deleted.
775         * layout/inlineformatting/LineLayoutContext.h:
776
777 2019-12-23  Darin Adler  <darin@apple.com>
778
779         Refactor to simplify broadcasting to all media elements
780         https://bugs.webkit.org/show_bug.cgi?id=205567
781
782         Reviewed by Eric Carlson.
783
784         Over time, we have accumulated many different sets of all the media elements.
785         With the goal of being a bit abstract and not building too much behavior into
786         the Document object, we ended up with unnecessary complexity, and many sets
787         of all the HTMLMediaElement objects. This is a first cut at reducing that complexity.
788         At the same time, the refactoring makes all the iteration use a safe algorithm that
789         builds a vector of Ref<HTMLMediaElement>, safe even if the work done for each
790         media element calls out to arbitrary DOM operations.
791
792         Separately, this patch also includes some name changes that still say "atomic"
793         instead of "atom" left over from our renaming of AtomicString to AtomString.
794
795         * Headers.cmake: Removed ApplicationStateChangeListener.h.
796         * WebCore.xcodeproj/project.pbxproj: Ditto.
797
798         * css/StyleSheetContents.cpp:
799         (WebCore::StyleSheetContents::estimatedSizeInBytes const): Reworded comment to
800         say "atom".
801
802         * dom/ContainerNode.cpp:
803         (WebCore::ContainerNode::getElementsByName): Updated for "atomic" -> "atom".
804         (WebCore::ContainerNode::radioNodeList): Ditto.
805
806         * dom/Document.cpp:
807         (WebCore::Document::visibilityStateChanged): Moved the code from
808         the notifyMediaCaptureOfVisibilityChanged in here. No need for a separate
809         function for the two lines of code.
810         (WebCore::Document::registerMediaElement): Added. Replaces the multiple registrations
811         that each media element would do.
812         (WebCore::Document::unregisterMediaElement): Ditto.
813         (WebCore::Document::forEachMediaElement): Added. Safely iterates the media elements
814         and calls a function on each of them.
815         (WebCore::Document::registerForAllowsMediaDocumentInlinePlaybackChangedCallbacks): Deleted.
816         (WebCore::Document::unregisterForAllowsMediaDocumentInlinePlaybackChangedCallbacks): Deleted.
817         (WebCore::Document::allowsMediaDocumentInlinePlaybackChanged): Deleted.
818         (WebCore::Document::mediaVolumeDidChange): Deleted.
819         (WebCore::Document::registerForMediaVolumeCallbacks): Deleted.
820         (WebCore::Document::unregisterForMediaVolumeCallbacks): Deleted.
821         (WebCore::Document::privateBrowsingStateDidChange): Use forEachMediaElement to call
822         privateBrowsingStateDidChange on each media element rather than keeping a separate registry.
823         (WebCore::Document::registerForPrivateBrowsingStateChangedCallbacks): Deleted.
824         (WebCore::Document::unregisterForPrivateBrowsingStateChangedCallbacks): Deleted.
825         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Updated the type
826         to be HTMLMediaElement rather than just Element.
827         (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
828         (WebCore::Document::registerForPageScaleFactorChangedCallbacks): Deleted.
829         (WebCore::Document::unregisterForPageScaleFactorChangedCallbacks): Deleted.
830         (WebCore::Document::pageScaleFactorChangedAndStable): Deleted.
831         (WebCore::Document::registerForUserInterfaceLayoutDirectionChangedCallbacks): Deleted.
832         (WebCore::Document::unregisterForUserInterfaceLayoutDirectionChangedCallbacks): Deleted.
833         (WebCore::Document::userInterfaceLayoutDirectionChanged): Deleted.
834         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): Deleted.
835         (WebCore::Document::registerForMediaStreamStateChangeCallbacks): Deleted.
836         (WebCore::Document::unregisterForMediaStreamStateChangeCallbacks): Deleted.
837         (WebCore::Document::mediaStreamCaptureStateChanged): Use forEachMediaElement to call
838         mediaStreamCaptureStarted on each media element rather than keeping a separate registry.
839         (WebCore::Document::addApplicationStateChangeListener): Deleted.
840         (WebCore::Document::removeApplicationStateChangeListener): Deleted.
841         (WebCore::Document::forEachApplicationStateChangeListener): Deleted.
842
843         * dom/Document.h: Clean up forward declarations a bit. Updated for above changes,
844         removing many function and data members.
845
846         * dom/Element.cpp:
847         (WebCore::Element::spellcheckAttributeState const): Deleted.
848         (WebCore::Element::isSpellCheckingEnabled const): Refactored to merge in the logic
849         from the spellcheckAttributeState function. The combined function is both a bit easier
850         to understand and smaller than the two functions were.
851
852         * dom/Element.h: Removed some unneeded includes. Removed SpellcheckAttributeState.
853         Made fastAttributeLookupAllowed private. Removed mediaVolumeDidChange,
854         privateBrowsingStateDidChange, captionPreferencesChanged, and spellcheckAttributeState.
855
856         * dom/FullscreenManager.cpp: Removed unneeded includes.
857         (WebCore::FullscreenManager::willEnterFullscreen): Use is<HTMLMediaElement> instead of
858         calling isMediaElement directly.
859
860         * dom/NameNodeList.cpp:
861         (WebCore::NameNodeList::~NameNodeList): Updated for "atomic" -> "atom".
862         * dom/Node.cpp:
863         (WebCore::NodeListsNodeData::invalidateCaches): Ditto.
864         (WebCore::NodeListsNodeData::invalidateCachesForAttribute): Ditto.
865
866         * dom/NodeRareData.h: Removed unneeded includes. Updated for "atomic" -> "atom".
867         Made a few coding style tweaks.
868
869         * dom/TreeScope.cpp:
870         (WebCore::TreeScope::getElementById const): Updated for "atomic" -> "atom".
871
872         * html/HTMLMediaElement.cpp:
873         (WebCore::documentToElementSetMap): Deleted.
874         (WebCore::addElementToDocumentMap): Deleted.
875         (WebCore::removeElementFromDocumentMap): Deleted.
876         (WebCore::HTMLMediaElement::registerWithDocument): Added call to registerMediaElement,
877         removed eight now-obsolete registrations.
878         (WebCore::HTMLMediaElement::unregisterWithDocument): Ditto.
879         (WebCore::HTMLMediaElement::mediaVolumeDidChange): Added an #if !PLATFORM(IOS_FAMILY)
880         to preserve the current behavior, since this was not registered for PLATFORM(IOS_FAMILY)
881         before. This should be revisited because it's not clear this platform difference is needed.
882         (WebCore::HTMLMediaElement::privateBrowsingStateDidChange): Ditto.
883         (WebCore::HTMLMediaElement::setMediaGroup): Change to use Document::forEachMediaElement
884         so we don't need to keep our own global set of media elements for each document. Required
885         a little bit of code structure change. Added a FIXME because the decision about which
886         media element is selected depends on hash table order as it always has; seems inappropriate.
887         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Removed the code
888         to register/unregister.
889         (WebCore::HTMLMediaElement::pageScaleFactorChanged): Only do the work if it's needed;
890         this replicates the old behavior which was accomplished by registering/unregistering.
891
892         * html/HTMLMediaElement.h: Removed the overrides for various virtual member functions.
893         Instead these are now public functions. Also removed ApplicationStateChangeListener.
894
895         * html/LabelableElement.cpp:
896         (WebCore::LabelableElement::labels): Updated for "atomic" -> "atom".
897         * html/LabelsNodeList.cpp:
898         (WebCore::LabelsNodeList::~LabelsNodeList): Ditto.
899         * html/RadioNodeList.cpp:
900         (WebCore::RadioNodeList::~RadioNodeList): Ditto.
901         * html/parser/HTMLDocumentParser.cpp:
902         (WebCore::HTMLDocumentParser::constructTreeFromHTMLToken): Ditto.
903         * loader/appcache/ApplicationCacheStorage.cpp:
904         (WebCore::parseHeader): Ditto.
905
906         * page/ApplicationStateChangeListener.h: Removed.
907
908         * page/Page.cpp:
909         (WebCore::Page::renderTreeSize const): Use forEachDocument.
910         (WebCore::Page::setNeedsRecalcStyleInAllFrames): Ditto.
911         (WebCore::Page::unmarkAllTextMatches): Ditto.
912         (WebCore::Page::editableElementsInRect const): Ditto.
913         (WebCore::Page::setMediaVolume): Tweaked range check so it will reject
914         NaN values. Use forEachMediaElement to call mediaVolumeDidChange,
915         eliminating the need for Document::mediaVolumeDidChange.
916         (WebCore::Page::setPageScaleFactor): Refactored to eliminate large blocks
917         of repeated code. Use forEachMediaElement to call pageScaleFactorChanged,
918         eliminating the need for Document::pageScaleFactorChangedAndStable.
919         (WebCore::Page::setUserInterfaceLayoutDirection): Use forEachMediaElement
920         to call userInterfaceLayoutDirectionChanged, eliminating the need for
921         Document::userInterfaceLayoutDirectionChanged.
922         (WebCore::Page::updateMediaElementRateChangeRestrictions): Use
923         forEachMediaElement to call updateRateChangeRestrictionas. The old code
924         would call this on all media elements in the current web process, which
925         means the functions would be called many times for the same media element.
926         (WebCore::Page::updateRendering): Use forEachDocument consistently for
927         all the document iteration. Before it was used for half the function and not
928         used for the other half; no obvious reason for the differece.
929         (WebCore::Page::suspendScriptedAnimations): Use forEachDocument.
930         (WebCore::Page::resumeScriptedAnimations): Ditto.
931         (WebCore::updateScriptedAnimationsThrottlingReason): Ditto.
932         (WebCore::Page::userStyleSheetLocationChanged): Ditto.
933         (WebCore::Page::invalidateStylesForAllLinks): Ditto.
934         (WebCore::Page::invalidateStylesForLink): Ditto.
935         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames): Ditto.
936         (WebCore::Page::setTimerThrottlingState): Ditto.
937         (WebCore::Page::dnsPrefetchingStateChanged): Ditto.
938         (WebCore::Page::storageBlockingStateChanged): Ditto.
939         (WebCore::Page::updateIsPlayingMedia): Ditto.
940         (WebCore::Page::setMuted): Ditto.
941         (WebCore::Page::stopMediaCapture): Ditto.
942         (WebCore::Page::stopAllMediaPlayback): Ditto.
943         (WebCore::Page::suspendAllMediaPlayback): Ditto.
944         (WebCore::Page::resumeAllMediaPlayback): Ditto.
945         (WebCore::Page::suspendAllMediaBuffering): Ditto.
946         (WebCore::Page::resumeAllMediaBuffering): Ditto.
947         (WebCore::setSVGAnimationsState): Deleted.
948         (WebCore::Page::setIsVisibleInternal): Use forEachDocument to call
949         suspend/resumeDeviceMotionAndOrientationUpdates, obviating the need for
950         Page::suspend/resumeDeviceMotionAndOrientationUpdates. Use
951         forEachDocument to call pause/unpauseAnimations, obviating the need for
952         WebCore::setSVGAnimationsState. Use forEachDocument to call
953         visibilityStateChanged, removing the need to write out a loop that
954         gathers the documents into a vector.
955         (WebCore::Page::suspendDeviceMotionAndOrientationUpdates): Deleted.
956         (WebCore::Page::resumeDeviceMotionAndOrientationUpdates): Deleted.
957         (WebCore::Page::captionPreferencesChanged): Use forEachDocument.
958         (WebCore::Page::setSessionID): Ditto.
959         (WebCore::Page::setPlaybackTarget): Ditto.
960         (WebCore::Page::playbackTargetAvailabilityDidChange): Ditto.
961         (WebCore::Page::setShouldPlayToPlaybackTarget): Ditto.
962         (WebCore::Page::playbackTargetPickerWasDismissed): Ditto.
963         (WebCore::Page::setAllowsMediaDocumentInlinePlayback): Use
964         forEachMediaElement to call allowsMediaDocumentInlinePlaybackChanged,
965         obviating the need for Document::allowsMediaDocumentInlinePlaybackChanged.
966         (WebCore::Page::setUnobscuredSafeAreaInsets): Use forEachDocument.
967         (WebCore::Page::setUseSystemAppearance): Ditto.
968         (WebCore::Page::setFullscreenInsets): Ditto.
969         (WebCore::Page::setFullscreenAutoHideDuration): Ditto.
970         (WebCore::Page::setFullscreenControlsHidden): Ditto.
971         (WebCore::Page::forEachDocument): Merged the collectDocuments function
972         in since it's only used here.
973         (WebCore::Page::collectDocuments): Deleted.
974         (WebCore::Page::forEachMediaElement): Added.
975         (WebCore::Page::applicationWillResignActive): Use forEachMediaElement,
976         eliminating the need for forEachApplicationStateChangeListener.
977         (WebCore::Page::applicationDidBecomeActive): Ditto.
978         (WebCore::Page::recomputeTextAutoSizingInAllFrames): Use forEachDocument.
979
980         * page/Page.h: Removed unneeded forward declarations. Removed unused
981         FindDirection enum. Tweaked formatting. Use bool instead of uint8_t as
982         underlying type for enum class with only two values. Updated for changes above.
983
984         * platform/text/TextEncoding.cpp:
985         (WebCore::TextEncoding::TextEncoding): Updated for "atomic" -> "atom".
986         (WebCore::TextEncoding::domName const): Ditto.
987         (WebCore::TextEncoding::usesVisualOrdering const): Ditto.
988         * platform/text/TextEncodingRegistry.cpp:
989         (WebCore::addToTextEncodingNameMap): Ditto.
990         (WebCore::addToTextCodecMap): Ditto.
991         (WebCore::pruneBlacklistedCodecs): Ditto.
992         (WebCore::addEncodingName): Ditto.
993         (WebCore::atomCanonicalTextEncodingName): Ditto.
994         * platform/text/TextEncodingRegistry.h: Ditto.
995
996         * xml/XPathFunctions.cpp:
997         (WebCore::XPath::atomicSubstring): Deleted.
998         (WebCore::XPath::toStringView): Added. Later could make a StringBuilder member
999         function instead.
1000         (WebCore::XPath::FunId::evaluate const): Use toStringView and StringView::substring
1001         instead of "atomicSubstring", since getElementById can be called on a StringView
1002         and there's no need to allocate/deallocate an AtomString just to check if it exists.
1003
1004 2019-12-27  Antti Koivisto  <antti@apple.com>
1005
1006         [LFC][Integration] Ensure layout boxes have expected display types
1007         https://bugs.webkit.org/show_bug.cgi?id=205606
1008
1009         Reviewed by Zalan Bujtas.
1010
1011         In some cases render tree may have display property values that don't match the renderer type. This is fine since the behavior is driven by the renderer.
1012
1013         LFC layout is driven by display property so the effective value needs to make sense. This patch fixes assertions seen in
1014
1015         fast/css/fieldset-display-row.html
1016         fast/css-grid-layout/grid-strict-ordering-crash-2.html
1017         imported/w3c/web-platform-tests/css/css-display/display-flow-root-001.html
1018         imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-display.html
1019         tables/mozilla/bugs/bug275625.html
1020
1021         * layout/integration/LayoutIntegrationLineLayout.cpp:
1022         (WebCore::LayoutIntegration::LineLayout::LineLayout):
1023         * layout/layouttree/LayoutTreeBuilder.cpp:
1024         (WebCore::Layout::TreeBuilder::buildLayoutTreeForIntegration):
1025
1026         Always set display to 'block' for the root RenderBlockFlow.
1027         Renamed for clarity.
1028
1029         (WebCore::Layout::TreeBuilder::createLayoutBox):
1030
1031         Always set <br> display to inline.
1032
1033         (WebCore::Layout::TreeBuilder::buildTableStructure):
1034         (WebCore::Layout::TreeBuilder::buildSubTree):
1035
1036         Pass the parent container instead of parent renderer so we can read effective style.
1037
1038         * layout/layouttree/LayoutTreeBuilder.h:
1039
1040 2019-12-27  Zalan Bujtas  <zalan@apple.com>
1041
1042         [LFC][IFC] Fix LayoutTests/fast/backgrounds/size/backgroundSize15.html
1043         https://bugs.webkit.org/show_bug.cgi?id=205602
1044         <rdar://problem/58212499>
1045
1046         Reviewed by Antti Koivisto.
1047
1048         softWrapOpportunityIndex could point after the last inline item in the list (when there's no more wrap opportunity)
1049         e.g text<br> : the softWrapOpportunityIndex is 2.
1050
1051         * layout/inlineformatting/LineLayoutContext.cpp:
1052         (WebCore::Layout::LineLayoutContext::nextContentForLine):
1053
1054 2019-12-27  James Darpinian  <jdarpinian@chromium.org>
1055
1056         ANGLE: Fix WebGL conformance tests for EXT_texture_filter_anisotropic
1057         https://bugs.webkit.org/show_bug.cgi?id=205520
1058
1059         Fixes get-extension.html and ext-texture-filter-anisotropic.html.
1060
1061         Reviewed by Dean Jackson.
1062
1063         * html/canvas/WebGL2RenderingContext.cpp:
1064         (WebCore::WebGL2RenderingContext::getExtension):
1065         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1066         (WebCore::WebGL2RenderingContext::getParameter):
1067         * html/canvas/WebGLRenderingContext.cpp:
1068         (WebCore::WebGLRenderingContext::getExtension):
1069         * html/canvas/WebGLRenderingContextBase.cpp:
1070         (WebCore::WebGLRenderingContextBase::getTexParameter):
1071
1072 2019-12-27  James Darpinian  <jdarpinian@chromium.org>
1073
1074         ANGLE: Fix WebGL conformance test framebuffer-object-attachment.html
1075         https://bugs.webkit.org/show_bug.cgi?id=205514
1076
1077         Rely on ANGLE to implement DEPTH_STENCIL_ATTACHMENT instead of emulating it.
1078
1079         Reviewed by Dean Jackson.
1080
1081         * html/canvas/WebGLFramebuffer.cpp:
1082         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
1083         * html/canvas/WebGLRenderingContextBase.cpp:
1084         (WebCore::WebGLRenderingContextBase::setupFlags):
1085         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
1086         (WebCore::WebGLRenderingContextBase::readPixels):
1087
1088 2019-12-26  Antti Koivisto  <antti@apple.com>
1089
1090         Remove display:compact
1091         https://bugs.webkit.org/show_bug.cgi?id=205597
1092
1093         Reviewed by Anders Carlsson.
1094
1095         It is rendered as 'block' but the value is still parsed. Remove it completely, matching other engines.
1096
1097         Test: fast/css/display-compact-ignored.html
1098
1099         * css/CSSPrimitiveValueMappings.h:
1100         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1101         * css/CSSValueKeywords.in:
1102         * rendering/RenderElement.cpp:
1103         (WebCore::RenderElement::createFor):
1104         * rendering/RenderTheme.cpp:
1105         (WebCore::RenderTheme::adjustStyle):
1106         * rendering/style/RenderStyleConstants.cpp:
1107         (WebCore::operator<<):
1108         * rendering/style/RenderStyleConstants.h:
1109         * style/StyleAdjuster.cpp:
1110         (WebCore::Style::equivalentBlockDisplay):
1111
1112 2019-12-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1113
1114         Minor code cleanup around WebCore::Path
1115         https://bugs.webkit.org/show_bug.cgi?id=205574
1116
1117         Reviewed by Anders Carlsson.
1118
1119         Carry out some minor refactoring in WebCore::Path:
1120         - Change PathElementType into an 8-bit-wide enum class, and move it under PathElement's namespace as simply Type.
1121         - Change PathElement's `FloatPoint*` that points to an array of 3 FloatPoints into a `FloatPoint[3]`.
1122         - Change Path::strokeContains() to take a `StrokeStyleApplier&` instead of a `StrokeStyleApplier*`, since it
1123           assumes that the given `StrokeStyleApplier` is nonnull anyways.
1124         - Change Path::RoundedRectStrategy into an 8-bit enum class.
1125         - Other miscellaneous style fixes.
1126
1127         No change in behavior.
1128
1129         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1130         (convertPathToScreenSpaceFunction):
1131         * html/canvas/CanvasRenderingContext2DBase.cpp:
1132         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
1133         * inspector/InspectorOverlay.cpp:
1134         (WebCore::drawShapeHighlight):
1135         * platform/graphics/FontCascade.cpp:
1136         (WebCore::findPathIntersections):
1137         * platform/graphics/Path.cpp:
1138         (WebCore::Path::addRoundedRect):
1139         (WebCore::operator<<):
1140         * platform/graphics/Path.h:
1141         (WebCore::Path::encode const):
1142         (WebCore::Path::decode):
1143         * platform/graphics/PathTraversalState.cpp:
1144         (WebCore::PathTraversalState::appendPathElement):
1145         (WebCore::PathTraversalState::processPathElement):
1146         * platform/graphics/PathTraversalState.h:
1147         * platform/graphics/cairo/PathCairo.cpp:
1148         (WebCore::Path::strokeContains const):
1149         (WebCore::Path::apply const):
1150         * platform/graphics/cg/PathCG.cpp:
1151         (WebCore::Path::strokeContains const):
1152         (WebCore::CGPathApplierToPathApplier):
1153         * platform/graphics/win/PathDirect2D.cpp:
1154         (WebCore::Path::strokeContains const):
1155         * rendering/shapes/BoxShape.cpp:
1156         (WebCore::BoxShape::buildDisplayPaths const):
1157         * rendering/shapes/RectangleShape.cpp:
1158         (WebCore::RectangleShape::buildDisplayPaths const):
1159         * rendering/svg/RenderSVGShape.cpp:
1160         (WebCore::RenderSVGShape::shapeDependentStrokeContains):
1161         * rendering/svg/SVGMarkerData.h:
1162         (WebCore::SVGMarkerData::updateMarkerDataForPathElement):
1163         * rendering/svg/SVGPathData.cpp:
1164         (WebCore::pathFromRectElement):
1165         * rendering/svg/SVGSubpathData.h:
1166         (WebCore::SVGSubpathData::updateFromPathElement):
1167         * svg/SVGPathTraversalStateBuilder.cpp:
1168         (WebCore::SVGPathTraversalStateBuilder::moveTo):
1169         (WebCore::SVGPathTraversalStateBuilder::lineTo):
1170         (WebCore::SVGPathTraversalStateBuilder::curveToCubic):
1171         (WebCore::SVGPathTraversalStateBuilder::closePath):
1172         * svg/SVGPathUtilities.cpp:
1173         (WebCore::buildStringFromPath):
1174         * testing/Internals.cpp:
1175         (WebCore::Internals::pathStringWithShrinkWrappedRects):
1176
1177 2019-12-26  Zalan Bujtas  <zalan@apple.com>
1178
1179         [LFC][IFC] When align the inline content we need to align the line as well
1180         https://bugs.webkit.org/show_bug.cgi?id=205596
1181         <rdar://problem/58197300>
1182
1183         Reviewed by Antti Koivisto.
1184
1185         Horizontal alignment means that we not only adjust the runs but also make sure the line box is aligned as well.
1186
1187         <div style="text-align: center; width: 100px;">centered text</div>
1188         The line box will also be centered as opposed to start at 0px all the way to [centered text] run's right edge.
1189
1190         * layout/inlineformatting/InlineLineBuilder.cpp:
1191         (WebCore::Layout::LineBuilder::close):
1192         (WebCore::Layout::LineBuilder::alignHorizontally):
1193         (WebCore::Layout::LineBuilder::alignContentHorizontally const): Deleted.
1194         * layout/inlineformatting/InlineLineBuilder.h:
1195
1196 2019-12-25  Zalan Bujtas  <zalan@apple.com>
1197
1198         Run with offset from the content box's logical left paint its tab stop at wrong position.
1199         https://bugs.webkit.org/show_bug.cgi?id=205595
1200         <rdar://problem/58194698>
1201
1202         Reviewed by Antti Koivisto.
1203
1204         Test: fast/text/tab-stops-with-offset-from-parent.html
1205
1206         Use the run's left offset from the line as the xPos for the TextRun. Most cases the line has only one run
1207         with 0 offset. This patch fixes the case when the additional runs (with offset != 0) paint their tab positions at the wrong place.
1208
1209         * layout/integration/LayoutIntegrationLineLayout.cpp:
1210         (WebCore::LayoutIntegration::LineLayout::paint):
1211         * rendering/SimpleLineLayoutFunctions.cpp:
1212         (WebCore::SimpleLineLayout::paintFlow):
1213
1214 2019-12-25  Zalan Bujtas  <zalan@apple.com>
1215
1216         [LFC][Painting] Fix LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-stop-threshold-001.html
1217         https://bugs.webkit.org/show_bug.cgi?id=205594
1218         <rdar://problem/58194138>
1219
1220         Reviewed by Antti Koivisto.
1221
1222         Construct the TextRun with relative coordinates to get tab stops right.
1223
1224         * layout/displaytree/DisplayPainter.cpp:
1225         (WebCore::Display::paintInlineContent):
1226
1227 2019-12-25  Zalan Bujtas  <zalan@apple.com>
1228
1229         [LFC][IFC] Forward scan for soft wrap opportunities
1230         https://bugs.webkit.org/show_bug.cgi?id=205584
1231         <rdar://problem/58188386>
1232
1233         Reviewed by Antti Koivisto.
1234
1235         This patch implements forward scanning to find wrap opportunities in inline content.
1236         e.g <span></span>example<span><span></span> content</span>
1237         When we reach "ex-" content, in order to figure out if it is at a wrap opportunity, we scan the content
1238         forward until after we reach another inline content, in this case " " right before the "content" and
1239         check if we can break the content between these 2 inline items.
1240
1241         isAtSoftWrapOpportunity: takes 2 (adjacent by skipping non-content inline items) and return true if there's
1242         a soft wrap opportunity in between them.
1243         LineBreaker::nextWrapOpportunity: returns the next wrap opportunity (either a soft wrap opportunity or a line break or the end of the content)
1244
1245         * layout/inlineformatting/InlineLineBreaker.cpp:
1246         (WebCore::Layout::endsWithSoftWrapOpportunity):
1247         (WebCore::Layout::isAtSoftWrapOpportunity):
1248         (WebCore::Layout::LineBreaker::nextWrapOpportunity):
1249         (WebCore::Layout::LineBreaker::ContinousContent::ContinousContent):
1250         (WebCore::Layout::LineBreaker::lastSoftWrapOpportunity): Deleted.
1251         * layout/inlineformatting/InlineLineBreaker.h:
1252         * layout/inlineformatting/LineLayoutContext.cpp:
1253         (WebCore::Layout::LineCandidateContent::isLineBreak const):
1254         (WebCore::Layout::LineCandidateContent::append):
1255         (WebCore::Layout::LineCandidateContent::setIsLineBreak):
1256         (WebCore::Layout::LineLayoutContext::layoutLine):
1257         (WebCore::Layout::LineLayoutContext::nextContentForLine):
1258         (WebCore::Layout::ContinousContent::hasIntrusiveFloats const): Deleted.
1259         (WebCore::Layout::ContinousContent::runs const): Deleted.
1260         (WebCore::Layout::ContinousContent::floats const): Deleted.
1261         (WebCore::Layout::ContinousContent::endsWithLineBreak const): Deleted.
1262         (WebCore::Layout::ContinousContent::setEndsWithLineBreak): Deleted.
1263         (WebCore::Layout::ContinousContent::append): Deleted.
1264         (WebCore::Layout::LineLayoutContext::nextContinousContentForLine): Deleted.
1265         * layout/inlineformatting/LineLayoutContext.h:
1266
1267 2019-12-25  Zalan Bujtas  <zalan@apple.com>
1268
1269         [LFC][IFC] LineBreaker should tell whether the line should receive no more content
1270         https://bugs.webkit.org/show_bug.cgi?id=205587
1271         <rdar://problem/58188635>
1272
1273         Reviewed by Antti Koivisto.
1274
1275         LineBreaker returns IsEndOfLine::No when the current line should still be able to receive additional content.
1276         This way we can start closing the line sooner (as opposed to start probing the subsequent content).
1277         (Note that just because the current content overflows the line, it does not necessarily mean that the subsequent content
1278         wraps to the next line.)   
1279
1280         * layout/inlineformatting/InlineLineBreaker.cpp:
1281         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
1282         (WebCore::Layout::LineBreaker::ContinousContent::lastContentRunIndex const):
1283         * layout/inlineformatting/InlineLineBreaker.h:
1284         * layout/inlineformatting/LineLayoutContext.cpp:
1285         (WebCore::Layout::LineLayoutContext::layoutLine):
1286         (WebCore::Layout::LineLayoutContext::addFloatItems):
1287         (WebCore::Layout::LineLayoutContext::placeInlineContentOnCurrentLine):
1288         * layout/inlineformatting/LineLayoutContext.h:
1289
1290 2019-12-25  Zalan Bujtas  <zalan@apple.com>
1291
1292         [LFC][IFC] Add support for zero-width-space character (U+200B)
1293         https://bugs.webkit.org/show_bug.cgi?id=205586
1294         <rdar://problem/58188505>
1295
1296         Reviewed by Antti Koivisto.
1297
1298         If a line has only U+200B characters, it is still considered empty from line breaking point of view. 
1299         (Note that U+200B is not considered a whitespace character so a run with U+200B does not collapse.)
1300
1301         * layout/inlineformatting/InlineLineBuilder.cpp:
1302         (WebCore::Layout::LineBuilder::appendTextContent): empty runs don't collapse.
1303         (WebCore::Layout::LineBuilder::isVisuallyNonEmpty const):
1304         (WebCore::Layout::LineBuilder::InlineItemRun::hasEmptyTextContent const):
1305         * layout/inlineformatting/InlineLineBuilder.h:
1306         * layout/inlineformatting/InlineTextItem.cpp:
1307         (WebCore::Layout::InlineTextItem::isEmptyContent const):
1308         * layout/inlineformatting/InlineTextItem.h:
1309
1310 2019-12-25  Zalan Bujtas  <zalan@apple.com>
1311
1312         [LFC][IFC] Fix LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-control-chars-001.html
1313         https://bugs.webkit.org/show_bug.cgi?id=205585
1314         <rdar://problem/58188420>
1315
1316         Reviewed by Antti Koivisto.
1317
1318         TextUtil::fixedPitchWidth works on simple content only (letter-spacing forces slow font measuring path).
1319
1320         * layout/inlineformatting/text/TextUtil.cpp:
1321         (WebCore::Layout::TextUtil::width):
1322
1323 2019-12-24  Antoine Quint  <graouts@apple.com>
1324
1325         [Web Animations] REGRESSION: Changing the animation-duration of a CSS Animation may not resume it
1326         https://bugs.webkit.org/show_bug.cgi?id=205580
1327         <rdar://problem/58127956>
1328
1329         Reviewed by Dean Jackson.
1330
1331         Test: webanimations/css-animation-dynamic-duration-change.html
1332
1333         Setting the animation-duration of an animation will transition the animation back into its idle state
1334         and the "update animations and send events" procedure would remove that animation from the timeline.
1335         It would also remove it from the map that would associate an animation with a given CSS Animation name
1336         so that we would know whether an animation exists for a given animation name when one of the animation's
1337         properties changed. Since that animation was (mistakenly) removed, we would fail to update its timing
1338         and it would never be resumed. We now only update the CSS Animation name to animation map when styles
1339         change.
1340
1341         * animation/AnimationTimeline.cpp:
1342         (WebCore::AnimationTimeline::animationWasRemovedFromElement):
1343
1344 2019-12-24  Youenn Fablet  <youenn@apple.com>
1345
1346         Deny Notification API access for non secure contexts
1347         https://bugs.webkit.org/show_bug.cgi?id=205496
1348         <rdar://problem/58074660>
1349
1350         Reviewed by Chris Dumez.
1351
1352         If document is not SecureContext, deny permission automatically.
1353         This behavior is matching a planned update to the spec, as discussed in
1354         https://github.com/whatwg/notifications/issues/93.
1355         Chrome landed this restriction in M62. Mozilla is also on board with this restriction.
1356
1357         Test: http/tests/notifications/notification-in-non-secure-context.html
1358
1359         * Modules/notifications/Notification.cpp:
1360         (WebCore::Notification::requestPermission):
1361
1362 2019-12-24  youenn fablet  <youenn@apple.com>
1363
1364         Service Worker doesn't terminate after a period of time when thread blocking
1365         https://bugs.webkit.org/show_bug.cgi?id=202992
1366         <rdar://problem/56298596>
1367
1368         Reviewed by Chris Dumez.
1369
1370         Whenever running a service worker task, running script or posting events (install, activate, message and fetch),
1371         start a timer to check that the service worker is not spinning.
1372         This is done by posting a task to service worker thread and hopping back to the main thread.
1373         If this post/hop is done before the heartbeat timer is fired, the service worker is considered live.
1374         Otherwise, the check is failed and the task is considered as failing.
1375         The service worker will be terminated.
1376         Timeout is 60 seconds by default and 1 second for test purposes.
1377
1378         Add settings to have short heartbeat timeout for testing purposes.
1379         Add internals API to check whether a service worker is running.
1380
1381         Tests: http/wpt/service-workers/service-worker-spinning-activate.https.html
1382                http/wpt/service-workers/service-worker-spinning-fetch.https.html
1383                http/wpt/service-workers/service-worker-spinning-install.https.html
1384                http/wpt/service-workers/service-worker-spinning-message.https.html
1385
1386         * page/Settings.yaml:
1387         * testing/Internals.cpp:
1388         (WebCore::Internals::isServiceWorkerRunning):
1389         * testing/Internals.h:
1390         * testing/Internals.idl:
1391         * workers/service/SWClientConnection.h:
1392         (WebCore::SWClientConnection::isServiceWorkerRunning):
1393         * workers/service/context/SWContextManager.h:
1394         (WebCore::SWContextManager::Connection::isTestMode const):
1395         (WebCore::SWContextManager::Connection::setIsTestMode):
1396         * workers/service/context/ServiceWorkerThread.cpp:
1397         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1398         (WebCore::ServiceWorkerThread::postFetchTask):
1399         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
1400         (WebCore::ServiceWorkerThread::fireInstallEvent):
1401         (WebCore::ServiceWorkerThread::finishedFiringInstallEvent):
1402         (WebCore::ServiceWorkerThread::fireActivateEvent):
1403         (WebCore::ServiceWorkerThread::finishedFiringActivateEvent):
1404         (WebCore::ServiceWorkerThread::finishedEvaluatingScript):
1405         (WebCore::ServiceWorkerThread::start):
1406         (WebCore::ServiceWorkerThread::finishedStarting):
1407         (WebCore::ServiceWorkerThread::startFetchEventMonitoring):
1408         (WebCore::ServiceWorkerThread::startHeartBeatTimer):
1409         (WebCore::ServiceWorkerThread::heartBeatTimerFired):
1410         * workers/service/context/ServiceWorkerThread.h:
1411         (WebCore::ServiceWorkerThread::stopFetchEventMonitoring):
1412         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1413         (WebCore::ServiceWorkerThreadProxy::startFetch):
1414         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
1415         (WebCore::ServiceWorkerThreadProxy::removeFetch):
1416         * workers/service/server/SWServerToContextConnection.cpp:
1417         (WebCore::SWServerToContextConnection::didFailHeartBeatCheck):
1418         * workers/service/server/SWServerToContextConnection.h:
1419         * workers/service/server/SWServerWorker.cpp:
1420         (WebCore::SWServerWorker::didFailHeartBeatCheck):
1421         * workers/service/server/SWServerWorker.h:
1422
1423 2019-12-23  Simon Fraser  <simon.fraser@apple.com>
1424
1425         REGRESSION (r253634): Reproducible crash going back and forward on goodreads.com in Page::setPageScaleFactor
1426         https://bugs.webkit.org/show_bug.cgi?id=205569
1427
1428         Reviewed by Wenson Hsieh.
1429
1430         When going quickly back and forward, WebPage::didCommitLoad/WebPage::viewportConfigurationChanged/WebPage::scalePage
1431         can be called for a page in the page cache, so the FrameView can be null.
1432
1433         Null-check the view here like the surrounding code does.
1434
1435         * page/Page.cpp:
1436         (WebCore::Page::setPageScaleFactor):
1437
1438 2019-12-23  Andres Gonzalez  <andresg_22@apple.com>
1439
1440         IsolatedObject implementation of property setters.
1441         https://bugs.webkit.org/show_bug.cgi?id=205566
1442
1443         Reviewed by Chris Fleizach.
1444
1445         - Implementation of setters that need to be executed in the main
1446         thread.
1447         - Sanity check of the associatedAXObject() before calling corresponding
1448         method on main thread.
1449
1450         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
1451         (WebCore::AXIsolatedObject::initializeAttributeData):
1452         (WebCore::AXIsolatedObject::performFunctionOnMainThread):
1453         (WebCore::AXIsolatedObject::setARIAGrabbed):
1454         (WebCore::AXIsolatedObject::setIsExpanded):
1455         (WebCore::AXIsolatedObject::setValue):
1456         (WebCore::AXIsolatedObject::setSelected):
1457         (WebCore::AXIsolatedObject::setSelectedRows):
1458         (WebCore::AXIsolatedObject::setFocused):
1459         (WebCore::AXIsolatedObject::setSelectedText):
1460         (WebCore::AXIsolatedObject::setSelectedTextRange):
1461         (WebCore::AXIsolatedObject::setCaretBrowsingEnabled):
1462         (WebCore::AXIsolatedObject::setPreventKeyboardDOMEventDispatch):
1463         (WebCore::AXIsolatedObject::findTextRanges const):
1464         (WebCore::AXIsolatedObject::performTextOperation):
1465         (WebCore::AXIsolatedObject::widget const):
1466         (WebCore::AXIsolatedObject::document const):
1467         (WebCore::AXIsolatedObject::documentFrameView const):
1468         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
1469
1470 2019-12-23  Daniel Bates  <dabates@apple.com>
1471
1472         REGRESSION (r212693): getClientRects(), getBoundingClientRect() for range that spans multi-lines differs depending on whether text is selected
1473         https://bugs.webkit.org/show_bug.cgi?id=205527
1474         <rdar://problem/58128278>
1475
1476         Reviewed by Zalan Bujtas.
1477
1478         Include empty rect when range start position coincides with the end of a simple line layout run.
1479         This makes it match the behavior of line box layout, Firefox's behavior, as well as my understanding
1480         of Extensions to the Range Interface: <https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface>
1481         (Editor's Draft, 10 October 2019).
1482
1483         At the time of writing, there are two code paths for laying out lines: simple line layout and
1484         line box layout. Simple line layout is not enabled when there is a selection at the time of
1485         writing. As a result, we use line box layout to answer getClientRects(), getBoundingClientRect()
1486         queries.
1487
1488         Test: fast/dom/Range/mac/getClientRects-and-getBoundingClientRect-before-and-after-selection.html
1489
1490         * rendering/SimpleLineLayoutResolver.cpp:
1491         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const): Do not skip over a run
1492         if its end position coincides with the range's start offset. This ensures that we emit an empty rect
1493         for this part of the box selection, which matches what we do using the analagous line box layout
1494         code path.
1495
1496 2019-12-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1497
1498         [GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load
1499         https://bugs.webkit.org/show_bug.cgi?id=185248
1500
1501         Reviewed by Žan Doberšek.
1502
1503         Notify the editor when a key event handled by input method has been dispatched. This way we can handle the
1504         composition results right after the event is dispatched.
1505
1506         * editing/Editor.cpp:
1507         (WebCore::Editor::didDispatchInputMethodKeydown): Notify the client.
1508         * editing/Editor.h:
1509         * page/EditorClient.h:
1510         (WebCore::EditorClient::didDispatchInputMethodKeydown): Added.
1511         * page/EventHandler.cpp:
1512         (WebCore::EventHandler::internalKeyEvent): Call Editor::didDispatchInputMethodKeydown() for events handled by
1513         input method right after the event is dispatched.
1514         * platform/PlatformKeyboardEvent.h:
1515         (WebCore::PlatformKeyboardEvent::preeditUnderlines const):
1516         (WebCore::PlatformKeyboardEvent::preeditSelectionRangeStart const):
1517         (WebCore::PlatformKeyboardEvent::preeditSelectionRangeLength const):
1518         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1519         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
1520         method and remove the special case for Char events handled by input method because this is never called with
1521         Char type for events handled by input method.
1522         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
1523         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
1524         method.
1525
1526 2019-12-22  Simon Fraser  <simon.fraser@apple.com>
1527
1528         Very basic <dialog> show/close support
1529         https://bugs.webkit.org/show_bug.cgi?id=205543
1530
1531         Reviewed by Antti Koivisto.
1532         
1533         Fix HTMLDialogElement.idl for attribute reflection, and showModal() possibly throwing.
1534         
1535         Have show/showModal() and close() toggle the "open" attribute. Implement parseAttribute()
1536         to initialize m_isOpen from the attribute value.
1537         
1538         Add dialog.css, which is appended to the UA stylesheets if the feature is enabled. Have
1539         it set the display value.
1540
1541         Tested by web-platform-tests.
1542
1543         * CMakeLists.txt:
1544         * DerivedSources-input.xcfilelist:
1545         * DerivedSources.make:
1546         * WebCore.xcodeproj/project.pbxproj:
1547         * css/dialog.css: Added.
1548         (dialog):
1549         (dialog[open]):
1550         * html/HTMLDialogElement.cpp:
1551         (WebCore::HTMLDialogElement::isOpen const):
1552         (WebCore::HTMLDialogElement::show):
1553         (WebCore::HTMLDialogElement::showModal):
1554         (WebCore::HTMLDialogElement::close):
1555         (WebCore::HTMLDialogElement::parseAttribute):
1556         (WebCore::HTMLDialogElement::toggleOpen):
1557         (WebCore::HTMLDialogElement::open): Deleted.
1558         (WebCore::HTMLDialogElement::setOpen): Deleted.
1559         * html/HTMLDialogElement.h:
1560         * html/HTMLDialogElement.idl:
1561         * style/InspectorCSSOMWrappers.cpp:
1562         (WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers):
1563         * style/UserAgentStyle.cpp:
1564         (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
1565         * style/UserAgentStyle.h:
1566
1567 2019-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1568
1569         [macCatalyst] Mouse clicks dispatch duplicate pointerup and pointerdown events
1570         https://bugs.webkit.org/show_bug.cgi?id=205551
1571         <rdar://problem/58058268>
1572
1573         Reviewed by Tim Horton.
1574
1575         This began occuring after r251320, wherein some mouse event handling codepaths were enabled in macCatalyst.
1576         For compatibility, gesture recognizers still fire in the macCatalyst platform. This includes the synthetic click
1577         gesture, which will still synthesize and send mouseup and mousedown events to the page. After the change, this
1578         results in pointer events being dispatched under the call to `shouldIgnoreMouseEvent()`. However, at the same
1579         time, touch event handling codepaths have already dispatched "pointerup" and "pointerdown", so we end up with
1580         redundant events.
1581
1582         To fix this macCatalyst-specific bug, simply avoid dispatching pointer events in the case where the synthetic
1583         click type is some kind of tap gesture; in this case, pointer events have already been dispatched, so we don't
1584         need to dispatch them again via mouse event handling code.
1585
1586         Test: pointerevents/ios/pointer-events-with-click-handler.html
1587
1588         * dom/Element.cpp:
1589         (WebCore::dispatchPointerEventIfNeeded):
1590
1591         Also rename shouldIgnoreMouseEvent to dispatchPointerEventIfNeeded to better reflect that this function's
1592         primary purposee is to dispatch pointer events in response to platform mouse events; then, change the return
1593         value to an explicit enum class indicating whether the mouse event should be subsequently ignored (as a result
1594         of the page preventing the dispatched pointer event).
1595
1596         (WebCore::Element::dispatchMouseEvent):
1597         (WebCore::shouldIgnoreMouseEvent): Deleted.
1598
1599 2019-12-22  Antti Koivisto  <antti@apple.com>
1600
1601         Invalidate only affected elements after media query evaluation changes
1602         https://bugs.webkit.org/show_bug.cgi?id=205392
1603
1604         Reviewed by Zalan Bujtas.
1605
1606         We currently invalidate style of the whole tree when a media query evaluation changes.
1607         We can do better by constructing an invalidation RuleSet and invalidating only those
1608         elements that are potentially affected.
1609
1610         * style/RuleSet.cpp:
1611         (WebCore::Style::RuleSet::addRule):
1612         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
1613
1614         Construct and cache an invalidation RuleSet and associate with a set of media query changes.
1615
1616         (WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
1617         (WebCore::Style::RuleSet::MediaQueryCollector::pop):
1618         (WebCore::Style::RuleSet::MediaQueryCollector::addRuleIfNeeded):
1619
1620         Collect RuleFeatures which we later use to build invalidation RuleSet.
1621
1622         (WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded): Deleted.
1623         * style/RuleSet.h:
1624         (WebCore::Style::DynamicMediaQueryEvaluationChanges::append):
1625         * style/StyleResolver.cpp:
1626         (WebCore::Style::Resolver::evaluateDynamicMediaQueries):
1627         * style/StyleResolver.h:
1628         * style/StyleScope.cpp:
1629         (WebCore::Style::Scope::evaluateMediaQueries):
1630
1631         Use the invalidation RuleSet for accurate style invalidation.
1632
1633         * style/StyleScopeRuleSets.cpp:
1634         (WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):
1635
1636         Collect invalidation RuleSets for author/user/user agent style.
1637
1638         * style/StyleScopeRuleSets.h:
1639
1640 2019-12-22  Zalan Bujtas  <zalan@apple.com>
1641
1642         [LFC][Integration] Do not remove trailing whitespace when it is followed by a line break
1643         https://bugs.webkit.org/show_bug.cgi?id=205549
1644         <rdar://problem/58139893>
1645
1646         Reviewed by Antti Koivisto.
1647
1648         Complex line layout quirk: keep the trailing whitespace aroun
1649         when it is followed by a line break, unless the content overflows the line.
1650
1651         * layout/inlineformatting/InlineLineBuilder.cpp:
1652         (WebCore::Layout::LineBuilder::removeTrailingCollapsibleContent):
1653
1654 2019-12-22  Zalan Bujtas  <zalan@apple.com>
1655
1656         [LFC][Integration] Do not collapse trailing letter spacing
1657         https://bugs.webkit.org/show_bug.cgi?id=205548
1658         <rdar://problem/58139872>
1659
1660         Reviewed by Antti Koivisto.
1661
1662         Turn off trailing letter-spacing trimming for now.
1663
1664         * layout/inlineformatting/InlineLineBuilder.cpp:
1665         (WebCore::Layout::LineBuilder::InlineItemRun::hasTrailingLetterSpacing const):
1666
1667 2019-12-21  Brian Burg  <bburg@apple.com>
1668
1669         Web Inspector: add InspectedTargetTypes diagnostic event and related hooks
1670         https://bugs.webkit.org/show_bug.cgi?id=205174
1671         <rdar://problem/57887953>
1672
1673         Reviewed by Devin Rousso.
1674
1675         Expose debuggable information via InspectorFrontendHost.
1676
1677         * WebCore.xcodeproj/project.pbxproj: Add new files.
1678
1679         * inspector/InspectorFrontendClient.h: Add new methods.
1680         * testing/Internals.cpp: Implement new methods.
1681
1682         * inspector/InspectorFrontendHost.idl:
1683         * inspector/InspectorFrontendHost.h:
1684         * inspector/InspectorFrontendHost.cpp:
1685         (WebCore::debuggableTypeToString):
1686         (WebCore::InspectorFrontendHost::debuggableInfo const):
1687         (WebCore::InspectorFrontendHost::debuggableType): Deleted.
1688         Expose a `DebuggableInfo` dictionary via the .debuggableInfo getter.
1689
1690
1691 2019-12-21  Antti Koivisto  <antti@apple.com>
1692
1693         Move Vector HashTraits to HashTraits.h to fix GCC build
1694         https://bugs.webkit.org/show_bug.cgi?id=205540
1695
1696         Reviewed by Zalan Bujtas.
1697
1698         * contentextensions/DFAMinimizer.cpp:
1699
1700         ActionKey HashTrait claims that emptyValueIsZero. Now with Vector HashTrait having emptyValueIsZero too
1701         HashMap<ActionKey, Vector<>> started taking the optimized path.
1702
1703         However ActionKey empty value wasn't actually zero because Empty enum value wasn't 0.
1704
1705 2019-12-21  Kate Cheney  <katherine_cheney@apple.com>
1706
1707         Add timeStamp to ITP database
1708         https://bugs.webkit.org/show_bug.cgi?id=205121
1709         <rdar://problem/57633021>
1710
1711         Reviewed by John Wilander.
1712
1713         * loader/ResourceLoadStatistics.h:
1714
1715 2019-12-20  Eric Carlson  <eric.carlson@apple.com>
1716
1717         [Media in GPU process] Get audio playing
1718         https://bugs.webkit.org/show_bug.cgi?id=205511
1719         <rdar://problem/58120354>
1720
1721         Reviewed by Jer Noble.
1722
1723         Tested manually with a modified sandbox because it isn't possible to load media
1724         in the GPU process yet.
1725
1726         * platform/graphics/MediaPlayer.cpp:
1727         (WebCore::MediaPlayer::bufferedTimeRangesChanged):
1728         (WebCore::MediaPlayer::seekableTimeRangesChanged):
1729         * platform/graphics/MediaPlayer.h:
1730         * platform/graphics/PlatformTimeRanges.cpp:
1731         (WebCore::PlatformTimeRanges::PlatformTimeRanges):
1732         (WebCore::PlatformTimeRanges::clear):
1733         * platform/graphics/PlatformTimeRanges.h:
1734
1735 2019-12-20  Ryosuke Niwa  <rniwa@webkit.org>
1736
1737         TextManipulationController should respect new token orders
1738         https://bugs.webkit.org/show_bug.cgi?id=205378
1739
1740         Reviewed by Wenson Hsieh.
1741
1742         Updated TextManipulationController::replace to remove all existing content and insert new tokens in the order they appear.
1743
1744         To do this, we first find the common ancestor of all nodes in the paragraph and then remove all nodes in between.
1745
1746         Then we'd insert the node identified by the token identifier and all its ancestors at where they appear. In the case
1747         the same token is used for the second time, we clone its node. For each leaf node, we find the closest ancestor which
1748         had already been inserted by the previous token, and append the leaf node along with its ancestors to it.
1749
1750         I'm expecting to make a lot of refinements & followups to this algorithm in the future but this seems to get basics done.
1751
1752         Tests: TextManipulation.CompleteTextManipulationReplaceSimpleSingleParagraph
1753                TextManipulation.CompleteTextManipulationDisgardsTokens
1754                TextManipulation.CompleteTextManipulationReordersContent
1755                TextManipulation.CompleteTextManipulationCanSplitContent
1756                TextManipulation.CompleteTextManipulationCanMergeContent
1757                TextManipulation.CompleteTextManipulationFailWhenContentIsRemoved
1758                TextManipulation.CompleteTextManipulationFailWhenExcludedContentAppearsMoreThanOnce
1759                TextManipulation.CompleteTextManipulationPreservesExcludedContent
1760
1761         * editing/TextManipulationController.cpp:
1762         (WebCore::TextManipulationController::didCreateRendererForElement):
1763         (WebCore::TextManipulationController::completeManipulation):
1764         (WebCore::TextManipulationController::replace):
1765
1766 2019-12-20  Sihui Liu  <sihui_liu@apple.com>
1767
1768         REGRESSION (r253807): crash in storage/indexeddb/modern/opendatabase-request-private.html
1769         https://bugs.webkit.org/show_bug.cgi?id=205515
1770
1771         Reviewed by Alex Christensen.
1772
1773         When m_openRequests of IDBTransaction is empty, we expect all requests associated with the transactions should 
1774         be completed, but in IDBOpenDBRequest, we removed the request from m_openRequests before 
1775         m_currentlyCompletingRequest finished. This is because the order of calling ActiveDOMObject::stop() is random.
1776
1777         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1778         (WebCore::IDBOpenDBRequest::cancelForStop):
1779         * Modules/indexeddb/IDBTransaction.cpp:
1780         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
1781         (WebCore::IDBTransaction::connectionClosedFromServer):
1782
1783 2019-12-20  Megan Gardner  <megan_gardner@apple.com>
1784
1785         Paint highlights specified in CSS Highlight API
1786         https://bugs.webkit.org/show_bug.cgi?id=205318
1787
1788         Reviewed by Ryosuke Niwa.
1789
1790         Render highlights when present, similar to the way we render selection.
1791
1792         Tests: imported/w3c/web-platform-tests/css/css-highlight-api/highlight-text-across-elements.html
1793                imported/w3c/web-platform-tests/css/css-highlight-api/highlight-text.html
1794
1795         * Modules/highlight/HighlightMap.h:
1796         (WebCore::HighlightMap::map const):
1797
1798         Add a getter for the internal HashMap.
1799
1800         * rendering/InlineTextBox.cpp:
1801         (WebCore::InlineTextBox::selectionState):
1802         (WebCore::InlineTextBox::verifySelectionState const):
1803         (WebCore::InlineTextBox::paint):
1804         (WebCore::InlineTextBox::clampedStartEndForState const):
1805         (WebCore::InlineTextBox::selectionStartEnd const):
1806         (WebCore::InlineTextBox::highlightStartEnd const):
1807         (WebCore::InlineTextBox::resolveStyleForMarkedText):
1808
1809         Use the highlight name from the HighlightRangeGroup to obtain the style from the renderer.
1810
1811         (WebCore::InlineTextBox::collectMarkedTextsForHighlights const):
1812
1813         Render the highlights when painting text. Determine if a highlight is present in the current RenderObject, and
1814         add additional MarkedText to be rendered when painting
1815
1816         * rendering/InlineTextBox.h:
1817         * rendering/MarkedText.cpp:
1818         (WebCore::subdivide):
1819         * rendering/MarkedText.h:
1820         (WebCore::MarkedText::operator== const):
1821
1822         Expand MarkedText to take a style name.
1823
1824         * rendering/SelectionRangeData.cpp:
1825         (WebCore::SelectionRangeData::setContext):
1826         (WebCore::SelectionRangeData::selectionStateForRenderer):
1827         (WebCore::SelectionRangeData::set):
1828         * rendering/SelectionRangeData.h:
1829
1830         Leverage SelectionRangeData for highlights.
1831
1832 2019-12-20  Chris Dumez  <cdumez@apple.com>
1833
1834         [iOS Debug] imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https.html is crashing
1835         https://bugs.webkit.org/show_bug.cgi?id=205506
1836         <rdar://problem/58118091>
1837
1838         Reviewed by Darin Adler.
1839
1840         Drop iOS specific hack in FrameLoader::checkCompleted() that was causing this crash in iOS Debug.
1841         This hack was added a long time ago to fix back/forward navigation after clicking an intra PDF
1842         document hyperlink. I have verified on iOS 13 that the behavior is unchanged without this code:
1843         - Back/forward navigation within a PDF work in UIWebView and do not work in WKWebView
1844
1845         No new tests, unskipped existing test.
1846
1847         * loader/FrameLoader.cpp:
1848         (WebCore::FrameLoader::checkCompleted):
1849
1850 2019-12-20  Chris Dumez  <cdumez@apple.com>
1851
1852         [Bindings] Add @@toStringTag to our iterator prototype object
1853         https://bugs.webkit.org/show_bug.cgi?id=205516
1854
1855         Reviewed by Darin Adler.
1856
1857         Add @@ toStringTag to our iterator prototype object, as per:
1858         - https://heycam.github.io/webidl/#es-iterator-prototype-object
1859
1860         No new tests, rebaselined existing tests.
1861
1862         * bindings/js/JSDOMIterator.h:
1863         (WebCore::IteratorTraits>::finishCreation):
1864
1865 2019-12-20  Jer Noble  <jer.noble@apple.com>
1866
1867         MediaKeySession.load() fails
1868         https://bugs.webkit.org/show_bug.cgi?id=205467
1869
1870         Reviewed by Eric Carlson.
1871
1872         Invert the storageURL condition in load().
1873
1874         Drive-by fix: ask the group for it's sessionID, not the session, if it exists.
1875
1876         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1877         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
1878         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
1879
1880 2019-12-20  Chris Dumez  <cdumez@apple.com>
1881
1882         sendBeacon on Safari 13 seeing high failure rates
1883         https://bugs.webkit.org/show_bug.cgi?id=204665
1884         <rdar://problem/57522622>
1885
1886         Reviewed by Darin Adler.
1887
1888         Revert r245344 to try and reduce our failure rate for Beacon. This is the only change
1889         to our Beacon implementation that I am aware we made in Safari 13. Using a lower priority
1890         for Beacon makes it more likely that the Beacon load is still pending when the network
1891         process exits, which would interrupt the Beacon.
1892
1893         Since we're trying to convince developers to move away from synchronous XHR and to using
1894         the Beacon API intead, it is important that our Beacon API be as reliable as possible.
1895
1896         * Modules/beacon/NavigatorBeacon.cpp:
1897         (WebCore::NavigatorBeacon::sendBeacon):
1898         * loader/PingLoader.cpp:
1899         (WebCore::PingLoader::sendPing):
1900
1901 2019-12-20  Truitt Savell  <tsavell@apple.com>
1902
1903         Unreviewed, rolling out r253820.
1904
1905         Broke Mac testing
1906
1907         Reverted changeset:
1908
1909         "Invalidate only affected elements after media query
1910         evaluation changes"
1911         https://bugs.webkit.org/show_bug.cgi?id=205392
1912         https://trac.webkit.org/changeset/253820
1913
1914 2019-12-20  youenn fablet  <youenn@apple.com>
1915
1916         SWServer can be created without any path to store registrations in non ephemeral sessions
1917         https://bugs.webkit.org/show_bug.cgi?id=205500
1918
1919         Reviewed by Simon Fraser.
1920
1921         No change of behavior in release.
1922         Remove debug assert and log the case of a non ephemeral session without a path.
1923
1924         * workers/service/server/SWServer.cpp:
1925         (WebCore::SWServer::SWServer):
1926
1927 2019-12-20  Brian Burg  <bburg@apple.com>
1928
1929         Web Inspector: convert some InspectorFrontendHost methods to getters
1930         https://bugs.webkit.org/show_bug.cgi?id=205475
1931
1932         Reviewed by Devin Rousso.
1933
1934         No reason for these to be method calls, so expose as getters / attributes instead.
1935
1936         * inspector/InspectorFrontendClient.h:
1937         * inspector/InspectorFrontendHost.cpp:
1938         (WebCore::InspectorFrontendHost::isRemote const):
1939         (WebCore::debuggableTypeToString):
1940         (WebCore::InspectorFrontendHost::localizedStringsURL): Deleted.
1941         (WebCore::InspectorFrontendHost::backendCommandsURL): Deleted.
1942         (WebCore::InspectorFrontendHost::debuggableType): Deleted.
1943         (WebCore::InspectorFrontendHost::inspectionLevel): Deleted.
1944         (WebCore::InspectorFrontendHost::platform): Deleted.
1945         (WebCore::InspectorFrontendHost::port): Deleted.
1946         * inspector/InspectorFrontendHost.h:
1947         * inspector/InspectorFrontendHost.idl:
1948         * testing/Internals.cpp:
1949
1950 2019-12-20  Andres Gonzalez  <andresg_22@apple.com>
1951
1952         IsolatedObject support for multiple parameterized attributes.
1953         https://bugs.webkit.org/show_bug.cgi?id=205508
1954
1955         Reviewed by Chris Fleizach.
1956
1957         - AXObjectCache now keeps the PageIdentifier so that it is possible to
1958         retrieve it on the secondary thread without querying the Document.
1959         - isIncrementor is exposed on AXCoreObject for spin button support.
1960         - Several parameterized attributes implementation related to
1961         TextMarkers are now dispatch to the main thread.
1962
1963         * accessibility/AXObjectCache.cpp:
1964         (WebCore::AXObjectCache::AXObjectCache):
1965         (WebCore::AXObjectCache::setIsolatedTreeFocusedObject):
1966         (WebCore::AXObjectCache::isolatedTreeRootObject):
1967         (WebCore::AXObjectCache::remove):
1968         * accessibility/AXObjectCache.h:
1969         * accessibility/AccessibilityObject.h:
1970         * accessibility/AccessibilityObjectInterface.h:
1971         * accessibility/AccessibilitySpinButton.h:
1972         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
1973         (WebCore::AXIsolatedObject::AXIsolatedObject):
1974         (WebCore::AXIsolatedObject::initializeAttributeData):
1975         (WebCore::AXIsolatedObject::updateBackingStore):
1976         (WebCore::AXIsolatedObject::findTextRanges const):
1977         (WebCore::AXIsolatedObject::performTextOperation):
1978         (WebCore::AXIsolatedObject::axObjectCache const):
1979         (WebCore::AXIsolatedObject::widget const):
1980         (WebCore::AXIsolatedObject::document const):
1981         (WebCore::AXIsolatedObject::documentFrameView const):
1982         (WebCore::AXIsolatedObject::isLoaded const): Implemented in header.
1983         (WebCore::AXIsolatedObject::supportsPath const): Implemented in header.
1984         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
1985         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1986         (-[WebAccessibilityObjectWrapper subrole]):
1987         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1988
1989 2019-12-20  Daniel Bates  <dabates@apple.com>
1990
1991         Share code for computing the absolute positioned line boxes for a range
1992         https://bugs.webkit.org/show_bug.cgi?id=205510
1993
1994         Reviewed by Wenson Hsieh.
1995
1996         Implement RenderTextLineBoxes::absoluteRectsForRange() in terms of absoluteQuadsForRange()
1997         to remove almost identical code. This makes absoluteRectsForRange() a tiny bit slower. If
1998         it turns out this slowness isn't so tiny then we should use revert this change and implement
1999         again using templates to avoid duplication.
2000
2001         Also moved absoluteQuadsForRange() to be above absoluteRectsForRange() to group these
2002         related functions closer together.
2003
2004         * rendering/RenderTextLineBoxes.cpp:
2005         (WebCore::RenderTextLineBoxes::absoluteQuadsForRange const): No change, though I moved it
2006         to be above absoluteRectsForRange().
2007         (WebCore::RenderTextLineBoxes::absoluteRectsForRange const): Implement in terms of absoluteQuadsForRange().
2008         * rendering/RenderTextLineBoxes.h: Group absolute*ForRange() declarations.
2009
2010 2019-12-20  youenn fablet  <youenn@apple.com>
2011
2012         Remove the certificate info checks related to getUserMedia
2013         https://bugs.webkit.org/show_bug.cgi?id=205493
2014
2015         Reviewed by Eric Carlson.
2016
2017         Now that navigator.mediaDevices is SecureContext, we do not need to do the same checks in UserMediaController.
2018         UserMediaController was also checking the certificate info which is not necessary for MediaDevices.
2019         Covered by manual tests.
2020
2021         * Modules/mediastream/UserMediaController.cpp:
2022         (WebCore::isSecure):
2023         (WebCore::isAllowedByFeaturePolicy): Deleted.
2024         (WebCore::isAllowedToUse): Deleted.
2025         (WebCore::UserMediaController::canCallGetUserMedia const): Deleted.
2026         (WebCore::UserMediaController::logGetUserMediaDenial): Deleted.
2027
2028 2019-12-19  Dean Jackson  <dino@apple.com>
2029
2030         Build ANGLE as a dynamic library
2031         https://bugs.webkit.org/show_bug.cgi?id=204708
2032         rdar://57349384
2033
2034         Reviewed by Tim Horton.
2035
2036         Weak link against libANGLE-shared.dylib rather than strong link to libANGLE.a.
2037
2038         * Configurations/WebCore.xcconfig:
2039         * Configurations/WebCoreTestSupport.xcconfig:
2040         * WebCore.xcodeproj/project.pbxproj:
2041         * platform/graphics/ANGLEWebKitBridge.cpp:
2042         (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
2043         (WebCore::ANGLEWebKitBridge::cleanupCompilers):
2044         (WebCore::ANGLEWebKitBridge::compileShaderSource):
2045         (WebCore::ANGLEWebKitBridge::angleAvailable):
2046         * platform/graphics/ANGLEWebKitBridge.h:
2047         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2048         (WebCore::GraphicsContext3D::GraphicsContext3D):
2049
2050 2019-12-20  Antti Koivisto  <antti@apple.com>
2051
2052         Invalidate only affected elements after media query evaluation changes
2053         https://bugs.webkit.org/show_bug.cgi?id=205392
2054
2055         Reviewed by Zalan Bujtas.
2056
2057         We currently invalidate style of the whole tree when a media query evaluation changes.
2058         We can do better by constructing an invalidation RuleSet and invalidating only those
2059         elements that are potentially affected.
2060
2061         * style/RuleSet.cpp:
2062         (WebCore::Style::RuleSet::addRule):
2063         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
2064
2065         Construct and cache an invalidation RuleSet and associate with a set of media query changes.
2066
2067         (WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
2068         (WebCore::Style::RuleSet::MediaQueryCollector::pop):
2069         (WebCore::Style::RuleSet::MediaQueryCollector::addRuleIfNeeded):
2070
2071         Collect RuleFeatures which we later use to build invalidation RuleSet.
2072
2073         (WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded): Deleted.
2074         * style/RuleSet.h:
2075         (WebCore::Style::DynamicMediaQueryEvaluationChanges::append):
2076         * style/StyleResolver.cpp:
2077         (WebCore::Style::Resolver::evaluateDynamicMediaQueries):
2078         * style/StyleResolver.h:
2079         * style/StyleScope.cpp:
2080         (WebCore::Style::Scope::evaluateMediaQueries):
2081
2082         Use the invalidation RuleSet for accurate style invalidation.
2083
2084         * style/StyleScopeRuleSets.cpp:
2085         (WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):
2086
2087         Collect invalidation RuleSets for author/user/user agent style.
2088
2089         * style/StyleScopeRuleSets.h:
2090
2091 2019-12-20  Diego Pino Garcia  <dpino@igalia.com>
2092
2093         [GTK][WPE] Wrong visualization of Conic gradients in high resolution displays
2094         https://bugs.webkit.org/show_bug.cgi?id=205444
2095
2096         Reviewed by Carlos Alberto Lopez Perez.
2097
2098         Reduce the size of the separation between sections since a separation of
2099         1 pixel is too wide in high resolution displays.
2100
2101         * platform/graphics/cairo/GradientCairo.cpp:
2102         (WebCore::addConicSector):
2103
2104 2019-12-20  Zalan Bujtas  <zalan@apple.com>
2105
2106         Unreviewed, address review comment missed in the initial commit.
2107
2108         * layout/inlineformatting/InlineLineBreaker.h:
2109         * layout/inlineformatting/LineLayoutContext.cpp:
2110         (WebCore::Layout::LineLayoutContext::placeInlineContentOnCurrentLine):
2111         (WebCore::Layout::LineLayoutContext::commitContent):
2112
2113 2019-12-20  Zalan Bujtas  <zalan@apple.com>
2114
2115         [LFC][IFC] Refactor LineLayoutContext class
2116         https://bugs.webkit.org/show_bug.cgi?id=205494
2117         <rdar://problem/58109493>
2118
2119         Reviewed by Antti Koivisto.
2120
2121         This patch is in preparation for being able to pre-scan the inline content for soft wrap opportunities.
2122
2123         Currently processing the inline content means pushing the inline items to an uncommitted queue until after
2124         we find a soft wrap opportunity and then we ask the LineBreaker whether this uncommitted, "continuous content" can be placed
2125         on the current line.
2126         while (has unprocessed inline item) {
2127             get next inline item
2128             if (inline item is at a soft wrap opportunity)
2129                 sumbit uncommitted queue to line breaking
2130             else
2131                 add to uncommitted queue
2132         }
2133         This patch omits the uncommitted queue by collecting the inline items first. This removes some code complexity and it also
2134         helps to be able to pre-scan the content for soft wrap opportunities.
2135         while (has unprocessed inline item) {
2136             get next continuous content
2137             submit content to line breaking
2138         }
2139
2140         * layout/inlineformatting/InlineLineBreaker.cpp:
2141         (WebCore::Layout::endsWithSoftWrapOpportunity):
2142         (WebCore::Layout::LineBreaker::ContinousContent::ContinousContent):
2143         * layout/inlineformatting/InlineLineBreaker.h:
2144         (WebCore::Layout::LineBreaker::Run::Run):
2145         * layout/inlineformatting/LineLayoutContext.cpp:
2146         (WebCore::Layout::ContinousContent::hasIntrusiveFloats const):
2147         (WebCore::Layout::ContinousContent::runs const):
2148         (WebCore::Layout::ContinousContent::floats const):
2149         (WebCore::Layout::ContinousContent::endsWithLineBreak const):
2150         (WebCore::Layout::ContinousContent::setEndsWithLineBreak):
2151         (WebCore::Layout::ContinousContent::append):
2152         (WebCore::Layout::LineLayoutContext::layoutLine):
2153         (WebCore::Layout::LineLayoutContext::close):
2154         (WebCore::Layout::LineLayoutContext::nextContinousContentForLine):
2155         (WebCore::Layout::LineLayoutContext::addFloatItems):
2156         (WebCore::Layout::LineLayoutContext::placeInlineContentOnCurrentLine):
2157         (WebCore::Layout::LineLayoutContext::commitContent):
2158         (WebCore::Layout::LineLayoutContext::commitPendingContent): Deleted.
2159         (WebCore::Layout::LineLayoutContext::placeInlineItem): Deleted.
2160         (WebCore::Layout::LineLayoutContext::processUncommittedContent): Deleted.
2161         (WebCore::Layout::LineLayoutContext::UncommittedContent::append): Deleted.
2162         (WebCore::Layout::LineLayoutContext::UncommittedContent::reset): Deleted.
2163         (WebCore::Layout::LineLayoutContext::UncommittedContent::shrink): Deleted.
2164         * layout/inlineformatting/LineLayoutContext.h:
2165         (WebCore::Layout::LineLayoutContext::formattingContext const):
2166         (WebCore::Layout::LineLayoutContext::root const):
2167         (WebCore::Layout::LineLayoutContext::UncommittedContent::width const): Deleted.
2168         (WebCore::Layout::LineLayoutContext::UncommittedContent::size): Deleted.
2169         (WebCore::Layout::LineLayoutContext::UncommittedContent::isEmpty): Deleted.
2170         (WebCore::Layout::LineLayoutContext::UncommittedContent::runs const): Deleted.
2171
2172 2019-12-20  Rob Buis  <rbuis@igalia.com>
2173
2174         Fetch: handle emtpy Location value
2175         https://bugs.webkit.org/show_bug.cgi?id=205462
2176
2177         Reviewed by Youenn Fablet.
2178
2179         Handle empty Location value on redirect as specified here:
2180         https://fetch.spec.whatwg.org/#concept-http-redirect-fetch step 3
2181
2182         Tests: web-platform-tests/fetch/api/redirect/redirect-empty-location.any.html
2183                web-platform-tests/fetch/api/redirect/redirect-empty-location.any.worker.html
2184
2185         * loader/SubresourceLoader.cpp:
2186         (WebCore::SubresourceLoader::didReceiveResponse):
2187
2188 2019-12-20  youenn fablet  <youenn@apple.com>
2189
2190         DOMPromise::whenPromiseIsSettled is asserting in service worker
2191         https://bugs.webkit.org/show_bug.cgi?id=205440
2192
2193         Reviewed by Chris Dumez.
2194
2195         The promise.get(@then) is sometimes throwing an exception probably due to service worker being stopped.
2196         We need to catch the JS exception and exit early if the getter fails.
2197         Covered by existing service worker tests in debug mode.
2198
2199         * bindings/js/JSDOMPromise.cpp:
2200         (WebCore::DOMPromise::whenPromiseIsSettled):
2201
2202 2019-12-20  youenn fablet  <youenn@apple.com>
2203
2204         Make ServiceWorker::postMessage use the exec state from the JS binding layer
2205         https://bugs.webkit.org/show_bug.cgi?id=205395
2206
2207         Reviewed by Chris Dumez.
2208
2209         Instead of using ScriptExecutionContext::execState, we can ask the JS binding layer to pass the exec state and use it.
2210         Since ServiceWorker is an ActiveDOMObject, we use its scriptExecutionContext() to compute the ServiceWorker source identifier.
2211         We do the same for ServiceWorkerClient which is a context destruction observer and which only lives in Service Worker scope so calling ScriptExecutionContext::execState is suboptimal.
2212
2213         No change of behavior.
2214
2215         * workers/service/ServiceWorker.cpp:
2216         (WebCore::ServiceWorker::postMessage):
2217         * workers/service/ServiceWorker.h:
2218         * workers/service/ServiceWorker.idl:
2219         * workers/service/ServiceWorkerClient.cpp:
2220         (WebCore::ServiceWorkerClient::postMessage):
2221         * workers/service/ServiceWorkerClient.h:
2222         * workers/service/ServiceWorkerClient.idl:
2223
2224 2019-12-20  Jiewen Tan  <jiewen_tan@apple.com>
2225
2226         [WebAuthn] Implement coders for CTAP ClientPIN requests and responses
2227         https://bugs.webkit.org/show_bug.cgi?id=205376
2228         <rdar://problem/58034395>
2229
2230         Reviewed by Brent Fulgham.
2231
2232         This patch implements coders for authenticatorClientPIN requests and responses
2233         following the spec:
2234         https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN
2235
2236         Specifically, it
2237         i) implements authenticatorClientPIN subCommand: getRetries, getKeyAgreement and getPINToken;
2238         ii) adds pinAuth/pinProtocol to authenticatorMakeCredential/authenticatorGetAssertion.
2239
2240         The authenticatorClientPIN subCommands are based on a Chromium patch:
2241         https://chromium-review.googlesource.com/c/chromium/src/+/1457004 Specifically, it adopts the
2242         interfaces from that patch, but rewrites the BoringSSL-based crypto features using WebCore's
2243         WebCrypto implementation. This allows us to focus on high level crypto interfaces, and lets
2244         WebCrypto handle the underlying crypto library. Also, the original Chromium patch lacks tests.
2245         We introduce a large set of API tests to confirm proper function.
2246
2247         This patch also makes the AES CBC, EDCH, and HMAC platform* implementations public, so that
2248         these implementations can be shared by WebAuthentication and test infrastructure.
2249
2250         Covered by API tests.
2251
2252         * Modules/webauthn/WebAuthenticationConstants.h:
2253         * Modules/webauthn/cbor/CBORReader.cpp:
2254         (cbor::CBORReader::readCBORMap):
2255         Let CBORReader recognize negative map keys.
2256         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
2257         (fido::encodeMakeCredenitalRequestAsCBOR):
2258         (fido::encodeGetAssertionRequestAsCBOR):
2259         * Modules/webauthn/fido/DeviceRequestConverter.h:
2260         * Modules/webauthn/fido/Pin.cpp: Added.
2261         (fido::pin::hasAtLeastFourCodepoints):
2262         (fido::pin::makePinAuth):
2263         (fido::pin::encodeRawPublicKey):
2264         (fido::pin::validateAndConvertToUTF8):
2265         (fido::pin::encodePinCommand):
2266         (fido::pin::RetriesResponse::parse):
2267         (fido::pin::KeyAgreementResponse::KeyAgreementResponse):
2268         (fido::pin::KeyAgreementResponse::parse):
2269         (fido::pin::KeyAgreementResponse::parseFromCOSE):
2270         (fido::pin::encodeCOSEPublicKey):
2271         (fido::pin::TokenResponse::TokenResponse):
2272         (fido::pin::TokenResponse::parse):
2273         (fido::pin::TokenResponse::pinAuth const):
2274         (fido::pin::TokenResponse::token const):
2275         (fido::pin::encodeAsCBOR):
2276         (fido::pin::TokenRequest::tryCreate):
2277         (fido::pin::TokenRequest::TokenRequest):
2278         (fido::pin::TokenRequest::sharedKey const):
2279         * Modules/webauthn/fido/Pin.h: Added.
2280         * Sources.txt:
2281         * WebCore.xcodeproj/project.pbxproj:
2282         * crypto/CryptoAlgorithm.h:
2283         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2284         * crypto/algorithms/CryptoAlgorithmECDH.h:
2285         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2286         * crypto/keys/CryptoKeyAES.cpp:
2287         * crypto/keys/CryptoKeyAES.h:
2288         * crypto/keys/CryptoKeyEC.h:
2289         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2290         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2291         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2292         * crypto/mac/CryptoKeyRSAMac.cpp:
2293         (WebCore::CryptoKeyRSA::algorithm const):
2294
2295 2019-12-19  Doug Kelly  <dougk@apple.com>
2296
2297         Update TrackBase to store m_mediaElement as a WeakPtr
2298         https://bugs.webkit.org/show_bug.cgi?id=205460
2299
2300         Reviewed by Eric Carlson.
2301
2302         Store the HTMLMediaElement in TrackBase and related classes as a WeakPtr to give some proper idea of pointer lifetime, since while the
2303         HTMLMediaElement is optional, if set, it should be a valid HTMLMediaElement.
2304
2305         No new tests since no functionality changed.
2306
2307         * Modules/mediasource/SourceBuffer.cpp:
2308         (WebCore::SourceBuffer::videoTracks):
2309         (WebCore::SourceBuffer::audioTracks):
2310         (WebCore::SourceBuffer::textTracks):
2311         * html/HTMLMediaElement.cpp:
2312         (WebCore::HTMLMediaElement::textTrackModeChanged):
2313         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
2314         (WebCore::HTMLMediaElement::ensureAudioTracks):
2315         (WebCore::HTMLMediaElement::ensureTextTracks):
2316         (WebCore::HTMLMediaElement::ensureVideoTracks):
2317         * html/track/AudioTrack.cpp:
2318         (WebCore::AudioTrack::willRemove):
2319         (WebCore::AudioTrack::setMediaElement):
2320         * html/track/AudioTrack.h:
2321         * html/track/AudioTrackList.cpp:
2322         (WebCore::AudioTrackList::AudioTrackList):
2323         * html/track/AudioTrackList.h:
2324         * html/track/InbandTextTrack.cpp:
2325         (WebCore::InbandTextTrack::willRemove):
2326         (WebCore::InbandTextTrack::setMediaElement):
2327         * html/track/InbandTextTrack.h:
2328         * html/track/TextTrackList.cpp:
2329         (WebCore::TextTrackList::TextTrackList):
2330         * html/track/TextTrackList.h:
2331         * html/track/TrackBase.cpp:
2332         (WebCore::TrackBase::element):
2333         (WebCore::TrackBase::setMediaElement):
2334         * html/track/TrackBase.h:
2335         (WebCore::TrackBase::mediaElement):
2336         * html/track/TrackListBase.cpp:
2337         (WebCore::TrackListBase::TrackListBase):
2338         (WebCore::TrackListBase::element const):
2339         * html/track/TrackListBase.h:
2340         (WebCore::TrackListBase::mediaElement const):
2341         * html/track/VideoTrack.cpp:
2342         (WebCore::VideoTrack::willRemove):
2343         (WebCore::VideoTrack::setMediaElement):
2344         * html/track/VideoTrack.h:
2345         * html/track/VideoTrackList.cpp:
2346         (WebCore::VideoTrackList::VideoTrackList):
2347         * html/track/VideoTrackList.h:
2348
2349 2019-12-19  Doug Kelly  <dougk@apple.com>
2350
2351         Invalid assert with tracks not associated to media element
2352         https://bugs.webkit.org/show_bug.cgi?id=205360
2353
2354         Reviewed by Eric Carlson.
2355
2356         Remove asserts around TextTrack when not attached to a media element and instead return a zero index.
2357
2358         * html/track/TextTrack.cpp:
2359         (WebCore::TextTrack::trackIndex):
2360         (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
2361
2362 2019-12-19  Sihui Liu  <sihui_liu@apple.com>
2363
2364         IndexedDB: remove timer for pending operations in IDBTransaction
2365         https://bugs.webkit.org/show_bug.cgi?id=205312
2366
2367         Reviewed by Brady Eidson.
2368
2369         When pendingOperationTimer fired, IDBTransasction would try processing pending operations or commiting 
2370         automatically.
2371         pendingOperationTimer was scheduled when some conditions changed and IDBTransaction could start processing 
2372         pending operations or start commiting, for example, when new pending operations was created.
2373
2374         For better performance, we may start processing right away after the condition change, without using a Timer.
2375         This patch gives us about 10% speed up on test: PerformanceTests/IndexedDB/basic/objectstore-cursor.html.
2376
2377         * Modules/indexeddb/IDBRequest.cpp:
2378         (WebCore::IDBRequest::dispatchEvent):
2379         * Modules/indexeddb/IDBTransaction.cpp:
2380         (WebCore::IDBTransaction::IDBTransaction):
2381         (WebCore::IDBTransaction::abortInProgressOperations):
2382         (WebCore::IDBTransaction::removeRequest):
2383         (WebCore::IDBTransaction::scheduleOperation):
2384         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
2385         (WebCore::IDBTransaction::didStart):
2386         (WebCore::IDBTransaction::operationCompletedOnClient):
2387         (WebCore::IDBTransaction::deactivate):
2388         (WebCore::IDBTransaction::connectionClosedFromServer):
2389         (WebCore::IDBTransaction::handlePendingOperations):
2390         (WebCore::IDBTransaction::autoCommit):
2391         (WebCore::IDBTransaction::trySchedulePendingOperationTimer): Deleted.
2392         (WebCore::IDBTransaction::pendingOperationTimerFired): Deleted.
2393         * Modules/indexeddb/IDBTransaction.h:
2394
2395 2019-12-19  Jack Lee  <shihchieh_lee@apple.com>
2396
2397         Nullptr crash in WebCore::RenderTreeBuilder::attach
2398         https://bugs.webkit.org/show_bug.cgi?id=205476
2399
2400         Reviewed by Ryosuke Niwa.
2401
2402         Test: fast/ruby/crash-insert-duplicate-rt-element.html
2403
2404         * rendering/updating/RenderTreeBuilderRuby.cpp:
2405         (WebCore::RenderTreeBuilder::Ruby::attach):
2406
2407 2019-12-19  Jack Lee  <shihchieh_lee@apple.com>
2408
2409         Nullptr crash in WebCore::findPlaceForCounter with display: contents parent
2410         https://bugs.webkit.org/show_bug.cgi?id=205290
2411
2412         Reviewed by Ryosuke Niwa.
2413
2414         Test: fast/css/counters/findPlaceForCounter-crash.html
2415
2416         * rendering/RenderCounter.cpp:
2417         (WebCore::parentOrPseudoHostElement):
2418
2419 2019-12-19  Chris Dumez  <cdumez@apple.com>
2420
2421         REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flaky failure
2422         https://bugs.webkit.org/show_bug.cgi?id=205164
2423         <rdar://problem/57879042>
2424
2425         Reviewed by Ryosuke Niwa.
2426
2427         Submitting a form should cancel any pending navigation scheduled by a previous submission of this form:
2428         - https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm (step 22.3)
2429
2430         No new tests, rebaselined existing tests.
2431
2432         Test: fast/forms/form-double-submission.html
2433
2434         * html/HTMLFormElement.cpp:
2435         (WebCore::HTMLFormElement::submit):
2436         * html/HTMLFormElement.h:
2437         * loader/FormSubmission.h:
2438         (WebCore::FormSubmission::cancel):
2439         (WebCore::FormSubmission::wasCancelled const):
2440
2441         * loader/FrameLoader.cpp:
2442         (WebCore::FrameLoader::submitForm):
2443         Drop previous non-standard compliant logic to avoid double-form submission.
2444
2445         * loader/NavigationScheduler.cpp:
2446
2447 2019-12-19  Ryosuke Niwa  <rniwa@webkit.org>
2448
2449         Make ShadowRoot.delegateFocus work in iOS
2450         https://bugs.webkit.org/show_bug.cgi?id=202875
2451
2452         Reviewed by Wenson Hsieh.
2453
2454         This patch fixes the bug that a shadow tree doesn't recieve focus delegation even if the shadow host
2455         had delegateFocus flag set unless the shadow host itself is focusable beacuse Frame's
2456         nodeRespondingToClickEvents and friends would return false on the shadow host.
2457
2458         Test: fast/shadow-dom/delegates-focus-by-activation.html
2459
2460         * page/ios/FrameIOS.mm:
2461         (WebCore::nodeIsMouseFocusable): Added the logic to handle shadow hosts whose shadow root has
2462         delegates focus flag set.
2463         (WebCore::nodeWillRespondToMouseEvents): Extracted out of approximateNodeAtViewportLocationLegacy.
2464         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
2465         (WebCore::ancestorRespondingToClickEventsNodeQualifier):
2466
2467 2019-12-19  Kate Cheney  <katherine_cheney@apple.com>
2468
2469         Activate the SQLite database as an on-by-default feature
2470         https://bugs.webkit.org/show_bug.cgi?id=204774
2471         <rdar://problem/57592141>
2472
2473         Reviewed by Brent Fulgham.
2474
2475         The ITP SQLite database should be on by default.
2476
2477         * page/RuntimeEnabledFeatures.h:
2478
2479 2019-12-19  Per Arne Vollan  <pvollan@apple.com>
2480
2481         REGRESSION (r253530): Incorrect colors in Dark Mode
2482         https://bugs.webkit.org/show_bug.cgi?id=205457
2483
2484         Unreviewed rollout of r253530.
2485
2486         * WebCore.xcodeproj/project.pbxproj:
2487         * rendering/CSSValueKey.h: Removed.
2488         * rendering/RenderThemeIOS.h:
2489         * rendering/RenderThemeIOS.mm:
2490         (WebCore::RenderThemeIOS::systemColor const):
2491         (WebCore::cssValueIDSelectorList): Deleted.
2492         (WebCore::systemColorFromCSSValueID): Deleted.
2493         (WebCore::globalCSSValueToSystemColorMap): Deleted.
2494         (WebCore::RenderThemeIOS::getOrCreateCSSValueToSystemColorMap): Deleted.
2495         (WebCore::RenderThemeIOS::setCSSValueToSystemColorMap): Deleted.
2496
2497 2019-12-19  James Darpinian  <jdarpinian@chromium.org>
2498
2499         ANGLE: Fix last WebGL conformance regressions
2500         https://bugs.webkit.org/show_bug.cgi?id=205306
2501
2502         Fixes the last few WebGL conformance regressions when enabling ANGLE on AMD GPUs on Mac.
2503         The combination of alpha:false and antialias:true was broken, and validation of
2504         non-ascii characters in comments was broken by a recent change to the test.
2505
2506         Reviewed by Dean Jackson.
2507
2508         * html/canvas/WebGLRenderingContextBase.cpp:
2509         (WebCore::WebGLRenderingContextBase::shaderSource):
2510         * platform/graphics/angle/GraphicsContext3DANGLE.cpp:
2511         (WebCore::GraphicsContext3D::reshapeFBOs):
2512
2513 2019-12-19  Alan Bujtas  <zalan@apple.com>
2514
2515         Unreviewed, rolling out r253711.
2516
2517         Broke two tests on Mac and iOS
2518
2519         Reverted changeset:
2520
2521         "[LFC][IFC] LineLayoutContext::m_uncommittedList is not always
2522         a continuous list of runs"
2523         https://bugs.webkit.org/show_bug.cgi?id=205404
2524         https://trac.webkit.org/changeset/253711
2525
2526 2019-12-19  Andres Gonzalez  <andresg_22@apple.com>
2527
2528         AXIsolatedObject::findMatchingObjects implementation.
2529         https://bugs.webkit.org/show_bug.cgi?id=205428
2530
2531         Reviewed by Chris Fleizach.
2532
2533         This method is exercised by several layout tests such as
2534         accessibility/mac/search-predicate.html.
2535
2536         - Moved the search algorithm in the implementation of
2537         AccessibilityObject::findMatchingObjects to the Accessibility namespace,
2538         so that it can be used in AXIsolatedObject as well.
2539         - Static helper functions are also moved into the Accessibility
2540         namespace.
2541         - Changed the signature of containsText to be more appropriate and in
2542         line with other methods.
2543
2544         * accessibility/AccessibilityObject.cpp:
2545         (WebCore::AccessibilityObject::containsText const):
2546         (WebCore::AccessibilityObject::findMatchingObjects):
2547         (WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex): Moved from AccessibilityObject.
2548         (WebCore::Accessibility::isAccessibilityObjectSearchMatch): Moved from AccessibilityObject.
2549         (WebCore::Accessibility::isAccessibilityTextSearchMatch): Moved from AccessibilityObject.
2550         (WebCore::Accessibility::objectMatchesSearchCriteriaWithResultLimit): Moved from AccessibilityObject.
2551         (WebCore::Accessibility::findMatchingObjects): Search algorithm to be reused by AccessibilityObject and AXIsolatedObject.
2552         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex): Moved.
2553         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatch): Moved.
2554         (WebCore::AccessibilityObject::isAccessibilityTextSearchMatch): Moved.
2555         (WebCore::AccessibilityObject::objectMatchesSearchCriteriaWithResultLimit): Moved.
2556         * accessibility/AccessibilityObject.h:
2557         * accessibility/AccessibilityObjectInterface.h:
2558         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
2559         (WebCore::AXIsolatedObject::findMatchingObjects):
2560         (WebCore::AXIsolatedObject::containsText const):
2561         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
2562
2563 2019-12-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2564
2565         pal/FileSizeFormatter.h declares fileSizeDescription in the top-level namespace
2566         https://bugs.webkit.org/show_bug.cgi?id=205453
2567
2568         Reviewed by Tim Horton.
2569
2570         Change fileSizeDescription to PAL::fileSizeDescription. No change in behavior.
2571
2572         * html/HTMLAttachmentElement.cpp:
2573         (WebCore::HTMLAttachmentElement::setFile):
2574         (WebCore::HTMLAttachmentElement::updateAttributes):
2575
2576 2019-12-19  Chris Dumez  <cdumez@apple.com>
2577
2578         imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-installed.https.html is flaky
2579         https://bugs.webkit.org/show_bug.cgi?id=205408
2580
2581         Reviewed by Youenn Fablet.
2582
2583         imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-installed.https.html has been
2584         flaky since it was imported. We now queue a task on the HTML event loop to resolve the skipWaiting promise
2585         so that its ordering is correct, between the active event being fired and the service worker state becoming
2586         "activated".
2587
2588         No new tests, upskipped existing test.
2589
2590         * workers/service/ServiceWorkerGlobalScope.cpp:
2591         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
2592         * workers/service/context/SWContextManager.h:
2593         * workers/service/server/SWServerToContextConnection.cpp:
2594         (WebCore::SWServerToContextConnection::skipWaiting):
2595         * workers/service/server/SWServerToContextConnection.h:
2596
2597 2019-12-19  Chris Dumez  <cdumez@apple.com>
2598
2599         Stop blocking the worker thread in WorkerMessagePortChannelProvider::postMessageToRemote()
2600         https://bugs.webkit.org/show_bug.cgi?id=205414
2601
2602         Reviewed by Youenn Fablet.
2603
2604         Stop blocking the worker thread in WorkerMessagePortChannelProvider::postMessageToRemote() as it does not appear
2605         to be needed and it badly impacts performance. This basically replaces a callOnMainThreadAndWait
2606         call (which was added in r249378 as part of a refactoring) with a callOnMainThread call.
2607
2608         This makes fast/workers/worker-cloneport.html runs twice as fast on my machine, which is important
2609         because this test is so slow it is timing out in some configurations.
2610
2611         * dom/MessagePort.cpp:
2612         (WebCore::MessagePort::postMessage):
2613         * dom/messageports/MessagePortChannelProvider.h:
2614         * dom/messageports/MessagePortChannelProviderImpl.cpp:
2615         (WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
2616         * dom/messageports/MessagePortChannelProviderImpl.h:
2617         * dom/messageports/WorkerMessagePortChannelProvider.cpp:
2618         (WebCore::WorkerMessagePortChannelProvider::postMessageToRemote):
2619         * dom/messageports/WorkerMessagePortChannelProvider.h:
2620
2621 2019-12-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2622
2623         REGRESSION (r251015): Hitting return before a space deletes text after the insertion position
2624         https://bugs.webkit.org/show_bug.cgi?id=205425
2625         <rdar://problem/57575960>
2626
2627         Reviewed by Tim Horton.
2628
2629         After r251015, we (rightfully) no longer call ensureLineBoxes() when computing upstream or downstream positions.
2630         However, logic in deleteInsignificantTextDownstream (which is invoked after hitting return before a space in a
2631         text node) assumes that line boxes must be generated for the RenderText of the text node containing the
2632         downstream position. The lack of inline text boxes then causes deleteInsignificantText to always remove the
2633         entire text node.
2634
2635         To fix this, have deleteInsignificantText ensure that line boxes exist for the text node's renderer, right
2636         before asking for the renderer's line boxes.
2637
2638         Test: editing/inserting/insert-paragraph-before-space.html
2639
2640         * editing/CompositeEditCommand.cpp:
2641         (WebCore::CompositeEditCommand::deleteInsignificantText):
2642
2643 2019-12-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2644
2645         [GTK][WPE] Add initial API for input method
2646         https://bugs.webkit.org/show_bug.cgi?id=204679
2647
2648         Reviewed by Žan Doberšek.
2649
2650         * platform/PlatformKeyboardEvent.h: Also define handledByInputMethod() for WPE port.
2651
2652 2019-12-19  Charlie Turner  <cturner@igalia.com>
2653
2654         [GStreamer][EME] Notify all elements waiting for CDM attachment
2655         https://bugs.webkit.org/show_bug.cgi?id=205382
2656
2657         Reviewed by Xabier Rodriguez-Calvar.
2658
2659         When multiple demuxers are in flight asking for a CDM instance,
2660         only one of them was getting woken up when a CDM was attached,
2661         leaving the other(s) blocking their respective streaming threads
2662         and locking the pipeline. Switch back to a condition variable from
2663         a semaphore to fix this issue.
2664
2665         Covered by existing tests.
2666
2667         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2668         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2669         Initialize the new isPlayerShuttingDown predicate to false.
2670         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2671         Set the new predicate for player shutdown at the start of
2672         destruction, so that background threads can known when the should
2673         abort their operations as a result of being unblocked by the
2674         destructor.
2675         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Go back
2676         to using condition variables, so we can unblock more than one
2677         waiter.
2678         (WebCore::MediaPlayerPrivateGStreamer::cdmInstanceAttached):
2679         Helper predicate to make clear that the presence of a valid
2680         CDMInstance pointer is a sign that it has been attached.
2681         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
2682         an isPlayerShuttingDown method using an Atomic<bool>. We need this
2683         to avoid racing set_context() on a decryptor element with the
2684         pipeline being set to NULL. Before we were using the notifier as a
2685         proxy for player shutdown, since it is invalidated during player
2686         destruction. This is not a maintainable solution, since other
2687         programmers would feel free to reorder the position at which the
2688         notifier is invalidated, and then introduce a very hard to find
2689         bug. By introducing this flag at the start of destruction, we will
2690         always have a known way to check, after a streaming thread has
2691         woken up again, whether we should call any player methods, or
2692         return early due to shutdown in progress.
2693         (WebCore::MediaPlayerPrivateGStreamer::isPlayerShuttingDown
2694         const): Predicate for player in the process of shutdown. This
2695         should be used by background threads, which upon wakeup, may need
2696         to be aware of whether they will be in a race with the pipeline
2697         going to NULL.
2698         (WebCore::MediaPlayerPrivateGStreamer::isCDMAttached const):
2699
2700 2019-12-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2701
2702         [CoordinatedGraphics] ThreadedDisplayRefreshMonitor is never released
2703         https://bugs.webkit.org/show_bug.cgi?id=205387
2704
2705         Reviewed by Žan Doberšek.
2706
2707         The problem is that DisplayRefreshMonitorManager::createMonitorForClient() always creates a new one for
2708         RenderingUpdateScheduler because it's not notified of the window screen change. So,
2709         createDisplayRefreshMonitor() is called every time, which returns a reference of the same object, but it's added
2710         to the monitors vector of DisplayRefreshMonitorManager and never removed from there.
2711
2712         * page/Chrome.cpp:
2713         (WebCore::Chrome::windowScreenDidChange): Notify the RenderingUpdateScheduler about the screen change.
2714         * page/RenderingUpdateScheduler.h: Make windowScreenDidChange public.
2715
2716 2019-12-19  youenn fablet  <youenn@apple.com>
2717
2718         Safari resumes autoplay audio elements after getUserMedia
2719         https://bugs.webkit.org/show_bug.cgi?id=197688
2720         <rdar://problem/57674395>
2721
2722         Reviewed by Eric Carlson.
2723
2724         Covered by updated test.
2725
2726         * html/HTMLMediaElement.cpp:
2727         (WebCore::HTMLMediaElement::mediaStreamCaptureStarted):
2728         Previously, we were piggybacking on resuming autoplay, which happens after interuption.
2729         This is incorrect as it tries to play paused elements.
2730         Instead we just try to play a media element if it can autoplay without changing the m_autoplaying value.
2731         * html/HTMLMediaElement.h:
2732         (WebCore::HTMLMediaElement::mediaStreamCaptureStarted): Deleted.
2733
2734 2019-12-18  Sihui Liu  <sihui_liu@apple.com>
2735
2736         IndexedDB: perform IDBServer work only on background thread
2737         https://bugs.webkit.org/show_bug.cgi?id=203690
2738         <rdar://problem/56908496>
2739
2740         Reviewed by Alex Christensen.
2741
2742         The basic workflow of IDB server side was:
2743         1. IPC thread dispatches IDB messages to main thread
2744         2. main thread handles messages and dispatches database tasks to IDB thread
2745         3. IDB thread finishes work and dispatches task result to main thread
2746         4. main thread sends IPC messages with task results
2747
2748         For better performance, this patch changes the workflow to:
2749         1. IPC thread dispatches IDB messages to IDB thread
2750         2. IDB thread handles messages, perform tasks and sends IPC messages with task results
2751         In this way, we can avoid the cost of thread hopping to main thread.
2752
2753         Previously IDBServer and UniqueIDBDatabase were created on the main thread and may be accessed from IDB 
2754         thread, and now they are created on the IDB thread only. Therefore, we don't need all those variables
2755         used to sync the database status between main thread and background thread, and the logic becomes simpler.
2756
2757         This patch also removes timer in UniqueIDBDatabase for better performance.
2758
2759         Covered by existing tests.
2760
2761         * Modules/indexeddb/IDBDatabase.cpp:
2762         (WebCore::IDBDatabase::didCloseFromServer): IDBClient no longer needs to confirm connection close initiated by
2763         IDBServer. When IDBServer closes the connection, it would remove the connection from the open connection set 
2764         right away.
2765         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2766         (WebCore::IDBClient::IDBConnectionProxy::didCloseFromServer): 
2767         (WebCore::IDBClient::IDBConnectionProxy::confirmDidCloseFromServer): Deleted.
2768         * Modules/indexeddb/client/IDBConnectionProxy.h:
2769         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2770         (WebCore::IDBClient::IDBConnectionToServer::confirmDidCloseFromServer): Deleted.
2771         * Modules/indexeddb/client/IDBConnectionToServer.h:
2772         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2773         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2774         (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
2775         * Modules/indexeddb/server/IDBConnectionToClient.h:
2776         (WebCore::IDBServer::IDBConnectionToClient::clearDelegate):
2777         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2778
2779         * Modules/indexeddb/server/IDBServer.cpp: Add threading assertions everywhere for safety. Also, as IDBServer
2780         may be accessed on main thread for process suspension, we need to assert lock of IDBServer is held everywhere.
2781         (WebCore::IDBServer::IDBServer::IDBServer):
2782         (WebCore::IDBServer::IDBServer::~IDBServer):
2783         (WebCore::IDBServer::IDBServer::registerConnection):
2784         (WebCore::IDBServer::IDBServer::unregisterConnection):
2785         (WebCore::IDBServer::IDBServer::registerTransaction):
2786         (WebCore::IDBServer::IDBServer::unregisterTransaction):
2787         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
2788         (WebCore::IDBServer::IDBServer::openDatabase):
2789         (WebCore::IDBServer::IDBServer::deleteDatabase):
2790         (WebCore::IDBServer::IDBServer::abortTransaction):
2791         (WebCore::IDBServer::IDBServer::createObjectStore):
2792         (WebCore::IDBServer::IDBServer::deleteObjectStore):
2793         (WebCore::IDBServer::IDBServer::renameObjectStore):
2794         (WebCore::IDBServer::IDBServer::clearObjectStore):
2795         (WebCore::IDBServer::IDBServer::createIndex):
2796         (WebCore::IDBServer::IDBServer::deleteIndex):
2797         (WebCore::IDBServer::IDBServer::renameIndex):
2798         (WebCore::IDBServer::IDBServer::putOrAdd):
2799         (WebCore::IDBServer::IDBServer::getRecord):
2800         (WebCore::IDBServer::IDBServer::getAllRecords):
2801         (WebCore::IDBServer::IDBServer::getCount):
2802         (WebCore::IDBServer::IDBServer::deleteRecord):
2803         (WebCore::IDBServer::IDBServer::openCursor):
2804         (WebCore::IDBServer::IDBServer::iterateCursor):
2805         (WebCore::IDBServer::IDBServer::establishTransaction):
2806         (WebCore::IDBServer::IDBServer::commitTransaction):
2807         (WebCore::IDBServer::IDBServer::didFinishHandlingVersionChangeTransaction):
2808         (WebCore::IDBServer::IDBServer::databaseConnectionPendingClose):
2809         (WebCore::IDBServer::IDBServer::databaseConnectionClosed):
2810         (WebCore::IDBServer::IDBServer::abortOpenAndUpgradeNeeded):
2811         (WebCore::IDBServer::IDBServer::didFireVersionChangeEvent):
2812         (WebCore::IDBServer::IDBServer::openDBRequestCancelled):
2813         (WebCore::IDBServer::IDBServer::getAllDatabaseNames):
2814         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2815         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
2816         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
2817         (WebCore::IDBServer::IDBServer::requestSpace):
2818         (WebCore::IDBServer::IDBServer::stopDatabaseActivitiesOnMainThread):
2819         (WebCore::IDBServer::IDBServer::create): Deleted.
2820         (WebCore::IDBServer::IDBServer::confirmDidCloseFromServer): Deleted.
2821         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames): Deleted.
2822         (WebCore::IDBServer::IDBServer::didGetAllDatabaseNames): Deleted.
2823         (WebCore::IDBServer::IDBServer::postDatabaseTask): Deleted. IDBServer is on the background thread only. This 
2824         functionality is moved to its parent (WebIDBServer/InProcessIDBServer).
2825         (WebCore::IDBServer::IDBServer::postDatabaseTaskReply): Deleted.
2826         (WebCore::IDBServer::generateDeleteCallbackID): Deleted.
2827         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince): Deleted. Merged to 
2828         closeAndDeleteDatabasesModifiedSince.
2829         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins): Deleted. Merged to 
2830         closeAndDeleteDatabasesForOrigins.
2831         (WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases): Deleted.
2832         (WebCore::IDBServer::IDBServer::tryStop): Deleted.
2833         (WebCore::IDBServer::IDBServer::resume): Deleted.
2834         * Modules/indexeddb/server/IDBServer.h:
2835         (WebCore::IDBServer::IDBServer::lock):
2836
2837         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Biggest changes are:
2838         1. merge all perform[Task] and didPerform[Task] functions into [Task] functions.
2839         2. remove all database members used to track state between main thread and database thread, because the tasks
2840         are executed in order on one background thread.
2841         3. m_operationAndTransactionTimer is removed. operationAndTransactionTimerFired is replaced by two functions:
2842         handleDatabaseOperations and handleTransactions. And these functions are placed at places where we schedule the 
2843         timer.
2844         4. lock is moved to IDBServer because UniqueIDBDatabase will never be accessed from different threads.
2845         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
2846         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
2847         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
2848         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
2849         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
2850         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
2851         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2852         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2853         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
2854         (WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
2855         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
2856         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
2857         (WebCore::IDBServer::UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent):
2858         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
2859         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
2860         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
2861         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
2862         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
2863         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
2864         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
2865         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
2866         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
2867         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
2868         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
2869         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
2870         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
2871         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
2872         (WebCore::IDBServer::UniqueIDBDatabase::prefetchCursor):
2873         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
2874         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
2875         (WebCore::IDBServer::UniqueIDBDatabase::didFinishHandlingVersionChange):
2876         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
2877         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromServer):
2878         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
2879         (WebCore::IDBServer::UniqueIDBDatabase::handleTransactions):
2880         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
2881         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
2882         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
2883         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2884         (WebCore::IDBServer::UniqueIDBDatabase::abortActiveTransactions):
2885         (WebCore::IDBServer::UniqueIDBDatabase::close):
2886         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableRequest):
2887         (WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks const): Deleted.
2888         (WebCore::IDBServer::UniqueIDBDatabase::isVersionChangeInProgress): Deleted.
2889         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore): Deleted.
2890         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose): Deleted.
2891         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose): Deleted.
2892         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose): Deleted.
2893         (WebCore::IDBServer::UniqueIDBDatabase::generateUniqueCallbackIdentifier): Deleted.
2894         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError): Deleted.
2895         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction): Deleted.
2896         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction): Deleted.
2897         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore): Deleted.
2898         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore): Deleted.
2899         (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore): Deleted.
2900         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateObjectStore): Deleted.
2901         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore): Deleted.
2902         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteObjectStore): Deleted.
2903         (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore): Deleted.
2904         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore): Deleted.
2905         (WebCore::IDBServer::UniqueIDBDatabase::performClearObjectStore): Deleted.
2906         (WebCore::IDBServer::UniqueIDBDatabase::didPerformClearObjectStore): Deleted.
2907         (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex): Deleted.
2908         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateIndex): Deleted.
2909         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex): Deleted.
2910         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex): Deleted.
2911         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex): Deleted.
2912         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex): Deleted.
2913         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Deleted.
2914         (WebCore::IDBServer::UniqueIDBDatabase::didPerformPutOrAdd): Deleted.
2915         (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord): Deleted.
2916         (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord): Deleted.
2917         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetRecord): Deleted.
2918         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords): Deleted.
2919         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetAllRecords): Deleted.
2920         (WebCore::IDBServer::UniqueIDBDatabase::performGetCount): Deleted.
2921         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetCount): Deleted.
2922         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteRecord): Deleted.
2923         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteRecord): Deleted.
2924         (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor): Deleted.
2925         (WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor): Deleted.
2926         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor): Deleted.
2927         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor): Deleted.
2928         (WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor): Deleted.
2929         (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction): Deleted.
2930         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction): Deleted.
2931         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction): Deleted.
2932         (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction): Deleted.
2933         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction): Deleted.
2934         (WebCore::IDBServer::UniqueIDBDatabase::transactionDestroyed): Deleted.
2935         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer): Deleted.
2936         (WebCore::IDBServer::UniqueIDBDatabase::isCurrentlyInUse const): Deleted.
2937         (WebCore::IDBServer::UniqueIDBDatabase::hasUnfinishedTransactions const): Deleted.
2938         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer): Deleted.
2939         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired): Deleted.
2940         (WebCore::IDBServer::UniqueIDBDatabase::performActivateTransactionInBackingStore): Deleted.
2941         (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore): Deleted.
2942         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask): Deleted.
2943         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply): Deleted.
2944         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask): Deleted.
2945         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply): Deleted.
2946         (WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose): Deleted.
2947         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose): Deleted.
2948         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback): Deleted.
2949         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback): Deleted.
2950         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback): Deleted.
2951         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback): Deleted.
2952         (WebCore::IDBServer::UniqueIDBDatabase::performCountCallback): Deleted.
2953         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback): Deleted.
2954         (WebCore::IDBServer::UniqueIDBDatabase::abortTransactionOnMainThread): Deleted.
2955         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionOnMainThread): Deleted.
2956         (WebCore::IDBServer::UniqueIDBDatabase::suspend): Deleted.
2957         (WebCore::IDBServer::UniqueIDBDatabase::resume): Deleted.
2958         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2959         (WebCore::IDBServer::UniqueIDBDatabase::server):
2960         (WebCore::IDBServer::UniqueIDBDatabase::hardClosedForUserDelete const): Deleted.
2961         (): Deleted.
2962
2963         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: The callbacks will be called right away, so there
2964         is no need to keep weak pointers.
2965         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
2966         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
2967         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
2968         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
2969         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
2970         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
2971         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
2972         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
2973         (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer): Deleted.
2974         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2975         (WebCore::IDBServer::UniqueIDBDatabaseConnection::database):
2976         (WebCore::IDBServer::UniqueIDBDatabaseConnection::server):
2977         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2978         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
2979         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
2980         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
2981         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
2982         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
2983         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
2984         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
2985         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
2986         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
2987         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
2988         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
2989         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
2990         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
2991         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
2992         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
2993         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
2994         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
2995         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
2996         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2997         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::databaseConnection):
2998         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setMainThreadAbortResult):
2999         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::mainThreadAbortResult const):
3000         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setState): Deleted.
3001         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::state const): Deleted.
3002         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setResult): Deleted.
3003         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::result const): Deleted.
3004         (): Deleted.
3005         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3006         (WebCore::nextServerResourceNumber):
3007         * loader/EmptyClients.cpp:
3008
3009 2019-12-18  Devin Rousso  <drousso@apple.com>
3010
3011         Web Inspector: Elements: restrict showing paint flashing and compositing borders to the Web Inspector session
3012         https://bugs.webkit.org/show_bug.cgi?id=205201
3013
3014         Reviewed by Timothy Hatcher.
3015
3016         We often get bugs from users who turn on paint flashing or compositing borders, close Web
3017         Inspector, reopen Web Inspector, and are then surprised when the page flashes red or these
3018         borders exist all over the page.
3019
3020         Given that the dark mode and print styles toggles are limited to the Web Inspector session,
3021         we should make these have the same behavior.
3022
3023         * page/Settings.yaml:
3024         * inspector/agents/InspectorPageAgent.h:
3025         * inspector/agents/InspectorPageAgent.cpp:
3026         (WebCore::InspectorPageAgent::getCompositingBordersVisible): Deleted.
3027         (WebCore::InspectorPageAgent::setCompositingBordersVisible): Deleted.
3028         Allow Web Inspector to override the `showDebugBorders` and `showRepaintCounter` settings via
3029         the `inspectorOverride` key, rather than setting them manually via a special `Page` command.
3030
3031 2019-12-18  Tim Horton  <timothy_horton@apple.com>
3032
3033         macCatalyst: Cursor should update when the platform deems it necessary
3034         https://bugs.webkit.org/show_bug.cgi?id=205429
3035         <rdar://problem/57983076>
3036
3037         Reviewed by Wenson Hsieh.
3038
3039         * page/EventHandler.h:
3040         Expose selectCursor for WebKit's use.
3041
3042 2019-12-18  Antoine Quint  <graouts@apple.com>
3043
3044         Animations stop if new tab opened (and closed)
3045         https://bugs.webkit.org/show_bug.cgi?id=202360
3046         <rdar://problem/55923261>
3047
3048         Reviewed by Dean Jackson.
3049
3050         In the case where we would have a fill-forwards software animation when an animation that could be
3051         accelerated started, we would fail to start an accelerated animation because we had no composited
3052         renderer. However, we would still advertise a state of "running accelerated" and the DocumentTimeline
3053         would not schedule ticks to run the animation in software.
3054
3055         We now only schedule accelerated animations once their delay phase is over and the animation is in its
3056         "active" phase, which helps to only schedule accelerated animations once they actually have an effect
3057         that is worth accelerating, and reset pending accelerated actions in case we try to start an accelerated
3058         animation but fail to because we don't have a composited renderer.
3059
3060         Test: webanimations/animation-of-accelerated-property-after-non-accelerated-property.html
3061
3062         * animation/KeyframeEffect.cpp:
3063         (WebCore::KeyframeEffect::apply):
3064         (WebCore::KeyframeEffect::updateAcceleratedAnimationState):
3065         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
3066         * animation/KeyframeEffect.h:
3067
3068 2019-12-18  Eric Carlson  <eric.carlson@apple.com>
3069
3070         Remove more unused MediaPlayer methods
3071         https://bugs.webkit.org/show_bug.cgi?id=205405
3072         <rdar://problem/58049744>
3073
3074         Reviewed by Jer Noble.
3075
3076         No new tests, this just removes unused code.
3077
3078         * html/HTMLMediaElement.cpp:
3079         (WebCore::HTMLMediaElement::mediaPlayerIsInMediaDocument const): Deleted.
3080         * html/HTMLMediaElement.h:
3081         * platform/graphics/MediaPlayer.cpp:
3082         (WebCore::MediaPlayer::inMediaDocument const): Deleted.
3083         (WebCore::MediaPlayer::handlePlaybackCommand): Deleted.
3084         * platform/graphics/MediaPlayer.h:
3085         (WebCore::MediaPlayerClient::mediaPlayerPlatformVolumeConfigurationRequired const):
3086         (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand): Deleted.
3087         (WebCore::MediaPlayerClient::mediaPlayerIsInMediaDocument const): Deleted.
3088         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3089         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate const): Deleted.
3090         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3091         (WebCore::MediaPlayerPrivateAVFoundation::metaDataAvailable const):
3092         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3093         (WebCore::MediaPlayerPrivateAVFoundationCF::platformPlay):
3094
3095 2019-12-18  Yury Semikhatsky  <yurys@chromium.org>
3096
3097         Web Inspector: Runtime.enable reports duplicates (non existent) contexts
3098         https://bugs.webkit.org/show_bug.cgi?id=204859
3099
3100         Reviewed by Devin Rousso.
3101
3102         Do not report main world context as non-main world one when Runtime.enable is called.
3103
3104         Test: inspector/runtime/executionContextCreated-onEnable.html
3105
3106         * inspector/agents/page/PageRuntimeAgent.cpp:
3107         (WebCore::PageRuntimeAgent::enable):
3108         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
3109
3110 2019-12-18  Antti Koivisto  <antti@apple.com>
3111
3112         Optimize Style::Invalidator for multiple RuleSet case
3113         https://bugs.webkit.org/show_bug.cgi?id=205406
3114
3115         Reviewed by Zalan Bujtas.
3116
3117         * style/StyleInvalidator.cpp:
3118         (WebCore::Style::m_dirtiesAllStyle):
3119         (WebCore::Style::Invalidator::Invalidator):
3120         (WebCore::Style::Invalidator::collectRuleInformation):
3121
3122         Collect bunch of bits so we don't need to traverse again.
3123
3124         (WebCore::Style::Invalidator::invalidateIfNeeded):
3125
3126         Bail out when we find a reson to invalidate.
3127
3128         (WebCore::Style::Invalidator::invalidateStyle):
3129         (WebCore::Style::Invalidator::invalidateInShadowTreeIfNeeded):
3130         * style/StyleInvalidator.h:
3131
3132 2019-12-18  Andres Gonzalez  <andresg_22@apple.com>
3133
3134         AXIsolatedObject support for spin button increment/decrementButton.
3135         https://bugs.webkit.org/show_bug.cgi?id=205356
3136
3137         Reviewed by Chris Fleizach.
3138
3139         Several LayoutTests exercise this functionality.
3140
3141         - Exposed increment/decrementButton in AXCoreObject in order to
3142         properly support it in AXIsolatedObject.
3143         - Used AXCoreObject::increment/decrementButton in the wrapper instead
3144         of downcasting to an implementation class, which does not work for an
3145         isolated object.
3146         - Implemented AXIsolatedObject::isDetachedFromParent.
3147         - Fixed initialization of AXIsolatedObject::m_parent and m_id.
3148
3149         * accessibility/AccessibilityObject.h:
3150         * accessibility/AccessibilityObjectInterface.h:
3151         * accessibility/AccessibilitySpinButton.h:
3152         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
3153         (WebCore::AXIsolatedObject::initializeAttributeData):
3154         (WebCore::AXIsolatedObject::isDetachedFromParent):
3155         (WebCore::AXIsolatedObject::isAccessibilityScrollView const):
3156         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
3157         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3158         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3159
3160 2019-12-18  Zalan Bujtas  <zalan@apple.com>
3161
3162         [LFC][IFC] LineLayoutContext::m_uncommittedList is not always a continuous list of runs
3163         https://bugs.webkit.org/show_bug.cgi?id=205404
3164         <rdar://problem/58049699>
3165
3166         Reviewed by Antti Koivisto.
3167
3168         Since LineLayoutContext's m_uncommittedList is not necessarily continuous set of runs (continuous in the content of not having a soft wrap opportunity)
3169         we can't use LineBreaker's Content struct anymore to store the uncommitted content.
3170         Let's use a dedicated UncommittedContent struct instead. It also enables us to pass in a const RunList& to the ContinousContent. ContinousContent should never mutate this list.
3171
3172         * layout/inlineformatting/InlineLineBreaker.cpp:
3173         (WebCore::Layout::shouldKeepEndOfLineWhitespace):
3174         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
3175         (WebCore::Layout::LineBreaker::ContinousContent::ContinousContent):
3176         (WebCore::Layout::LineBreaker::ContinousContent::hasTextContentOnly const):
3177         (WebCore::Layout::LineBreaker::ContinousContent::isVisuallyEmptyWhitespaceContentOnly const):
3178         (WebCore::Layout::LineBreaker::ContinousContent::firstTextRunIndex const):
3179         (WebCore::Layout::LineBreaker::ContinousContent::hasNonContentRunsOnly const):
3180         (WebCore::Layout::LineBreaker::ContinousContent::TrailingCollapsibleContent::reset):
3181         (WebCore::Layout::LineBreaker::Content::append): Deleted.
3182         (WebCore::Layout::LineBreaker::Content::reset): Deleted.
3183         (WebCore::Layout::LineBreaker::Content::shrink): Deleted.
3184         (WebCore::Layout::LineBreaker::Content::hasTextContentOnly const): Deleted.
3185         (WebCore::Layout::LineBreaker::Content::isVisuallyEmptyWhitespaceContentOnly const): Deleted.
3186         (WebCore::Layout::LineBreaker::Content::firstTextRunIndex const): Deleted.
3187         (WebCore::Layout::LineBreaker::Content::hasNonContentRunsOnly const): Deleted.
3188         (WebCore::Layout::LineBreaker::Content::TrailingCollapsibleContent::reset): Deleted.
3189         * layout/inlineformatting/InlineLineBreaker.h:
3190         (WebCore::Layout::LineBreaker::ContinousContent::runs const):
3191         (WebCore::Layout::LineBreaker::ContinousContent::isEmpty const):
3192         (WebCore::Layout::LineBreaker::ContinousContent::size const):
3193         (WebCore::Layout::LineBreaker::Content::runs): Deleted.
3194         (WebCore::Layout::LineBreaker::Content::runs const): Deleted.
3195         (WebCore::Layout::LineBreaker::Content::isEmpty const): Deleted.
3196         (WebCore::Layout::LineBreaker::Content::size const): Deleted.
3197         (WebCore::Layout::LineBreaker::Content::width const): Deleted.
3198         (WebCore::Layout::LineBreaker::Content::nonCollapsibleWidth const): Deleted.
3199         (WebCore::Layout::LineBreaker::Content::hasTrailingCollapsibleContent const): Deleted.
3200         (WebCore::Layout::LineBreaker::Content::isTrailingContentFullyCollapsible const): Deleted.
3201         * layout/inlineformatting/LineLayoutContext.cpp:
3202         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
3203         (WebCore::Layout::LineLayoutContext::UncommittedContent::append):
3204         (WebCore::Layout::LineLayoutContext::UncommittedContent::reset):
3205         (WebCore::Layout::LineLayoutContext::UncommittedContent::shrink):
3206         * layout/inlineformatting/LineLayoutContext.h:
3207         (WebCore::Layout::LineLayoutContext::UncommittedContent::width const):
3208         (WebCore::Layout::LineLayoutContext::UncommittedContent::size):
3209         (WebCore::Layout::LineLayoutContext::UncommittedContent::isEmpty):
3210         (WebCore::Layout::LineLayoutContext::UncommittedContent::runs const):
3211
3212 2019-12-18  youenn fablet  <youenn@apple.com>
3213
3214         Protect ServiceWorker::postMessage from a null execState
3215         https://bugs.webkit.org/show_bug.cgi?id=205394
3216         <rdar://problem/57392221>
3217
3218         Reviewed by Chris Dumez.
3219
3220         Crash logs indicate null pointer crashes.
3221         We should return early in that case.
3222
3223         * workers/service/ServiceWorker.cpp:
3224         (WebCore::ServiceWorker::postMessage):
3225
3226 2019-12-18  Zalan Bujtas  <zalan@apple.com>
3227
3228         [LFC][IFC] LineBreaker::lastSoftWrapOpportunity should take a list of runs
3229         https://bugs.webkit.org/show_bug.cgi?id=205402
3230         <rdar://problem/58048310>
3231
3232         Reviewed by Antti Koivisto.
3233
3234         LineBreaker::Content is supposed to hold a continuous set of runs and the input to lastSoftWrapOpportunity is not
3235         necessarily continuous (most of the time it is though). 
3236
3237         * layout/inlineformatting/InlineLineBreaker.cpp:
3238         (WebCore::Layout::isContentSplitAllowed):
3239         (WebCore::Layout::LineBreaker::wrapTextContent const):
3240         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
3241         (WebCore::Layout::LineBreaker::lastSoftWrapOpportunity):
3242         (WebCore::Layout::LineBreaker::Content::lastSoftWrapOpportunity): Deleted.
3243         * layout/inlineformatting/InlineLineBreaker.h:
3244         * layout/inlineformatting/LineLayoutContext.cpp:
3245         (WebCore::Layout::LineLayoutContext::placeInlineItem):
3246
3247 2019-12-18  youenn fablet  <youenn@apple.com>
3248
3249         AppCache should request certificate info when loading resources
3250         https://bugs.webkit.org/show_bug.cgi?id=205393
3251
3252         Reviewed by Anders Carlsson.
3253
3254         Covered by existing tests not crashing in Debug with newly added ASSERT.
3255
3256         * Modules/mediastream/UserMediaController.cpp:
3257         (WebCore::isSecure):
3258         ASSERT that certificate info is there.
3259         * loader/DocumentLoader.cpp:
3260         (WebCore::DocumentLoader::responseReceived):
3261         ASSERT that certificate info is there.
3262         * loader/appcache/ApplicationCacheResourceLoader.cpp:
3263         (WebCore::ApplicationCacheResourceLoader::create):
3264         Request certificate info for all app cache resources.
3265
3266 2019-12-18  youenn fablet  <youenn@apple.com>
3267
3268         Add support for Audio Capture in GPUProcess
3269         https://bugs.webkit.org/show_bug.cgi?id=205056
3270
3271         Reviewed by Eric Carlson.
3272
3273         Export some WebCore headers.
3274         Allow disabling the audio session debug assert in the GPU process.
3275         No change of behavior.
3276
3277         * WebCore.xcodeproj/project.pbxproj:
3278         * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
3279         (WebCore::BaseAudioSharedUnit::startUnit):
3280         * platform/mediastream/mac/BaseAudioSharedUnit.h:
3281         (WebCore::BaseAudioSharedUnit::setDisableAudioSessionCheck):
3282         * platform/mediastream/mac/MockAudioSharedUnit.h:
3283
3284 2019-12-18  Eric Carlson  <eric.carlson@apple.com>
3285
3286         Remove unused MediaPlayer methods
3287         https://bugs.webkit.org/show_bug.cgi?id=205341
3288         <rdar://problem/58006776>
3289
3290         Reviewed by Jer Noble.
3291
3292         No new tests, this just removes unused code.
3293
3294         * html/HTMLMediaElement.cpp:
3295         (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
3296         (WebCore::HTMLMediaElement::mediaPlayerSawUnsupportedTracks): Deleted.
3297         (WebCore::HTMLMediaElement::mediaPlayerSetSize): Deleted.
3298         (WebCore::HTMLMediaElement::mediaPlayerIsPaused const): Deleted.
3299         * html/HTMLMediaElement.h:
3300         * html/HTMLVideoElement.cpp:
3301         (WebCore::HTMLVideoElement::setDisplayMode):
3302         * html/MediaDocument.cpp:
3303         (WebCore::MediaDocument::MediaDocument):
3304         (WebCore::MediaDocument::~MediaDocument):
3305         (WebCore::MediaDocument::mediaElementSawUnsupportedTracks): Deleted.
3306         * html/MediaDocument.h:
3307         * platform/graphics/MediaPlayer.cpp:
3308         (WebCore::MediaPlayer::canLoadPoster const): Deleted.
3309         (WebCore::MediaPlayer::setPoster): Deleted.
3310         * platform/graphics/MediaPlayer.h:
3311         (WebCore::MediaPlayerClient::mediaPlayerContentsScale const):
3312         (WebCore::MediaPlayerClient::mediaPlayerPlatformVolumeConfigurationRequired const):
3313         (WebCore::MediaPlayerClient::mediaPlayerSawUnsupportedTracks): Deleted.
3314         (WebCore::MediaPlayerClient::mediaPlayerSetSize): Deleted.
3315         (WebCore::MediaPlayerClient::mediaPlayerIsPaused const): Deleted.
3316         * platform/graphics/MediaPlayerPrivate.h:
3317         (WebCore::MediaPlayerPrivateInterface::setSize):
3318         (WebCore::MediaPlayerPrivateInterface::canLoadPoster const): Deleted.
3319         (WebCore::MediaPlayerPrivateInterface::setPoster): Deleted.
3320         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3321         (WebCore::MediaPlayerPrivateAVFoundation::setSize): Deleted.
3322         (WebCore::MediaPlayerPrivateAVFoundation::repaint): Deleted.
3323         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3324         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
3325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3326         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3327         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible): Deleted.
3328         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3329         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3330         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setSize): Deleted.
3331         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3332
3333 2019-12-18  Doug Kelly  <dougk@apple.com>
3334
3335         Ensure transparency layers are properly ended when only painting root background
3336         https://bugs.webkit.org/show_bug.cgi?id=205285
3337
3338         Reviewed by Simon Fraser.
3339
3340         Ensure that if we are in a transparency layer and returning early from paintLayerContents() because of PaintLayerPaintingRootBackgroundOnly, we properly
3341         reset the transparency state before returning.
3342
3343         * platform/graphics/GraphicsContext.h:
3344         (WebCore::GraphicsContextStateStackChecker::~GraphicsContextStateStackChecker):
3345         * rendering/RenderLayer.cpp:
3346         (WebCore::RenderLayer::paintLayerContents):
3347
3348 2019-12-18  ChangSeok Oh  <changseok@webkit.org>
3349
3350         [GTK] WebGL backed by ANGLE flickers when USE_OPENGL_ES is enabled.
3351         https://bugs.webkit.org/show_bug.cgi?id=202508
3352
3353         Reviewed by Žan Doberšek.
3354
3355         The color format and internal one of BitmapTextureGL cannot be matched
3356         where USE_ANGLE_WEBGL and USE_OPENGL_ES are enabled simultaneously.
3357         This causes the flickering issue on WebGL scene since it prevents TextureMapper
3358         from recycling available layer buffers due to mismatched color format.
3359         When ANGLE_WEBGL is enabled, the internal color format is set GL_RGBA8.
3360         However, that is not compatible to GLES textures. To address this,
3361         We always make the color format of BitmapTextureGL GL_RGBA,
3362         and only set its internal color format with a given value.
3363
3364         No new tests since no functionality changed.
3365
3366         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
3367         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
3368         * platform/graphics/texmap/BitmapTextureGL.cpp:
3369         (WebCore::BitmapTextureGL::BitmapTextureGL):
3370
3371 2019-12-18  Antti Koivisto  <antti@apple.com>
3372
3373         Style::Invalidator should be able to invalidate using multiple RuleSets in one pass
3374         https://bugs.webkit.org/show_bug.cgi?id=205391
3375
3376         Reviewed by Zalan Bujtas.
3377
3378         It is inefficient to do multiple passes over DOM if there are multiple RuleSets to invalidate with.
3379
3380         * style/AttributeChangeInvalidation.cpp:
3381         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
3382
3383         Collect to a HashMap per MatchElement.
3384
3385         (WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
3386
3387         Call to common invalidation function in Style::Invalidator.
3388
3389         * style/AttributeChangeInvalidation.h:
3390         * style/ClassChangeInvalidation.cpp:
3391         (WebCore::Style::ClassChangeInvalidation::computeInvalidation):
3392         (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
3393
3394         Same for classes.
3395
3396         * style/ClassChangeInvalidation.h:
3397         * style/StyleInvalidator.cpp:
3398         (WebCore::Style::Invalidator::Invalidator):
3399
3400         Take a Vector of RuleSets.
3401
3402         (WebCore::Style::Invalidator::invalidateIfNeeded):
3403
3404         Loop as needed.
3405
3406         (WebCore::Style::Invalidator::invalidateStyle):
3407         (WebCore::Style::Invalidator::invalidateInShadowTreeIfNeeded):
3408         (WebCore::Style::Invalidator::invalidateWithMatchElementRuleSets):
3409
3410         Factor the invalidation loop and HashMap to Invalidator.
3411
3412         * style/StyleInvalidator.h:
3413
3414 2019-12-18  Simon Fraser  <simon.fraser@apple.com>
3415
3416         Move m_exposedContentRect into the DelegatedScrollingGeometry optional
3417         https://bugs.webkit.org/show_bug.cgi?id=205377
3418
3419         Reviewed by Tim Horton.
3420
3421         ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into
3422         DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related
3423         code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions
3424         on TiledCoreAnimationDrawingArea.        
3425
3426         * platform/ScrollView.cpp:
3427         (WebCore::ScrollView::exposedContentRect const):
3428         (WebCore::ScrollView::setExposedContentRect):
3429         (WebCore::ScrollView::platformExposedContentRect const):
3430         * platform/ScrollView.h:
3431         * platform/ios/ScrollViewIOS.mm:
3432         (WebCore::ScrollView::platformExposedContentRect const):
3433         (WebCore::ScrollView::exposedContentRect const): Deleted.
3434         (WebCore::ScrollView::setExposedContentRect): Deleted.
3435
3436 2019-12-18  Chris Dumez  <cdumez@apple.com>
3437
3438         REGRESSION: 32 Tests Crashing on Mac Debug wk2 with ASSERTION FAILED: m_pendingActivityForEventDispatch
3439         https://bugs.webkit.org/show_bug.cgi?id=205397
3440         <rdar://problem/58043626>
3441
3442         Unreviewed, fix debug assertion after r253667. The debug assertion is confused because we now use
3443         the HTML5 event loop, which takes care of taking an ActiveDOMObject PendingActivity whenever we
3444         queue an event.
3445
3446         * workers/service/ServiceWorkerRegistration.cpp:
3447         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
3448         (WebCore::ServiceWorkerRegistration::getNewestWorker const):
3449         (WebCore::ServiceWorkerRegistration::updateStateFromServer):
3450         (WebCore::ServiceWorkerRegistration::queueTaskToFireUpdateFoundEvent):
3451         (WebCore::ServiceWorkerRegistration::stop):
3452         (WebCore::ServiceWorkerRegistration::hasPendingActivity const):
3453         (WebCore::ServiceWorkerRegistration::getNewestWorker): Deleted.
3454         (WebCore::ServiceWorkerRegistration::updatePendingActivityForEventDispatch): Deleted.
3455         * workers/service/ServiceWorkerRegistration.h:
3456
3457 2019-12-18  Diego Pino Garcia  <dpino@igalia.com>
3458
3459         [GTK][WPE] Renderization of Conic gradients
3460         https://bugs.webkit.org/show_bug.cgi?id=202739
3461
3462         Reviewed by Carlos Alberto Lopez Perez.
3463
3464         * platform/graphics/cairo/GradientCairo.cpp:
3465         (WebCore::Gradient::createPlatformGradient): Add support for conic gradient.
3466         (WebCore::addColorStopRGBA): Refactored code to a function.
3467         (WebCore::createConic): Creates a conic gradient.
3468         (WebCore::addConicSector): Adds a sector to a conic gradient.
3469         (WebCore::setCornerColorRGBA): Sets a RGBA color to mesh patch.
3470         (WebCore::interpolateColorStop): Offset and RGBA color interpolation.
3471
3472 2019-12-18  Zalan Bujtas  <zalan@apple.com>
3473
3474         [LFC][IFC] LineBreaker::isAtSoftWrapOpportunity should return the wrap position
3475         https://bugs.webkit.org/show_bug.cgi?id=205371
3476         <rdar://problem/58029811>
3477
3478         Reviewed by Antti Koivisto.
3479
3480         Rename isAtSoftWrapOpportunity to lastSoftWrapOpportunity to reflect that it returns the last soft wrap
3481         opportunity index.
3482
3483         * layout/inlineformatting/InlineLineBreaker.cpp:
3484         (WebCore::Layout::LineBreaker::Content::lastSoftWrapOpportunity):
3485         (WebCore::Layout::LineBreaker::Content::append):
3486         (WebCore::Layout::LineBreaker::Content::isAtSoftWrapOpportunity): Deleted.
3487         * layout/inlineformatting/InlineLineBreaker.h:
3488         * layout/inlineformatting/LineLayoutContext.cpp:
3489         (WebCore::Layout::LineLayoutContext::placeInlineItem):
3490
3491 2019-12-18  Zalan Bujtas  <zalan@apple.com>
3492
3493         [LFC][IFC] Add lastInlineItemWithContent to LineBreaker::Content::isAtSoftWrapOpportunity
3494         https://bugs.webkit.org/show_bug.cgi?id=205362
3495         <rdar://problem/58025349>
3496
3497         Reviewed by Antti Koivisto.
3498
3499         This is in preparation for being able to return a previous run index as the soft wrapping opportunity.
3500
3501         * layout/inlineformatting/InlineLineBreaker.cpp:
3502         (WebCore::Layout::endsWithSoftWrapOpportunity):
3503         (WebCore::Layout::LineBreaker::Content::isAtSoftWrapOpportunity):
3504
3505 2019-12-18  Dean Jackson  <dino@apple.com>
3506
3507         Reverting libANGLE.a -> libANGLE-shared.dylib.
3508
3509         The internal Apple build systems are still unhappy with
3510         this change, so I'm reverting it until I can be sure
3511         they'll accept it.
3512
3513         * Configurations/WebCore.xcconfig:
3514         * Configurations/WebCoreTestSupport.xcconfig:
3515         * platform/graphics/ANGLEWebKitBridge.cpp:
3516         (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
3517         (WebCore::ANGLEWebKitBridge::cleanupCompilers):
3518         (WebCore::ANGLEWebKitBridge::compileShaderSource):
3519         (WebCore::ANGLEWebKitBridge::angleAvailable): Deleted.
3520         * platform/graphics/ANGLEWebKitBridge.h:
3521         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3522         (WebCore::GraphicsContext3D::GraphicsContext3D):
3523
3524 2019-12-18  Chris Lord  <clord@igalia.com>
3525
3526         Missing headers in worker files cause random build failures when adding new files
3527         https://bugs.webkit.org/show_bug.cgi?id=205385
3528
3529         Reviewed by Youenn Fablet.
3530
3531         No new tests, no behavioral changes.
3532
3533         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3534         * workers/service/server/SWServerRegistration.cpp:
3535
3536 2019-12-18  Chris Lord  <clord@igalia.com>
3537
3538         [GTK][WPE] OffscreenCanvas worker tests that call drawImage crash in debug builds
3539         https://bugs.webkit.org/show_bug.cgi?id=205339
3540
3541         Reviewed by Carlos Garcia Campos.
3542
3543         Don't unnecessarily create an Image object in the Cairo graphics
3544         backend when using drawImage/drawPattern. Doing so calls code that
3545         isn't safe to use off-main-thread and causes OffscreenCanvas worker
3546         tests to crash in debug builds.
3547
3548         No new tests, no behavioral changes.
3549
3550         * platform/graphics/cairo/ImageBufferCairo.cpp:
3551         (WebCore::cairoSurfaceCopy):
3552         (WebCore::cairoSurfaceCoerceToImage):
3553         (WebCore::ImageBuffer::draw):
3554         (WebCore::ImageBuffer::drawPattern):
3555
3556 2019-12-17  Simon Fraser  <simon.fraser@apple.com>
3557
3558         Remove iOS #ifdefs around unobscuredContentSize
3559         https://bugs.webkit.org/show_bug.cgi?id=205372
3560
3561         Reviewed by Tim Horton.
3562
3563         Long-term, all of the ScrollView geometry data related to delegated scrolling
3564         will move to Optional<DelegatedScrollingGeometry> m_delegatedScrollingGeometry
3565         and not be wrapped in platform #ifdefs.
3566
3567         Take the first step of moving unobscuredContentSize into that struct.
3568
3569         I added platformUnobscuredContentRect() to handle the iOS WK1 case, called 
3570         when there is a platform widget.
3571         
3572         m_fixedVisibleContentRect is only used by coördinated graphics.
3573
3574         * page/FrameView.cpp:
3575         (WebCore::FrameView::unobscuredContentSizeChanged):
3576         * page/FrameView.h:
3577         * platform/ScrollView.cpp:
3578         (WebCore::ScrollView::unobscuredContentSize const):
3579         (WebCore::ScrollView::setUnobscuredContentSize):
3580         (WebCore::ScrollView::unobscuredContentRect const):
3581         (WebCore::ScrollView::platformVisibleContentRect const):
3582         (WebCore::ScrollView::platformVisibleContentSize const):
3583         (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea const):
3584         (WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea const):
3585         (WebCore::ScrollView::platformUnobscuredContentRect const):
3586         * platform/ScrollView.h:
3587         (WebCore::ScrollView::unobscuredContentSize const): Deleted.
3588         * platform/ios/ScrollViewIOS.mm:
3589         (WebCore::ScrollView::platformUnobscuredContentRect const):
3590         (WebCore::ScrollView::unobscuredContentRect const): Deleted.
3591         (WebCore::ScrollView::setUnobscuredContentSize): Deleted.
3592         * platform/mac/ScrollViewMac.mm:
3593         (WebCore::ScrollView::platformUnobscuredContentRect const):
3594
3595 2019-12-17  Chris Dumez  <cdumez@apple.com>
3596
3597         Port service worker code to the HTML5 event loop
3598         https://bugs.webkit.org/show_bug.cgi?id=205359
3599
3600         Reviewed by Ryosuke Niwa.
3601
3602         Port service worker code to the HTML5 event loop. We were mixing using the HTML5 event loop and ScriptExecutionContext::postTask().
3603         This would cause test flakiness because tasks posted via thsse 2 mechanisms could get processed out of order, even though the
3604         service worker specification guarantees a specific ordering.
3605
3606         The new pattern is that we only use WorkerRunLoop::postTask() to hop to the worker thread from the main thread, and not for any work
3607         specified in the service workers specification. Whenever the service workers specifications to "queue a task", we now queue a task
3608         on the ScriptExecutionContext's event loop, with the specified TaskSource.
3609
3610         No new tests, updated existing test.
3611
3612         * dom/ScriptExecutionContext.cpp:
3613         * dom/ScriptExecutionContext.h:
3614         * workers/service/SWClientConnection.cpp:
3615         (WebCore::dispatchToContextThreadIfNecessary):
3616         (WebCore::SWClientConnection::postTaskForJob):
3617         (WebCore::SWClientConnection::updateRegistrationState):
3618         (WebCore::SWClientConnection::updateWorkerState):
3619         (WebCore::SWClientConnection::fireUpdateFoundEvent):
3620         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
3621         (WebCore::SWClientConnection::clearPendingJobs):
3622         * workers/service/ServiceWorker.cpp:
3623         (WebCore::ServiceWorker::updateState):
3624         * workers/service/ServiceWorker.h:
3625         * workers/service/ServiceWorkerContainer.cpp:
3626         (WebCore::ServiceWorkerContainer::updateRegistrationState):
3627         (WebCore::ServiceWorkerContainer::updateWorkerState):
3628         (WebCore::ServiceWorkerContainer::queueTaskToFireUpdateFoundEvent):
3629         (WebCore::ServiceWorkerContainer::queueTaskToDispatchControllerChangeEvent):
3630         * workers/service/ServiceWorkerContainer.h:
3631         * workers/service/ServiceWorkerRegistration.cpp:
3632         (WebCore::ServiceWorkerRegistration::queueTaskToFireUpdateFoundEvent):
3633         * workers/service/ServiceWorkerRegistration.h:
3634         * workers/service/context/SWContextManager.cpp:
3635         (WebCore::SWContextManager::postMessageToServiceWorker):
3636         (WebCore::SWContextManager::fireInstallEvent):
3637         (WebCore::SWContextManager::fireActivateEvent):
3638         * workers/service/context/ServiceWorkerThread.cpp:
3639         (WebCore::ServiceWorkerThread::queueTaskToFireFetchEvent):
3640         (WebCore::ServiceWorkerThread::queueTaskToPostMessage):
3641         (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent):
3642         (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent):
3643         * workers/service/context/ServiceWorkerThread.h:
3644         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3645         (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
3646         (WebCore::ServiceWorkerThreadProxy::startFetch):
3647
3648 2019-12-17  Chris Dumez  <cdumez@apple.com>
3649
3650         Unreviewed, revert r253493 because it broke an Apple internal site
3651
3652         * html/HTMLFormElement.cpp:
3653         (WebCore::HTMLFormElement::submit):
3654         * html/HTMLFormElement.h:
3655         * loader/FormSubmission.h:
3656         (WebCore::FormSubmission::cancel): Deleted.
3657         (WebCore::FormSubmission::wasCancelled const): Deleted.
3658         * loader/NavigationScheduler.cpp:
3659
3660 2019-12-17  Fujii Hironori  <fujii.hironori@gmail.com>
3661
3662         [cairo] text-align:justify wrongly expands CJK ideograph characters
3663         https://bugs.webkit.org/show_bug.cgi?id=205321
3664
3665         Reviewed by Carlos Garcia Campos.
3666
3667         Even though canExpandAroundIdeographsInComplexText of
3668         FontCairoHarfbuzzNG.cpp returns false, ComplexTextController
3669         doesn't take it account. It ends up to expanding all ideographs
3670         with a undesired expansion width.
3671
3672         WidthIterator properly checks canExpandAroundIdeographsInComplexText.
3673         ComplexTextController also should do so.
3674
3675         * platform/graphics/ComplexTextController.cpp:
3676         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Check canExpandAroundIdeographsInComplexText.
3677         * platform/graphics/FontCascade.h: Friend with ComplexTextController to allow calling canExpandAroundIdeographsInComplexText.
3678
3679 2019-12-17  Brent Fulgham  <bfulgham@apple.com>
3680
3681         Limit URL to reasonable size
3682         https://bugs.webkit.org/show_bug.cgi?id=203825
3683         <rdar://problem/56878680>
3684
3685         Reviewed by Ryosuke Niwa.
3686
3687         * page/SecurityOrigin.cpp:
3688         (WebCore::SecurityOrigin::canDisplay const): Place an upper bound on the amount of
3689         memory a URL may consume.
3690
3691 2019-12-17  Eric Carlson  <eric.carlson@apple.com>
3692
3693         Add remote media player methods for prepareToPlay, preload, private browsing mode, preserves pitch, and failed to load
3694         https://bugs.webkit.org/show_bug.cgi?id=205351
3695         <rdar://problem/58018451>
3696
3697         Reviewed by Jer Noble.
3698
3699         * platform/graphics/MediaPlayer.cpp:
3700         (WebCore::MediaPlayer::remoteEngineFailedToLoad):
3701         * platform/graphics/MediaPlayer.h:
3702
3703 2019-12-17  Kate Cheney  <katherine_cheney@apple.com>
3704
3705         Add run-time flag for in-app browser privacy
3706         https://bugs.webkit.org/show_bug.cgi?id=205288
3707         <rdar://problem/57569206>
3708
3709         Reviewed by John Wilander.
3710
3711         * page/RuntimeEnabledFeatures.h:
3712         (WebCore::RuntimeEnabledFeatures::setInAppBrowserPrivacyEnabled):
3713         (WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const):
3714         * page/Settings.yaml:
3715
3716 2019-12-17  Ryosuke Niwa  <rniwa@webkit.org>
3717
3718         executeIfJavaScriptURL should check requester's security origin
3719         https://bugs.webkit.org/show_bug.cgi?id=205324
3720
3721         Reviewed by Brent Fulgham.
3722
3723         Don't execute the JavaScript in ScriptController::executeIfJavaScriptURL if the security origin
3724         of the current document is no longer accessible from the request originator's security origin.
3725
3726         * bindings/js/ScriptController.cpp:
3727         (WebCore::ScriptController::executeIfJavaScriptURL): Added a check.
3728         * bindings/js/ScriptController.h:
3729         * loader/FrameLoader.cpp:
3730         (WebCore::FrameLoader::urlSelected): Pass around the security origin of the requester.
3731         (WebCore::FrameLoader::submitForm):
3732
3733 2019-12-16  Ryosuke Niwa  <rniwa@webkit.org>
3734
3735         Document::setFocusedElement should not set m_focusedElement to an element in another document
3736         https://bugs.webkit.org/show_bug.cgi?id=205325
3737
3738         Reviewed by Wenson Hsieh.
3739
3740         Added an early exit for when the newly focused element had moved
3741         while blurring the previously focused element.
3742
3743         * dom/Document.cpp:
3744         (WebCore::Document::setFocusedElement):
3745
3746 2019-12-17  James Darpinian  <jdarpinian@chromium.org>
3747
3748         Fix WebGL conformance test build_177_to_178.html with USE_ANGLE
3749         https://bugs.webkit.org/show_bug.cgi?id=204927
3750
3751         Disable ANGLE_texture_rectangle when compiling user shaders.
3752         This mirrors a change I made to Chromium here:
3753         https://chromium-review.googlesource.com/c/chromium/src/+/1842223
3754
3755         Reviewed by Dean Jackson.
3756
3757         * platform/graphics/angle/GraphicsContext3DANGLE.cpp:
3758         (WebCore::GraphicsContext3D::compileShader):
3759
3760 2019-12-17  Tim Horton  <timothy_horton@apple.com>
3761
3762         macCatalyst: Cursor should update on mouse movement and style change
3763         https://bugs.webkit.org/show_bug.cgi?id=205317
3764         <rdar://problem/46793696>
3765
3766         Reviewed by Anders Carlsson.
3767
3768         * Configurations/WebCore.xcconfig:
3769         Link AppKit for NSCursor.
3770
3771         * SourcesCocoa.txt:
3772         Remove CursorIOS.cpp.
3773         De-unify CursorMac; because it imports AppKit headers, we have to
3774         take care to make sure it doesn't also get WAK (which it does if you
3775         leave it unified).
3776
3777         * WebCore.xcodeproj/project.pbxproj:
3778         Remove CursorIOS.cpp and de-unify CursorMac (by adding it to the target)
3779
3780         * loader/EmptyClients.h:
3781         * page/Chrome.cpp:
3782         (WebCore::Chrome::setCursor):
3783         (WebCore::Chrome::setCursorHiddenUntilMouseMoves):
3784         Unifdef many things.
3785
3786         * page/ChromeClient.h:
3787         (WebCore::ChromeClient::supportsSettingCursor):
3788         Add a ChromeClient bit, supportsSettingCursor, which can be used
3789         to guard work that shouldn't happen if a platform doesn't support
3790         pushing cursor updates out from WebCore. This will be true everywhere
3791         except iOS, and does the work of the old platform ifdefs.
3792
3793         * page/EventHandler.cpp:
3794         (WebCore::EventHandler::EventHandler):
3795         (WebCore::EventHandler::clear):
3796         (WebCore::EventHandler::updateCursor):
3797         (WebCore::EventHandler::selectCursor):
3798         (WebCore::EventHandler::handleMouseMoveEvent):
3799         (WebCore::EventHandler::scheduleCursorUpdate):
3800         * page/EventHandler.h:
3801         * platform/Cursor.cpp:
3802         * platform/Cursor.h:
3803         Unifdef, and use supportsSettingCursor to avoid some unnecessary work.
3804
3805         * platform/ios/CursorIOS.cpp: Removed.
3806         * platform/ios/WidgetIOS.mm:
3807         (WebCore::Widget::setCursor):
3808         Propagate cursor changes upwards.
3809
3810         * platform/mac/CursorMac.mm:
3811         (WebCore::cursor):
3812         (WebCore::Cursor::ensurePlatformCursor const):
3813         CursorMac is now built in macCatalyst. However, parts that depend
3814         on HIServices or NSImage are #ifdeffed out, and fall back to an arrow.
3815
3816 2019-12-17  Antti Koivisto  <antti@apple.com>
3817
3818         REGRESSION: ASSERTION FAILED: FontCache::singleton().generation() == m_generation
3819         https://bugs.webkit.org/show_bug.cgi?id=204933
3820         <rdar://problem/57458432>
3821
3822         Reviewed by Zalan Bujtas.
3823
3824         Test: fast/shadow-dom/font-cache-invalidation.html
3825
3826         When font cache version number is bumped we need to invalidate matches declarations caches because
3827         they may now contain stale font references. The code to do this failed to look into shadow trees.
3828
3829         * dom/Document.cpp:
3830         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
3831         * style/StyleScope.cpp:
3832         (WebCore::Style::Scope::invalidateMatchedDeclarationsCache):
3833
3834         Also invalidate the shadow trees.
3835
3836         * style/StyleScope.h:
3837
3838 2019-12-17  Zalan Bujtas  <zalan@apple.com>
3839
3840         [LFC][Painting] Add basic support for z-index based painting
3841         https://bugs.webkit.org/show_bug.cgi?id=205345
3842         <rdar://problem/58010942>
3843
3844         Reviewed by Antti Koivisto.
3845
3846         This is just a very simple z-index based painting to be able to run WPT where
3847         z-index is heavily used to hide/reveal red/green boxes.
3848
3849         * layout/displaytree/DisplayPainter.cpp:
3850         (WebCore::Display::absoluteDisplayBox):
3851         (WebCore::Display::isPaintRootCandidate):
3852         (WebCore::Display::paintSubtree):
3853         (WebCore::Display::collectPaintRootsAndContentRect):
3854         (WebCore::Display::Painter::paint):
3855         (WebCore::Display::paintBoxDecorationAndChildren): Deleted.
3856
3857 2019-12-17  youenn fablet  <youenn@apple.com>
3858
3859         Update session category in MockAudioSharedUnit as done in CoreAudioSharedUnit
3860         https://bugs.webkit.org/show_bug.cgi?id=205328
3861
3862         Reviewed by Eric Carlson.
3863
3864         We were updating the audio session when starting capturing with the CoreAudioSharedUnit
3865         but not with the MockAudioSharedUnit.
3866         Refactor the code to update the audio session in the base class BaseAudioSharedUnit.
3867         Share more code between start and resume case in BaseAudioSharedUnit.
3868
3869         Covered by platform/ios/mediastream/audio-muted-in-background-tab.html in Debug.
3870
3871         * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
3872         (WebCore::BaseAudioSharedUnit::startProducingData):
3873         (WebCore::BaseAudioSharedUnit::startUnit):
3874         (WebCore::BaseAudioSharedUnit::resume):
3875         * platform/mediastream/mac/BaseAudioSharedUnit.h:
3876         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3877         (WebCore::CoreAudioSharedUnit::startInternal):
3878         * platform/mediastream/mac/MockAudioSharedUnit.mm:
3879         (WebCore::MockAudioSharedUnit::startInternal):
3880
3881 2019-12-17  Thibault Saunier  <tsaunier@igalia.com>
3882
3883         [GStreamer][WPE] Fix regressions related to our 'Fix GStreamer capturer mock' patch
3884         https://bugs.webkit.org/show_bug.cgi?id=205270
3885
3886         MockGStreamerAudioCaptureSource rightfully defaults to echoCancellation=True,
3887         see https://bugs.webkit.org/show_bug.cgi?id=205057
3888
3889         Reviewed by Philippe Normand.
3890
3891         This fixes existing tests
3892
3893         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
3894         (WebCore::WrappedMockRealtimeAudioSource::addHum):
3895
3896 2019-12-17  Antti Koivisto  <antti@apple.com>
3897
3898         Resolve dynamic media queries without reconstructing RuleSets
3899         https://bugs.webkit.org/show_bug.cgi?id=205264
3900
3901         Reviewed by Zalan Bujtas.
3902
3903         We currently do a full style resolver reset whenever a media query result changes. This is very inefficient
3904         as we need to reconstuct all RuleSets and optimization structures. We also lose related caches and are forced
3905         to re-resolve full document style. This may happen frequently, for example when resizing window on a responsive
3906         web site.
3907
3908         With this patch we construct RuleDatas also for non-matching dynamic media queries and simply mark them disabled.
3909         We create a data structure that allows enabling and disabling them efficiently as a response to environment changes
3910         (like view resize). This allows us to avoid throwing away anything during common scenarios.
3911
3912         Test: fast/media/media-query-dynamic-with-font-face.html
3913
3914         * css/MediaQueryEvaluator.cpp:
3915         (WebCore::MediaQueryEvaluator::evaluate const):
3916
3917         Add a mode where dynamic media queries all evaluate to true and only static properties can cause the query to fail.
3918
3919         * css/MediaQueryEvaluator.h:
3920         * style/ElementRuleCollector.cpp:
3921         (WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
3922
3923         Skip disabled rules during rule collection.
3924
3925         * style/RuleData.cpp:
3926         (WebCore::Style::RuleData::RuleData):
3927         * style/RuleData.h:
3928         (WebCore::Style::RuleData::isEnabled const):
3929         (WebCore::Style::RuleData::setEnabled):
3930
3931         Add a bit.
3932
3933         * style/RuleSet.cpp:
3934         (WebCore::Style::RuleSet::addRule):
3935
3936         Collect positions of rules affected by dynamic media queries.
3937
3938         (WebCore::Style::RuleSet::addPageRule):
3939         (WebCore::Style::RuleSet::addChildRules):
3940         (WebCore::Style::RuleSet::addRulesFromSheet):
3941
3942         First check for a special case where we have style resolver mutating rules (like @font-face) inside a media query.
3943         In this case we fall back to static resolution.
3944
3945         Then collect the rules. Static media queries (print etc) are evaluated right away, dynamic ones are collected by MediaQueryCollector.
3946
3947         (WebCore::Style::RuleSet::addStyleRule):
3948         (WebCore::Style::RuleSet::traverseRuleDatas):
3949         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
3950
3951         Evaluate media queries for changes and flip the enabled state of the rules if needed.
3952
3953         (WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
3954         (WebCore::Style::RuleSet::MediaQueryCollector::pop):
3955         (WebCore::Style::RuleSet::MediaQueryCollector::didMutateResolver):
3956         (WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded):
3957         * style/RuleSet.h:
3958         (WebCore::Style::RuleSet::hasViewportDependentMediaQueries const):
3959         * style/StyleResolver.cpp:
3960         (WebCore::Style::Resolver::hasViewportDependentMediaQueries const):
3961         (WebCore::Style::Resolver::evaluateDynamicMediaQueries):
3962         (WebCore::Style::Resolver::addMediaQueryDynamicResults): Deleted.
3963         (WebCore::Style::Resolver::hasMediaQueriesAffectedByViewportChange const): Deleted.
3964         (WebCore::Style::Resolver::hasMediaQueriesAffectedByAccessibilitySettingsChange const): Deleted.
3965         (WebCore::Style::Resolver::hasMediaQueriesAffectedByAppearanceChange const): Deleted.
3966
3967         Profiling doesn't show any need to handle the cases separately. Replace with single evaluateDynamicMediaQueries path.
3968         We can bring type specific paths back easily if needed.
3969
3970         * style/StyleResolver.h:
3971         (WebCore::Style::Resolver::hasViewportDependentMediaQueries const): Deleted.
3972         (WebCore::Style::Resolver::hasAccessibilitySettingsDependentMediaQueries const): Deleted.
3973         (WebCore::Style::Resolver::hasAppearanceDependentMediaQueries const): Deleted.
3974         * style/StyleScope.cpp:
3975         (WebCore::Style::Scope::evaluateMediaQueriesForViewportChange):
3976         (WebCore::Style::Scope::evaluateMediaQueriesForAccessibilitySettingsChange):
3977         (WebCore::Style::Scope::evaluateMediaQueriesForAppearanceChange):
3978
3979         Call into general evaluateDynamicMediaQueries.
3980
3981         (WebCore::Style::Scope::evaluateMediaQueries):
3982
3983         In normal case we can just invalidate style, not throw everything away.
3984         This can be further improved by adding optimization rule sets.
3985
3986         * style/StyleScopeRuleSets.cpp:
3987         (WebCore::Style::ScopeRuleSets::updateUserAgentMediaQueryStyleIfNeeded const):
3988         (WebCore::Style::ScopeRuleSets::initializeUserStyle):
3989         (WebCore::Style::ScopeRuleSets::collectRulesFromUserStyleSheets):
3990         (WebCore::Style::makeRuleSet):
3991         (WebCore::Style::ScopeRuleSets::hasViewportDependentMediaQueries const):
3992         (WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):
3993         (WebCore::Style::ScopeRuleSets::appendAuthorStyleSheets):
3994         (WebCore::Style::ensureInvalidationRuleSets):
3995         * style/StyleScopeRuleSets.h:
3996
3997 2019-12-17  youenn fablet  <youenn@apple.com>
3998
3999         FileList should be exposed to workers
4000         https://bugs.webkit.org/show_bug.cgi?id=204074
4001
4002         Reviewed by Chris Dumez.
4003
4004         Covered by rebased test.
4005
4006         * fileapi/FileList.idl:
4007
4008 2019-12-16  Joonghun Park  <jh718.park@samsung.com>
4009
4010         Unreviewed. Remove the build warnings below since r253488.
4011         warning: unused parameter ‘foo’ [-Wunused-parameter]
4012
4013         No new tests, no behavioral changes.
4014
4015         * testing/Internals.cpp:
4016         (WebCore::Internals::hasSandboxMachLookupAccessToXPCServiceName):
4017
4018 2019-12-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
4019
4020         WebGLRenderingContext.texImage2D() should respect EXIF orientation
4021         https://bugs.webkit.org/show_bug.cgi?id=205141
4022
4023         Reviewed by Simon Fraser.
4024
4025         If image orientation is not the default, WebGLRenderingContext.texImage2D()
4026         needs to draw this image into an ImageBuffer, makes a temporary Image
4027         from the ImageBuffer then draw this temporary Image to the WebGL texture.
4028
4029         Test: fast/images/exif-orientation-webgl-texture.html
4030
4031         * html/canvas/WebGLRenderingContextBase.cpp:
4032         (WebCore::WebGLRenderingContextBase::texSubImage2D):
4033         (WebCore::WebGLRenderingContextBase::texImage2D):
4034         * platform/graphics/BitmapImage.h:
4035         * platform/graphics/Image.h:
4036         (WebCore::Image::orientation const):
4037
4038 2019-12-16  Simon Fraser  <simon.fraser@apple.com>
4039
4040         Change 'delegatesPageScaling' from a Setting to a flag on ScrollView
4041         https://bugs.webkit.org/show_bug.cgi?id=205319
4042
4043         Reviewed by Tim Horton.
4044
4045         delegatesPageScaling() is never toggled at runtime (even by tests), and it should
4046         be a flag on FrameView just like delegatesScrolling (maybe in future the flags can merge).
4047
4048         So remove the Setting, and have DrawingArea control whether page scaling is delegated.
4049         
4050         In WebKit1, WebFrameLoaderClient::transitionToCommittedForNewPage() turns on delegated
4051         page scaling for iOS.
4052
4053         * page/Frame.cpp:
4054         (WebCore::Frame::frameScaleFactor const):
4055         * page/FrameSnapshotting.cpp:
4056         (WebCore::snapshotFrameRectWithClip):
4057         * page/FrameView.cpp:
4058         (WebCore::FrameView::visibleContentScaleFactor const):
4059         * page/Page.cpp:
4060         (WebCore::Page::setPageScaleFactor):
4061         * page/Settings.yaml:
4062         * platform/ScrollView.cpp:
4063         (WebCore::ScrollView::setDelegatesPageScaling):
4064         * platform/ScrollView.h:
4065         (WebCore::ScrollView::delegatesPageScaling const):
4066         * rendering/RenderLayerCompositor.cpp:
4067         (WebCore::RenderLayerCompositor::addToOverlapMap const):
4068
4069 2019-12-16  Ryosuke Niwa  <rniwa@webkit.org>
4070