CSP violation reports should bypass CSP checks
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-04  Youenn Fablet  <youenn@apple.com>
2
3         CSP violation reports should bypass CSP checks
4         https://bugs.webkit.org/show_bug.cgi?id=192857
5         <rdar://problem/46887236>
6
7         Reviewed by Chris Dumez.
8
9         For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
10         This new option is unused by WebKit Legacy.
11         It is used by WebKit loader strategy to only send any CSP response header to network process
12         in case CSP checks should be done.
13
14         This option is used to disable CSP checks for Ping Loads that report CSP violations.
15
16         Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html
17
18         * loader/LoaderStrategy.h:
19         * loader/PingLoader.cpp:
20         (WebCore::PingLoader::loadImage):
21         (WebCore::PingLoader::sendPing):
22         (WebCore::PingLoader::sendViolationReport):
23         (WebCore::PingLoader::startPingLoad):
24         * loader/PingLoader.h:
25         * loader/cache/CachedResource.cpp:
26         (WebCore::CachedResource::load):
27
28 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
29
30         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
31         https://bugs.webkit.org/show_bug.cgi?id=193129
32
33         Reviewed by Tim Horton.
34
35         Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
36
37         * Sources.txt:
38         * WebCore.xcodeproj/project.pbxproj:
39         * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
40         (WebCore::nameForUndoRedo):
41         * editing/EditAction.h:
42         * editing/Editor.cpp:
43
44 2019-01-03  Matt Rajca  <mrajca@apple.com>
45
46         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
47         https://bugs.webkit.org/show_bug.cgi?id=193128
48         rdar://34554231
49
50         Reviewed by Jer Noble.
51
52         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
53         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
54         event along with a flag that indicates whether or not autoplay was actually prevented.
55         Moreover, we can include a flag that indicates whether the media element in question
56         is main content. Clients will then know in more cases when media was played with a user
57         gesture, whether or not it has audio, as well as its main content status. While the main
58         content heuristics may not be perfect, they covered the top 20 video-centric websites that
59         this was tested with and are meant to be used by clients for data evaluation purposes.
60
61         As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
62         since it now also applies to cases where there is a user gesture. The
63         `m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
64         `playbackStartedTime` which also covers all the cases we care about.
65
66         Tests: existing API tests were updated to reflect the new names. New API tests
67         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
68
69         * html/HTMLMediaElement.cpp:
70         (WebCore::convertEnumerationToString): Update to new enum cases.
71         (WebCore::HTMLMediaElement::setReadyState): Ditto.
72         (WebCore::HTMLMediaElement::play): Ditto.
73         (WebCore::HTMLMediaElement::playInternal): Also cover the case where
74          playback was not prevented but there was a user gesture.
75         (WebCore::HTMLMediaElement::pauseInternal): Use new name.
76         (WebCore::HTMLMediaElement::setVolume): Use new name.
77         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
78          DidPlayMediaWithUserGesture event when playback was started with a user
79          gesture as well.
80         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
81         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
82         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
83         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
84         (WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
85         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
86         (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
87          m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
88         (WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
89         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
90         * html/HTMLMediaElement.h:
91         (WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
92         (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
93         * html/MediaElementSession.cpp:
94         (WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
95          do the hit testing check for the purposes of autoplay events. It seems to fail on the
96          basic Vimeo player due to overlapping divs.
97         (WebCore::isElementMainContentForPurposesOfAutoplay):
98         (WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
99          here of hit testing.
100         (WebCore::isMainContentForPurposesOfAutoplay): Renamed.
101         * html/MediaElementSession.h:
102         * page/AutoplayEvent.h:
103
104 2019-01-04  Youenn Fablet  <youenn@apple.com>
105
106         Crash in WebCore::ServiceWorkerGlobalScope
107         https://bugs.webkit.org/show_bug.cgi?id=192513
108         <rdar://problem/46563880>
109
110         Reviewed by Alex Christensen.
111
112         Store the identifier in its own variable to make sure we do not use workerThread after being moved.
113
114         * workers/service/ServiceWorkerGlobalScope.cpp:
115         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
116
117 2019-01-04  Chris Fleizach  <cfleizach@apple.com>
118
119         AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
120         https://bugs.webkit.org/show_bug.cgi?id=193041
121         <rdar://problem/46954090>
122
123         Reviewed by Zalan Bujtas.
124
125         * en.lproj/Localizable.strings:
126         * platform/cocoa/LocalizedStringsCocoa.mm:
127         (WebCore::AXHorizontalRuleDescriptionText):
128
129 2019-01-04  Zalan Bujtas  <zalan@apple.com>
130
131         [LFC] ComputedHorizontalMargin should have optional members
132         https://bugs.webkit.org/show_bug.cgi?id=193131
133
134         Reviewed by Antti Koivisto.
135
136         Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
137         (see computed vs used values)
138
139         * layout/FormattingContext.h:
140         * layout/FormattingContextGeometry.cpp:
141         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
142         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
143         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
144         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
145         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
146         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
147         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
148         * layout/LayoutUnits.h:
149         * layout/MarginTypes.h:
150         * layout/Verification.cpp:
151         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
152         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
153         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
154         * layout/displaytree/DisplayBox.h:
155         (WebCore::Display::Box::setHorizontalMargin):
156         (WebCore::Display::Box::setHorizontalComputedMargin):
157         (WebCore::Display::Box::computedMarginStart const):
158         (WebCore::Display::Box::computedMarginEnd const):
159         * layout/floats/FloatAvoider.h:
160         (WebCore::Layout::FloatAvoider::marginStart const):
161         (WebCore::Layout::FloatAvoider::marginEnd const):
162         * layout/inlineformatting/InlineFormattingContext.cpp:
163         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
164         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
165         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
166
167 2019-01-04  Zalan Bujtas  <zalan@apple.com>
168
169         [LFC][BFC] Use computedValue and usedValue consistently
170         https://bugs.webkit.org/show_bug.cgi?id=193059
171
172         Reviewed by Antti Koivisto.
173
174         https://www.w3.org/TR/CSS22/cascade.html#value-stages
175
176         6.1.2 Computed values
177         Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
178         are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
179
180         6.1.3 Used values
181         Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
182         is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
183         until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
184         dependencies into an absolute value.
185
186         * layout/FormattingContext.cpp:
187         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
188         * layout/FormattingContextGeometry.cpp:
189         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
190         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
191         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
192         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
193         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
194         * layout/LayoutState.cpp:
195         (WebCore::Layout::LayoutState::LayoutState):
196         * layout/LayoutUnits.h:
197         * layout/Verification.cpp:
198         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
199         * layout/blockformatting/BlockFormattingContext.cpp:
200         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
201         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
202         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
203         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
204         * layout/displaytree/DisplayBox.cpp:
205         (WebCore::Display::Box::Box):
206         * layout/displaytree/DisplayBox.h:
207         (WebCore::Display::Box::setHasValidHorizontalComputedMargin):
208         (WebCore::Display::Box::setHorizontalComputedMargin):
209         (WebCore::Display::Box::computedMarginStart const):
210         (WebCore::Display::Box::computedMarginEnd const):
211         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
212         (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
213         (WebCore::Display::Box::nonComputedMarginStart const): Deleted.
214         (WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
215         * layout/floats/FloatAvoider.h:
216         (WebCore::Layout::FloatAvoider::marginStart const):
217         (WebCore::Layout::FloatAvoider::marginEnd const):
218         * layout/inlineformatting/InlineFormattingContext.cpp:
219         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
220
221 2019-01-03  Zalan Bujtas  <zalan@apple.com>
222
223         REGRESSION: -webkit-appearance test case crashes
224         https://bugs.webkit.org/show_bug.cgi?id=189302
225         <rdar://problem/44143049>
226
227         Reviewed by Wenson Hsieh.
228
229         The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
230         This patch removes the previous position inlining attempts.
231
232         Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
233
234         * rendering/RenderThemeMac.mm:
235         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
236
237 2019-01-03  David Kilzer  <ddkilzer@apple.com>
238
239         Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
240         <https://webkit.org/b/193122>
241         <rdar://problem/47022987>
242
243         Reviewed by Youenn Fablet.
244
245         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
246         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
247         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
248         - Remove `final` keyword so that
249           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
250           can be called.
251         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
252         - To fix the leak call
253           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
254           to create the object.
255
256 2019-01-03  Simon Fraser  <simon.fraser@apple.com>
257
258         REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
259         https://bugs.webkit.org/show_bug.cgi?id=193124
260         rdar://problem/46755409
261
262         Reviewed by Tim Horton.
263
264         Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
265         an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
266         So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
267         path that runs when top content inset changes.
268
269         Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
270
271         * rendering/RenderLayerCompositor.cpp:
272         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
273
274 2019-01-03  Chris Dumez  <cdumez@apple.com>
275
276         Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
277         https://bugs.webkit.org/show_bug.cgi?id=192997
278         <rdar://problem/46217271>
279
280         Reviewed by Antti Koivisto.
281
282         isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
283         The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
284
285         To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
286         only check if the frames belong to the same pages or if their openers do. We no longer check
287         openers' opener and up.
288
289         Note that this function is used to check if a frame is allowed to target another. In practice,
290         it is unlikely to be useful to navigate an opener's opener and an openee's openee.
291
292         Tests: fast/dom/Window/window-open-opener-cycle.html
293                fast/dom/Window/window-open-self-as-opener.html
294
295         * page/FrameTree.cpp:
296         (WebCore::isFrameFamiliarWith):
297
298 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
299
300         REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
301         https://bugs.webkit.org/show_bug.cgi?id=193095
302         <rdar://problem/47014944>
303
304         Reviewed by Zalan Bujtas.
305         
306         In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
307         and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
308         which continues to affect the appearance of text.
309         
310         Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
311
312         Test: compositing/contents-format/subpixel-antialiased-text.html
313
314         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
315         (WebCore::PlatformCALayer::drawLayerContents):
316
317 2019-01-02  David Kilzer  <ddkilzer@apple.com>
318
319         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
320         <https://webkit.org/b/193016>
321         <rdar://problem/46925703>
322
323         Reviewed by Simon Fraser.
324
325         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
326         (WebCore::copySampleBufferWithCurrentTimeStamp):
327         - Change to return RetainPtr<CMSampleBufferRef>.
328         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
329         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
330         - Check return value of copySampleBufferWithCurrentTimeStamp().
331         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
332           copySampleBufferWithCurrentTimeStamp() instead of leaking
333           `bufferWithCurrentTime` by using retainPtr().
334         (WebCore::createAudioFormatDescription):
335         - Extract method from appendAudioSampleBuffer() to return
336           RetainPtr<CMFormatDescriptionRef> after calling
337           CMAudioFormatDescriptionCreate().
338         - Check return value of CMAudioFormatDescriptionCreate().
339         (WebCore::createAudioSampleBufferWithPacketDescriptions):
340         - Extract method from appendAudioSampleBuffer() to return
341           RetainPtr<CMSampleBufferRef> after calling
342           CMAudioSampleBufferCreateWithPacketDescriptions().
343         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
344         - Check return values of createAudioFormatDescription() and
345           createAudioSampleBufferWithPacketDescriptions().
346         - Fix leaks by extracting code into helper methods that return
347           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
348           directly or leaking `sampleBuffer` by using retainPtr().
349
350 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
351
352         Add support for using the current text selection as the find string on iOS
353         https://bugs.webkit.org/show_bug.cgi?id=193034
354         <rdar://problem/45138739>
355
356         Reviewed by Tim Horton.
357
358         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
359         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
360         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
361         able to trigger find-in-page with this string.
362
363         Test: WebKit.UseSelectionAsFindString
364
365         * editing/Editor.cpp:
366         (WebCore::Editor::canCopyExcludingStandaloneImages const):
367
368         Make this helper function cross-platform.
369
370         * editing/Editor.h:
371         * editing/EditorCommand.cpp:
372         (WebCore::createCommandMap):
373         * editing/cocoa/EditorCocoa.mm:
374         (WebCore::Editor::takeFindStringFromSelection):
375
376         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
377         find string (see WebKit/ChangeLog for more details).
378
379         * editing/mac/EditorMac.mm:
380         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
381         (WebCore::Editor::takeFindStringFromSelection): Deleted.
382         * loader/EmptyClients.cpp:
383         * page/EditorClient.h:
384
385         Add a new editor client method to send the string for find-in-page to the UI process.
386
387 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
388
389         Web Inspector: Implement `queryObjects` Command Line API
390         https://bugs.webkit.org/show_bug.cgi?id=176766
391         <rdar://problem/34890689>
392
393         Reviewed by Joseph Pecoraro.
394
395         Test: inspector/console/queryObjects.html
396
397         * inspector/CommandLineAPIModuleSource.js:
398         (CommandLineAPI):
399         (CommandLineAPIImpl.prototype.queryObjects): Added.
400
401 2019-01-02  Charles Vazac  <cvazac@gmail.com>
402
403         Fix resourcetimingbufferfull bubbles attribute
404         https://bugs.webkit.org/show_bug.cgi?id=193087
405
406         Reviewed by Chris Dumez.
407
408         This change is covered by web-platform-tests [1].
409
410         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
411
412         * page/Performance.cpp:
413         (WebCore::Performance::resourceTimingBufferFullTimerFired):
414
415 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
416
417         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
418         https://bugs.webkit.org/show_bug.cgi?id=193010
419
420         Reviewed by Zalan Bujtas.
421
422         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
423         and make it an enum class.
424
425         * page/FrameView.cpp:
426         (WebCore::FrameView::scrollLayerID const):
427         * rendering/RenderLayer.h:
428         * rendering/RenderLayerBacking.cpp:
429         (WebCore::RenderLayerBacking::~RenderLayerBacking):
430         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
431         (WebCore::operator<<):
432         * rendering/RenderLayerBacking.h:
433         * rendering/RenderLayerCompositor.cpp:
434         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
435         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
436         (WebCore::scrollCoordinationRoleForNodeType):
437         (WebCore::RenderLayerCompositor::attachScrollingNode):
438         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
439         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
440         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
441         * rendering/RenderLayerCompositor.h:
442
443 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
444
445         Don't spin up a CalcParser if the current token is not a function token
446         https://bugs.webkit.org/show_bug.cgi?id=193067
447
448         Reviewed by Zalan Bujtas.
449
450         Various functions in CSSPropertyParserHelpers fall back to trying to parse
451         a calc expression if the normal parsing fails. Don't do this unless the
452         current token is a function token, which should be slightly more efficient.
453
454         * css/parser/CSSPropertyParserHelpers.cpp:
455         (WebCore::CSSPropertyParserHelpers::consumeInteger):
456         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
457         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
458         (WebCore::CSSPropertyParserHelpers::consumeNumber):
459         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
460         (WebCore::CSSPropertyParserHelpers::consumeLength):
461         (WebCore::CSSPropertyParserHelpers::consumePercent):
462         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
463         (WebCore::CSSPropertyParserHelpers::consumeAngle):
464         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
465         (WebCore::CSSPropertyParserHelpers::consumeTime):
466
467 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
468
469         Support css-color-4 rgb functions
470         https://bugs.webkit.org/show_bug.cgi?id=192321
471
472         Reviewed by Zalan Bujtas.
473         
474         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
475         The differences are:
476         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
477             rgb(128 34 56)
478             rgb(128 34 56 / 50%)
479         2. Floating point values are allowed, and rounded:
480             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
481         3. rgba() is a pure alias for rgb(), so these are equivalent:
482             rgb(128 34 56 / 50%)
483             rgba(128 34 56 / 50%)
484             
485         hsl()/hsla() parsing was already updated to this new syntax in r230861.
486
487         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
488
489         * css/parser/CSSPropertyParserHelpers.cpp:
490         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
491         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
492         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
493
494 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
495
496         Handle calc() expressions in gradient color stops
497         https://bugs.webkit.org/show_bug.cgi?id=193066
498         rdar://problem/46961985
499
500         Reviewed by Sam Weinig.
501         
502         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
503         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
504         calc values as well as angle ones.
505
506         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
507         just as isPx() etc do.
508
509         Test: fast/gradients/conic-calc-stop-position.html
510
511         * css/CSSPrimitiveValue.h:
512         (WebCore::CSSPrimitiveValue::isAngle const):
513         * css/parser/CSSPropertyParserHelpers.cpp:
514         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
515         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
516
517 2018-12-31  Keith Miller  <keith_miller@apple.com>
518
519         SourceProviders should use an actual URL instead of a string
520         https://bugs.webkit.org/show_bug.cgi?id=192734
521
522         Reviewed by Yusuke Suzuki.
523
524         Remove ScriptSourceCode's URL member and make the url() method
525         reference the URL on the SourceProvider. Also, avoid some
526         ref count churn.
527
528         Additionally, this patch fixes an existing bug in
529         WorkletGlobalScope() that would use a ScriptSourceCode after
530         WTFMoving it.
531
532         * bindings/js/CachedScriptSourceProvider.h:
533         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
534         * bindings/js/ScheduledAction.cpp:
535         (WebCore::ScheduledAction::execute):
536         * bindings/js/ScriptController.cpp:
537         (WebCore::ScriptController::executeScriptInWorld):
538         (WebCore::ScriptController::executeScript):
539         * bindings/js/ScriptSourceCode.h:
540         (WebCore::ScriptSourceCode::ScriptSourceCode):
541         (WebCore::ScriptSourceCode::m_code):
542         (WebCore::ScriptSourceCode::url const):
543         (WebCore::ScriptSourceCode::m_url): Deleted.
544         * dom/ScriptElement.cpp:
545         (WebCore::ScriptElement::prepareScript):
546         (WebCore::ScriptElement::requestModuleScript):
547         (WebCore::ScriptElement::executePendingScript):
548         * html/HTMLMediaElement.cpp:
549         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
550         * page/Frame.cpp:
551         (WebCore::Frame::injectUserScriptImmediately):
552         * workers/WorkerGlobalScope.cpp:
553         (WebCore::WorkerGlobalScope::importScripts):
554         * workers/WorkerThread.cpp:
555         (WebCore::WorkerThread::workerThread):
556         * worklets/WorkletGlobalScope.cpp:
557         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
558         * xml/parser/XMLDocumentParserLibxml2.cpp:
559         (WebCore::XMLDocumentParser::endElementNs):
560
561 2019-01-01  Jeff Miller  <jeffm@apple.com>
562
563         Update user-visible copyright strings to include 2019
564         https://bugs.webkit.org/show_bug.cgi?id=192811
565
566         Reviewed by Mark Lam.
567
568         * Info.plist:
569
570 2018-12-30  David Kilzer  <ddkilzer@apple.com>
571
572         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
573         <https://webkit.org/b/193058>
574         <rdar://problem/46979275>
575
576         Reviewed by Yusuke Suzuki.
577
578         * rendering/BorderEdge.cpp:
579         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
580         match new instance variable order.
581         * rendering/BorderEdge.h: Reorder instance variables to save
582         8 padding bytes.
583
584 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
585
586         [JSC] Remove one indirection in JSObject::toStringName
587         https://bugs.webkit.org/show_bug.cgi?id=193037
588
589         Reviewed by Keith Miller.
590
591         Use old JSObject::toStringName function here.
592
593         * bindings/js/JSDOMConstructorBase.cpp:
594         (WebCore::JSDOMConstructorBase::className):
595         (WebCore::JSDOMConstructorBase::toStringName):
596         * bindings/js/JSDOMConstructorBase.h:
597         (WebCore::JSDOMConstructorBase::className): Deleted.
598
599 2018-12-27  Alex Christensen  <achristensen@webkit.org>
600
601         Resurrect Mac CMake build
602         https://bugs.webkit.org/show_bug.cgi?id=192658
603
604         Reviewed by Yusuke Suzuki.
605
606         This makes it so JSC and most of WebCore builds.
607         WebCore's use of ARC seems inconsistent, so I'll fix that later.
608
609         * PlatformMac.cmake:
610         * config.h:
611
612 2018-12-26  Jim Mason  <jmason@ibinx.com>
613
614         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
615         https://bugs.webkit.org/show_bug.cgi?id=193036
616
617         Reviewed by Michael Catanzaro.
618
619         * platform/graphics/FontPlatformData.h:
620         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
621
622 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
623
624         Remove "using namespace std;"
625         https://bugs.webkit.org/show_bug.cgi?id=192973
626         <rdar://problem/46937309>
627
628         Unreviewed Windows port Debug builds fix.
629
630         No new tests since no behavior changes.
631
632         * accessibility/win/AXObjectCacheWin.cpp:
633         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
634
635 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
636
637         Remove "using namespace std;"
638         https://bugs.webkit.org/show_bug.cgi?id=192973
639
640         Reviewed by Alex Christensen.
641
642         Removed "using namespace std" statement, and use std:: prefix.
643
644         No new tests since no behavior changes.
645
646         * accessibility/win/AXObjectCacheWin.cpp:
647         * platform/graphics/GraphicsContext3DPrivate.cpp:
648         * platform/graphics/cairo/ImageBufferCairo.cpp:
649         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
650         * platform/graphics/win/FontWin.cpp:
651         (WebCore::FontCascade::floatWidthForComplexText const):
652         * platform/graphics/win/GraphicsContextCGWin.cpp:
653         * platform/graphics/win/GraphicsContextCairoWin.cpp:
654         * platform/graphics/win/GraphicsContextDirect2D.cpp:
655         * platform/graphics/win/GraphicsContextWin.cpp:
656         * platform/graphics/win/SimpleFontDataCGWin.cpp:
657         * platform/graphics/win/UniscribeController.cpp:
658         (WebCore::UniscribeController::UniscribeController):
659         (WebCore::UniscribeController::shapeAndPlaceItem):
660         * platform/image-decoders/ScalableImageDecoder.cpp:
661         * platform/text/LocaleICU.cpp:
662         * platform/text/win/LocaleWin.cpp:
663         * platform/win/ScrollbarThemeWin.cpp:
664         * rendering/RenderRubyRun.cpp:
665         (WebCore::RenderRubyRun::layoutBlock):
666         * rendering/RenderThemeWin.cpp:
667         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
668         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
669         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
670         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
671         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
672         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
673         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
674
675 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
676
677         Change ScrollingNodeType to an enum class
678         https://bugs.webkit.org/show_bug.cgi?id=193009
679
680         Reviewed by Zalan Bujtas.
681
682         Change the ScrollingNodeType enum to an enum class.
683         
684         No behavior change.
685
686         * page/scrolling/AsyncScrollingCoordinator.cpp:
687         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
688         * page/scrolling/ScrollingCoordinator.cpp:
689         (WebCore::operator<<):
690         * page/scrolling/ScrollingCoordinator.h:
691         * page/scrolling/ScrollingStateFixedNode.cpp:
692         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
693         * page/scrolling/ScrollingStateNode.h:
694         (WebCore::ScrollingStateNode::isFixedNode const):
695         (WebCore::ScrollingStateNode::isStickyNode const):
696         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
697         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
698         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
699         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
700         * page/scrolling/ScrollingStateStickyNode.cpp:
701         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
702         * page/scrolling/ScrollingStateTree.cpp:
703         (WebCore::ScrollingStateTree::createNode):
704         (WebCore::ScrollingStateTree::attachNode):
705         * page/scrolling/ScrollingTreeNode.h:
706         (WebCore::ScrollingTreeNode::isFixedNode const):
707         (WebCore::ScrollingTreeNode::isStickyNode const):
708         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
709         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
710         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
711         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
712         * page/scrolling/ios/ScrollingTreeIOS.cpp:
713         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
714         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
715         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
716         * page/scrolling/mac/ScrollingTreeMac.cpp:
717         (ScrollingTreeMac::createScrollingTreeNode):
718         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
719         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
720         * platform/graphics/GraphicsLayerClient.h:
721         * rendering/RenderLayerCompositor.cpp:
722         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
723         (WebCore::scrollCoordinationRoleForNodeType):
724         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
725         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
726
727 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
728
729         [HarfBuzz] Width not correctly reported as 0 for zero font size
730         https://bugs.webkit.org/show_bug.cgi?id=192986
731
732         Reviewed by Michael Catanzaro.
733
734         Fixes test fast/text/font-size-zero.html
735
736         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
737         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
738         size is zero.
739
740 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
741
742         Use Ref<> as much as possible
743         https://bugs.webkit.org/show_bug.cgi?id=192808
744
745         Reviewed by Alex Christensen.
746
747         * Modules/encryptedmedia/NavigatorEME.cpp:
748         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
749         * Modules/fetch/FetchBody.cpp:
750         (WebCore::FetchBody::bodyAsFormData const):
751         * Modules/geolocation/Geolocation.cpp:
752         (WebCore::Geolocation::getCurrentPosition):
753         (WebCore::Geolocation::watchPosition):
754         * Modules/indexeddb/IDBDatabase.cpp:
755         (WebCore::IDBDatabase::objectStoreNames const):
756         * Modules/indexeddb/IDBDatabase.h:
757         * Modules/indexeddb/IDBObjectStore.cpp:
758         (WebCore::IDBObjectStore::indexNames const):
759         * Modules/indexeddb/IDBObjectStore.h:
760         * Modules/indexeddb/IDBTransaction.cpp:
761         (WebCore::IDBTransaction::scheduleOperation):
762         * Modules/indexeddb/IDBTransaction.h:
763         * Modules/indexeddb/client/TransactionOperation.h:
764         (WebCore::IDBClient::createTransactionOperation):
765         * Modules/mediastream/MediaDevices.cpp:
766         (WebCore::MediaDevices::getUserMedia const):
767         (WebCore::MediaDevices::getDisplayMedia const):
768         * Modules/mediastream/UserMediaRequest.cpp:
769         (WebCore::UserMediaRequest::create):
770         * Modules/mediastream/UserMediaRequest.h:
771         * Modules/webaudio/AudioParam.cpp:
772         (WebCore::AudioParam::calculateFinalValues):
773         * Modules/webaudio/ScriptProcessorNode.cpp:
774         (WebCore::ScriptProcessorNode::initialize):
775         * Modules/webdatabase/SQLStatement.cpp:
776         (WebCore::SQLStatement::execute):
777         * Modules/webgpu/WebGPU.cpp:
778         (WebCore::WebGPU::requestAdapter const):
779         * Modules/webgpu/WebGPUAdapter.cpp:
780         (WebCore::WebGPUAdapter::create):
781         * Modules/webgpu/WebGPUAdapter.h:
782         * Modules/webgpu/WebGPUBuffer.cpp:
783         (WebCore::WebGPUBuffer::create):
784         * Modules/webgpu/WebGPUBuffer.h:
785         * Modules/webgpu/WebGPUCommandBuffer.cpp:
786         (WebCore::WebGPUCommandBuffer::create):
787         (WebCore::WebGPUCommandBuffer::beginRenderPass):
788         * Modules/webgpu/WebGPUCommandBuffer.h:
789         * Modules/webgpu/WebGPUDevice.cpp:
790         (WebCore::WebGPUDevice::create):
791         (WebCore::WebGPUDevice::createBuffer const):
792         (WebCore::WebGPUDevice::createShaderModule const):
793         (WebCore::WebGPUDevice::createRenderPipeline const):
794         (WebCore::WebGPUDevice::createCommandBuffer const):
795         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
796         (WebCore::WebGPURenderPassEncoder::create):
797         * Modules/webgpu/WebGPURenderPassEncoder.h:
798         * Modules/webgpu/WebGPURenderPipeline.cpp:
799         (WebCore::WebGPURenderPipeline::create):
800         * Modules/webgpu/WebGPURenderPipeline.h:
801         * Modules/webgpu/WebGPUShaderModule.cpp:
802         (WebCore::WebGPUShaderModule::create):
803         * Modules/webgpu/WebGPUShaderModule.h:
804         * Modules/webgpu/WebGPUTexture.cpp:
805         (WebCore::WebGPUTexture::createDefaultTextureView):
806         * Modules/webgpu/WebGPUTextureView.cpp:
807         (WebCore::WebGPUTextureView::create):
808         * Modules/webgpu/WebGPUTextureView.h:
809         * accessibility/AXObjectCache.cpp:
810         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
811         * accessibility/atk/AXObjectCacheAtk.cpp:
812         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
813         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
814         (webkitAccessibleHyperlinkGetStartIndex):
815         (webkitAccessibleHyperlinkGetEndIndex):
816         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
817         (getSelectionOffsetsForObject):
818         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
819         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
820         * bindings/js/JSDOMGlobalObjectTask.cpp:
821         * bindings/js/JSDOMWindowBase.cpp:
822         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
823         * bindings/js/JSWorkerGlobalScopeBase.cpp:
824         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
825         * bindings/js/ScriptControllerMac.mm:
826         (WebCore::ScriptController::createScriptInstanceForWidget):
827         * bindings/js/SerializedScriptValue.cpp:
828         (WebCore::CloneDeserializer::readTerminal):
829         (WebCore::SerializedScriptValue::create):
830         * bridge/objc/objc_instance.h:
831         * bridge/objc/objc_instance.mm:
832         (ObjcInstance::create):
833         * css/CSSComputedStyleDeclaration.cpp:
834         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
835         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
836         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
837         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
838         * css/CSSComputedStyleDeclaration.h:
839         * css/CSSFontFaceSource.cpp:
840         (WebCore::CSSFontFaceSource::load):
841         * css/CSSStyleSheet.cpp:
842         (WebCore::CSSStyleSheet::rules):
843         * css/FontFace.cpp:
844         (WebCore::FontFace::unicodeRange const):
845         (WebCore::FontFace::featureSettings const):
846         * css/InspectorCSSOMWrappers.cpp:
847         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
848         * css/SVGCSSComputedStyleDeclaration.cpp:
849         (WebCore::strokeDashArrayToCSSValueList):
850         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
851         * css/StyleResolver.cpp:
852         (WebCore::StyleResolver::createFilterOperations):
853         * css/StyleRule.cpp:
854         (WebCore::StyleRuleBase::createCSSOMWrapper const):
855         * css/StyleRule.h:
856         * dom/ChildListMutationScope.cpp:
857         (WebCore::ChildListMutationAccumulator::getOrCreate):
858         * dom/ChildListMutationScope.h:
859         * dom/DocumentMarkerController.cpp:
860         (WebCore::updateRenderedRectsForMarker):
861         * dom/InlineStyleSheetOwner.cpp:
862         (WebCore::InlineStyleSheetOwner::createSheet):
863         * dom/PointerEvent.h:
864         * dom/UserGestureIndicator.h:
865         (WebCore::UserGestureToken::create):
866         * editing/AlternativeTextController.cpp:
867         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
868         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
869         (WebCore::AlternativeTextController::respondToUnappliedEditing):
870         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
871         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
872         * editing/ApplyStyleCommand.cpp:
873         (WebCore::ApplyStyleCommand::applyBlockStyle):
874         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
875         * editing/CompositeEditCommand.cpp:
876         (WebCore::CompositeEditCommand::targetRanges const):
877         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
878         (WebCore::CompositeEditCommand::moveParagraphs):
879         * editing/DeleteSelectionCommand.cpp:
880         (WebCore::DeleteSelectionCommand::mergeParagraphs):
881         * editing/Editing.cpp:
882         (WebCore::visiblePositionForIndexUsingCharacterIterator):
883         * editing/EditingStyle.cpp:
884         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
885         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
886         (WebCore::EditingStyle::prepareToApplyAt):
887         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
888         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
889         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
890         (WebCore::extractPropertiesNotIn):
891         * editing/Editor.cpp:
892         (WebCore::Editor::setBaseWritingDirection):
893         (WebCore::Editor::setComposition):
894         * editing/EditorCommand.cpp:
895         (WebCore::executeApplyParagraphStyle):
896         (WebCore::executeMakeTextWritingDirectionLeftToRight):
897         (WebCore::executeMakeTextWritingDirectionNatural):
898         (WebCore::executeMakeTextWritingDirectionRightToLeft):
899         * editing/FormatBlockCommand.cpp:
900         (WebCore::FormatBlockCommand::formatRange):
901         * editing/RemoveFormatCommand.cpp:
902         (WebCore::RemoveFormatCommand::doApply):
903         * editing/ReplaceRangeWithTextCommand.cpp:
904         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
905         * editing/ReplaceSelectionCommand.cpp:
906         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
907         (WebCore::handleStyleSpansBeforeInsertion):
908         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
909         * editing/SpellingCorrectionCommand.cpp:
910         (WebCore::SpellingCorrectionCommand::targetRanges const):
911         * editing/TextCheckingHelper.cpp:
912         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
913         * editing/TypingCommand.cpp:
914         (WebCore::TypingCommand::insertText):
915         (WebCore::TypingCommand::willAddTypingToOpenCommand):
916         * editing/VisibleUnits.cpp:
917         (WebCore::distanceBetweenPositions):
918         * editing/cocoa/EditorCocoa.mm:
919         (WebCore::Editor::selectionInWebArchiveFormat):
920         * editing/ios/DictationCommandIOS.cpp:
921         (WebCore::DictationCommandIOS::doApply):
922         * editing/ios/EditorIOS.mm:
923         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
924         (WebCore::Editor::removeUnchangeableStyles):
925         (WebCore::Editor::writeImageToPasteboard):
926         * editing/mac/EditorMac.mm:
927         (WebCore::Editor::replaceNodeFromPasteboard):
928         (WebCore::Editor::imageInWebArchiveFormat):
929         * editing/markup.cpp:
930         (WebCore::styleFromMatchedRulesAndInlineDecl):
931         (WebCore::createFragmentForTransformToFragment):
932         * fileapi/FileReaderLoader.cpp:
933         (WebCore::FileReaderLoader::didFinishLoading):
934         * html/FTPDirectoryDocument.cpp:
935         (WebCore::createTemplateDocumentData):
936         * html/HTMLMediaElement.cpp:
937         (WebCore::HTMLMediaElement::scheduleEvent):
938         (WebCore::HTMLMediaElement::createMediaControls):
939         * html/HTMLTableElement.cpp:
940         (WebCore::HTMLTableElement::createSharedCellStyle):
941         * html/HTMLTableElement.h:
942         * html/URLUtils.h:
943         (WebCore::URLUtils<T>::origin const):
944         * html/parser/HTMLConstructionSite.cpp:
945         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
946         * html/shadow/TextControlInnerElements.cpp:
947         (WebCore::TextControlInnerElement::resolveCustomStyle):
948         * html/track/WebVTTParser.cpp:
949         (WebCore::WebVTTParser::createNewCue):
950         * inspector/DOMPatchSupport.cpp:
951         * inspector/InspectorCanvas.cpp:
952         (WebCore::InspectorCanvas::buildInitialState):
953         (WebCore::InspectorCanvas::buildAction):
954         * inspector/InspectorFrontendClientLocal.cpp:
955         (WebCore::InspectorFrontendClientLocal::openInNewTab):
956         * inspector/InspectorStyleSheet.cpp:
957         (WebCore::asCSSRuleList):
958         (WebCore::InspectorStyle::styleWithProperties const):
959         (WebCore::InspectorStyleSheet::ensureSourceData):
960         * inspector/agents/InspectorCanvasAgent.cpp:
961         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
962         * inspector/agents/InspectorIndexedDBAgent.cpp:
963         (WebCore::Inspector::keyPathFromIDBKeyPath):
964         * inspector/agents/InspectorPageAgent.cpp:
965         (WebCore::InspectorPageAgent::archive):
966         * loader/EmptyClients.cpp:
967         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
968         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
969         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
970         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
971         * loader/FrameLoader.cpp:
972         (WebCore::FrameLoader::loadURL):
973         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
974         (WebCore::FrameLoader::loadDifferentDocumentItem):
975         * loader/WorkerThreadableLoader.cpp:
976         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
977         * loader/archive/mhtml/MHTMLParser.cpp:
978         (WebCore::MHTMLParser::addResourceToArchive):
979         (WebCore::MHTMLParser::parseNextPart):
980         * loader/cache/MemoryCache.cpp:
981         (WebCore::MemoryCache::addImageToCache):
982         (WebCore::MemoryCache::removeResourcesWithOrigin):
983         * page/DOMWindow.cpp:
984         (WebCore::DOMWindow::getMatchedCSSRules const):
985         (WebCore::DOMWindow::createWindow):
986         * page/EventHandler.cpp:
987         (WebCore::textDistance):
988         * page/Page.cpp:
989         (WebCore::Page::userStyleSheet const):
990         * page/animation/CSSPropertyAnimation.cpp:
991         (WebCore::blendFilterOperations):
992         * page/ios/FrameIOS.mm:
993         (WebCore::Frame::initWithSimpleHTMLDocument):
994         (WebCore::Frame::interpretationsForCurrentRoot const):
995         * page/mac/ServicesOverlayController.mm:
996         (WebCore::ServicesOverlayController::Highlight::fadeIn):
997         (WebCore::ServicesOverlayController::Highlight::fadeOut):
998         * platform/SharedBuffer.cpp:
999         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
1000         * platform/audio/HRTFElevation.cpp:
1001         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
1002         * platform/audio/SincResampler.cpp:
1003         (WebCore::SincResampler::consumeSource):
1004         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1005         (WebCore::AudioFileReader::createBus):
1006         * platform/audio/mac/AudioFileReaderMac.cpp:
1007         (WebCore::AudioFileReader::createBus):
1008         * platform/graphics/Icon.h:
1009         (WebCore::Icon::create):
1010         * platform/graphics/InbandTextTrackPrivate.h:
1011         (WebCore::InbandTextTrackPrivate::create):
1012         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1013         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1014         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
1015         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1016         (WebCore::fulfillRequestWithKeyData):
1017         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1018         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1019         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1020         (WebCore::MediaSourcePrivateAVFObjC::create):
1021         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
1022         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1023         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1024         (WebCore::SourceBufferPrivateAVFObjC::create):
1025         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1026         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
1027         * platform/graphics/ca/TileController.cpp:
1028         (WebCore::TileController::createTileLayer):
1029         * platform/graphics/ca/TileController.h:
1030         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1031         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
1032         (WebCore::CACFLayerTreeHost::create):
1033         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1034         (WebCore::GPUBuffer::create):
1035         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1036         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
1037         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
1038         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
1039         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
1040         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1041         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
1042         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1043         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1044         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
1045         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1046         (WebCore::AppendPipeline::appsinkNewSample):
1047         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
1048         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
1049         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
1050         (WebCore::ISOTrackEncryptionBox::parse):
1051         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1052         (WebCore::applyFilterAnimation):
1053         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1054         (WebCore::TextureMapperPlatformLayerBuffer::clone):
1055         * platform/graphics/transforms/TransformOperations.cpp:
1056         (WebCore::TransformOperations::blendByMatchingOperations const):
1057         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1058         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
1059         * platform/mock/mediasource/MockBox.cpp:
1060         (WebCore::MockInitializationBox::MockInitializationBox):
1061         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1062         (WebCore::MockSourceBufferPrivate::create):
1063         (WebCore::MockSourceBufferPrivate::append):
1064         * platform/mock/mediasource/MockSourceBufferPrivate.h:
1065         * platform/mock/mediasource/MockTracks.h:
1066         (WebCore::MockTextTrackPrivate::create):
1067         (WebCore::MockVideoTrackPrivate::create):
1068         * platform/network/FormData.h:
1069         (WebCore::FormData::decode):
1070         * platform/network/cocoa/CookieStorageObserver.h:
1071         * platform/network/cocoa/CookieStorageObserver.mm:
1072         (WebCore::CookieStorageObserver::create):
1073         * platform/network/soup/ResourceRequestSoup.cpp:
1074         (WebCore::appendEncodedBlobItemToSoupMessageBody):
1075         (WebCore::ResourceRequest::updateSoupMessageBody const):
1076         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1077         (WebCore::HyphenationDictionary::createNull):
1078         (WebCore::HyphenationDictionary::create):
1079         * platform/win/SearchPopupMenuWin.cpp:
1080         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
1081         (WebCore::SearchPopupMenuWin::popupMenu):
1082         * platform/win/SearchPopupMenuWin.h:
1083         * rendering/RenderThemeIOS.mm:
1084         (WebCore::applyCommonButtonPaddingToStyle):
1085         (WebCore::RenderThemeIOS::paintProgressBar):
1086         (WebCore::RenderThemeIOS::adjustButtonStyle const):
1087         (WebCore::paintAttachmentIcon):
1088         * rendering/svg/SVGRenderTreeAsText.cpp:
1089         (WebCore::writeSVGResourceContainer):
1090         * storage/Storage.cpp:
1091         (WebCore::Storage::create):
1092         (WebCore::Storage::Storage):
1093         * storage/Storage.h:
1094         (WebCore::Storage::area const):
1095         * storage/StorageNamespace.h:
1096         * storage/StorageNamespaceProvider.cpp:
1097         (WebCore::StorageNamespaceProvider::localStorageArea):
1098         * storage/StorageNamespaceProvider.h:
1099         * svg/SVGElement.cpp:
1100         (WebCore::SVGElement::getPresentationAttribute):
1101         * svg/SVGFEBlendElement.cpp:
1102         (WebCore::SVGFEBlendElement::build):
1103         * svg/SVGFEColorMatrixElement.cpp:
1104         (WebCore::SVGFEColorMatrixElement::build):
1105         * svg/SVGFEComponentTransferElement.cpp:
1106         (WebCore::SVGFEComponentTransferElement::build):
1107         * svg/SVGFECompositeElement.cpp:
1108         (WebCore::SVGFECompositeElement::build):
1109         * svg/SVGFEDiffuseLightingElement.cpp:
1110         (WebCore::SVGFEDiffuseLightingElement::build):
1111         * svg/SVGFEDisplacementMapElement.cpp:
1112         (WebCore::SVGFEDisplacementMapElement::build):
1113         * svg/SVGFEDropShadowElement.cpp:
1114         (WebCore::SVGFEDropShadowElement::build):
1115         * svg/SVGFEGaussianBlurElement.cpp:
1116         (WebCore::SVGFEGaussianBlurElement::build):
1117         * svg/SVGFEMergeElement.cpp:
1118         (WebCore::SVGFEMergeElement::build):
1119         * svg/SVGFEMorphologyElement.cpp:
1120         (WebCore::SVGFEMorphologyElement::build):
1121         * svg/SVGFEOffsetElement.cpp:
1122         (WebCore::SVGFEOffsetElement::build):
1123         * svg/SVGFESpecularLightingElement.cpp:
1124         (WebCore::SVGFESpecularLightingElement::build):
1125         * svg/SVGFETileElement.cpp:
1126         (WebCore::SVGFETileElement::build):
1127         * testing/GCObservation.h:
1128         * xml/XSLTProcessor.cpp:
1129         (WebCore::XSLTProcessor::createDocumentFromSource):
1130         * xml/parser/XMLDocumentParser.cpp:
1131         (WebCore::XMLDocumentParser::parseDocumentFragment):
1132
1133 2018-12-21  Chris Dumez  <cdumez@apple.com>
1134
1135         navigator.userAgent in service workers does not reflect customUserAgent set by client
1136         https://bugs.webkit.org/show_bug.cgi?id=192951
1137
1138         Reviewed by Youenn Fablet.
1139
1140         Whenever a service worker client registers itself, also pass its effective user agent.
1141         In the network process, for each origin, we store the latest client's user agent and
1142         use it when starting the service worker.
1143
1144         * dom/Document.cpp:
1145         (WebCore::Document::setServiceWorkerConnection):
1146         * loader/DocumentLoader.cpp:
1147         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
1148         * workers/service/SWClientConnection.h:
1149         * workers/service/server/SWServer.cpp:
1150         (WebCore::SWServer::serviceWorkerClientUserAgent const):
1151         (WebCore::SWServer::installContextData):
1152         (WebCore::SWServer::runServiceWorker):
1153         (WebCore::SWServer::registerServiceWorkerClient):
1154         * workers/service/server/SWServer.h:
1155         * workers/service/server/SWServerToContextConnection.h:
1156         * workers/service/server/SWServerWorker.cpp:
1157         (WebCore::SWServerWorker::userAgent const):
1158         * workers/service/server/SWServerWorker.h:
1159
1160 2018-12-21  Youenn Fablet  <youenn@apple.com>
1161
1162         RTCRtpSender.setParameters() does set active parameter
1163         https://bugs.webkit.org/show_bug.cgi?id=192848
1164
1165         Reviewed by Eric Carlson.
1166
1167         Covered by updated test.
1168
1169         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1170         (WebCore::updateRTCRtpSendParameters):
1171         The routine was updating the local value, not the out parameter.
1172
1173 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
1174
1175         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
1176         https://bugs.webkit.org/show_bug.cgi?id=187896
1177         <rdar://problem/42681445>
1178
1179         Reviewed by Jer Noble.
1180
1181         No new tests, tested manually.
1182
1183         * platform/mediastream/mac/AVVideoCaptureSource.h:
1184         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1185         (WebCore::AVVideoCaptureSource::deviceDisconnected):
1186         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
1187         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
1188         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
1189         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1190         (WebCore::deviceHasInputStreams):
1191         (WebCore::isValidCaptureDevice):
1192         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
1193         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
1194         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
1195         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
1196         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1197         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
1198         (WebCore::CoreAudioSharedUnit::devicesChanged):
1199         (WebCore::CoreAudioSharedUnit::startProducingData):
1200         (WebCore::CoreAudioSharedUnit::startInternal):
1201         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
1202         (WebCore::CoreAudioSharedUnit::captureFailed):
1203         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
1204         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1205         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
1206         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1207
1208 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
1209
1210         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
1211         TestWebKitAPI.QuickLook.LegacyQuickLookContent
1212         https://bugs.webkit.org/show_bug.cgi?id=192859
1213         <rdar://problem/46887237>
1214
1215         Reviewed by Antti Koivisto.
1216
1217         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
1218         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
1219
1220         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
1221         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
1222
1223         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
1224
1225         * dom/ContainerNodeAlgorithms.cpp:
1226         (WebCore::notifyChildNodeInserted):
1227         (WebCore::notifyChildNodeRemoved):
1228         * dom/Document.cpp:
1229         (WebCore::Document::nodeChildrenWillBeRemoved):
1230         (WebCore::Document::nodeWillBeRemoved):
1231         * dom/ScriptDisallowedScope.h:
1232         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
1233         * html/HTMLFormElement.cpp:
1234         (WebCore:: const):
1235
1236 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
1237
1238         Update status of some WebCore features in features.json
1239         https://bugs.webkit.org/show_bug.cgi?id=192998
1240
1241         Reviewed by Tim Horton.
1242
1243         * features.json:
1244         - Variation Fonts: Supported
1245         - Conic Gradients: Supported in Preview
1246         - Web Share: Supported in Preview
1247         - <datalist>: Supported in Preview
1248         - Intersection Observers: Supported in Preview
1249
1250 2018-12-21  Zalan Bujtas  <zalan@apple.com>
1251
1252         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
1253         https://bugs.webkit.org/show_bug.cgi?id=192357
1254         <rdar://problem/42852260>
1255
1256         Reviewed by Simon Fraser.
1257
1258         Do not try to paint the file picker when painting is disabled.
1259
1260         * rendering/RenderFileUploadControl.cpp:
1261         (WebCore::RenderFileUploadControl::paintObject):
1262
1263 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
1264
1265         [WebAuthN] userPresence should always be true
1266         https://bugs.webkit.org/show_bug.cgi?id=192835
1267         <rdar://problem/46538788>
1268
1269         Reviewed by Brent Fulgham.
1270
1271         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
1272         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
1273         After discussing with other members of the working group, we decided to make userPresence always default to true.
1274
1275         Covered by exisiting tests.
1276
1277         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
1278         (fido::encodeGetAssertionRequestAsCBOR):
1279
1280 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
1281
1282         [WebAuthN] Import an APDU coder from Chromium
1283         https://bugs.webkit.org/show_bug.cgi?id=192949
1284         <rdar://problem/46879933>
1285
1286         Reviewed by Brent Fulgham.
1287
1288         This patch imports an APDU coder from Chromium. Here is the documentation:
1289         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
1290         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
1291
1292         Here is a list of files that are imported from Chromium:
1293         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
1294         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1295         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1296         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1297         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1298
1299         Covered by API tests.
1300
1301         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
1302         (apdu::ApduCommand::createFromMessage):
1303         (apdu::ApduCommand::ApduCommand):
1304         (apdu::ApduCommand::getEncodedCommand const):
1305         * Modules/webauthn/apdu/ApduCommand.h: Added.
1306         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
1307         (apdu::ApduResponse::createFromMessage):
1308         (apdu::ApduResponse::ApduResponse):
1309         (apdu::ApduResponse::getEncodedResponse const):
1310         * Modules/webauthn/apdu/ApduResponse.h: Added.
1311         * Sources.txt:
1312         * WebCore.xcodeproj/project.pbxproj:
1313
1314 2018-12-21  Jer Noble  <jer.noble@apple.com>
1315
1316         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
1317         https://bugs.webkit.org/show_bug.cgi?id=192985
1318         <rdar://problem/46750743>
1319
1320         Reviewed by Eric Carlson.
1321
1322         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
1323
1324         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
1325         (WebCore::WebKitMediaKeys::setMediaElement):
1326         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
1327         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1328         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1329         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1330         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1331         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
1332
1333 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1334
1335         CSS variables don't work for colors in "border" property
1336         https://bugs.webkit.org/show_bug.cgi?id=192922
1337
1338         Reviewed by Simon Fraser.
1339
1340         ParseColorFunction no longer consumes anything if the color was not valid.
1341
1342         Test: css-custom-properties-api/border-variable-parsing.html
1343
1344         * css/parser/CSSPropertyParserHelpers.cpp:
1345         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
1346
1347 2018-12-21  Justin Fan  <justin_fan@apple.com>
1348
1349         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
1350         https://bugs.webkit.org/show_bug.cgi?id=192990
1351
1352         Reviewed by Myles C. Maxfield.
1353
1354         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
1355         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
1356
1357         No new tests; no change in behavior.
1358
1359         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
1360         (WebCore::WebGPUBindGroupLayout::create):
1361         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
1362         * Modules/webgpu/WebGPUBindGroupLayout.h:
1363         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
1364         * Modules/webgpu/WebGPUDevice.cpp:
1365         (WebCore::WebGPUDevice::createBindGroupLayout const):
1366         * platform/graphics/gpu/GPUBindGroupLayout.h:
1367         * platform/graphics/gpu/GPUDevice.cpp:
1368         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
1369         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
1370         * platform/graphics/gpu/GPUDevice.h:
1371         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1372         (WebCore::appendArgumentToArray):
1373         (WebCore::newEncoder):
1374         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
1375         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1376         (WebCore::appendArgumentToArrayInMap): Deleted.
1377         (WebCore::GPUBindGroupLayout::create): Deleted.
1378
1379         Deleted unneeded GPUBindGroupLayout.cpp:
1380         * Sources.txt:
1381         * WebCore.xcodeproj/project.pbxproj:
1382         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
1383
1384 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
1385
1386         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
1387         https://bugs.webkit.org/show_bug.cgi?id=190466
1388
1389         Reviewed by Youenn Fablet.
1390
1391         Added persistency to the DeviceIdHashSaltStorage.
1392
1393         * platform/glib/FileSystemGlib.cpp:
1394         (WebCore::FileSystem::getFileSize): Implemented this function to
1395         allow sharing code with the statistics storage class.
1396         * platform/glib/KeyedDecoderGlib.cpp:
1397         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
1398         condition to control situations where the key is empty, it can
1399         happen if the user modifies the file in the disk.
1400         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
1401         to make work compilation with debug, unified builds.
1402
1403 2018-12-21  Zalan Bujtas  <zalan@apple.com>
1404
1405         Synchronous media query evaluation could destroy current Frame/FrameView.
1406         https://bugs.webkit.org/show_bug.cgi?id=192781
1407         <rdar://problem/34416793>
1408
1409         Reviewed by Chris Dumez.
1410
1411         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
1412
1413         Test: printing/print-with-media-query-destory.html
1414
1415         * loader/DocumentLoader.cpp:
1416         (WebCore::DocumentLoader::finishedLoading):
1417         * page/Frame.cpp:
1418         (WebCore::Frame::setPrinting):
1419         * page/FrameView.cpp:
1420         (WebCore::FrameView::forceLayoutForPagination):
1421         * page/PrintContext.cpp:
1422         (WebCore::PrintContext::PrintContext):
1423         (WebCore::PrintContext::computePageRects):
1424         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
1425         (WebCore::PrintContext::begin):
1426         (WebCore::PrintContext::computeAutomaticScaleFactor):
1427         (WebCore::PrintContext::spoolPage):
1428         (WebCore::PrintContext::spoolRect):
1429         (WebCore::PrintContext::end):
1430         * page/PrintContext.h:
1431         (WebCore::PrintContext::frame const): Deleted.
1432
1433 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1434
1435         Setting the file wrapper and content type of an attachment to a PDF should update its image
1436         https://bugs.webkit.org/show_bug.cgi?id=192984
1437         <rdar://problem/46798028>
1438
1439         Reviewed by Tim Horton.
1440
1441         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
1442         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
1443
1444         * html/HTMLAttachmentElement.cpp:
1445         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
1446         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
1447
1448 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1449
1450         Repeated background images with zero size should display the background color
1451         https://bugs.webkit.org/show_bug.cgi?id=192962
1452
1453         Reviewed by Antti Koivisto.
1454
1455         Test: fast/backgrounds/background-repeat-with-zero-size.html
1456
1457         * platform/LengthSize.h:
1458         (WebCore::LengthSize::isEmpty const):
1459         * rendering/RenderBoxModelObject.cpp:
1460         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1461         * rendering/style/FillLayer.h:
1462         (WebCore::FillLayer::isEmpty const):
1463
1464 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
1465
1466         [css-grid] Fix percentages in relative offsets for grid items
1467         https://bugs.webkit.org/show_bug.cgi?id=190492
1468
1469         Reviewed by Sergio Villar Senin.
1470
1471         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
1472         where the containing block is the grid area.
1473         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
1474
1475         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
1476
1477         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
1478         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
1479         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
1480         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
1481         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
1482         * rendering/RenderBox.h:
1483         * rendering/RenderBoxModelObject.cpp:
1484         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
1485         to take into account overrideContainingBlockContentWidth|Height for grid items.
1486         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
1487         that will be overridden in RenderBox.
1488         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
1489         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
1490         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
1491         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
1492
1493 2018-12-20  Justin Fan  <justin_fan@apple.com>
1494
1495         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
1496         https://bugs.webkit.org/show_bug.cgi?id=192956
1497
1498         Reviewed by Myles Maxfield.
1499
1500         No testable behavior change. Existing tests cover possible crashing.
1501
1502         Add GPUBindGroupLayoutMetal.mm:
1503         * SourcesCocoa.txt:
1504         * WebCore.xcodeproj/project.pbxproj:
1505
1506         Flesh out GPUBindGroupLayout::create:
1507         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
1508         * platform/graphics/gpu/GPUBindGroupLayout.h:
1509         * platform/graphics/gpu/GPUDevice.cpp:
1510         (WebCore::GPUDevice::createBindGroupLayout const):
1511         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
1512         (WebCore::appendArgumentToArrayInMap): Added.
1513         (WebCore::GPUBindGroupLayout::create):
1514         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1515         (WebCore::MTLDataTypeForBindingType): Added.
1516
1517 2018-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1518
1519         Unreviewed, remove stray #pragma once added to .cpp file
1520
1521         * svg/properties/SVGAttributeOwnerProxy.cpp:
1522
1523 2018-12-20  Justin Michaud  <justin_michaud@apple.com>
1524
1525         Adding runtime-enabled attribute to Element prevents inlining property access
1526         https://bugs.webkit.org/show_bug.cgi?id=192901
1527
1528         Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
1529
1530         Reviewed by Ryosuke Niwa.
1531
1532         * bindings/scripts/CodeGeneratorJS.pm:
1533         (GenerateImplementation):
1534         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1535         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
1536         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1537         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
1538         * bindings/scripts/test/JS/JSTestNode.cpp:
1539         (WebCore::JSTestNodePrototype::finishCreation):
1540         * bindings/scripts/test/JS/JSTestObj.cpp:
1541         (WebCore::JSTestObjPrototype::finishCreation):
1542
1543 2018-12-20  Chris Dumez  <cdumez@apple.com>
1544
1545         Use Optional::hasValue() instead of Optional::has_value()
1546         https://bugs.webkit.org/show_bug.cgi?id=192948
1547
1548         Reviewed by Tim Horton.
1549
1550         * bindings/js/DOMPromiseProxy.h:
1551         (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
1552         (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
1553         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
1554         * dom/DataTransferItemList.h:
1555         (WebCore::DataTransferItemList::hasItems const):
1556         * dom/EventTarget.cpp:
1557         (WebCore::EventTarget::addEventListener):
1558         * html/HTMLMediaElement.cpp:
1559         (WebCore::HTMLMediaElement::captionDisplayMode):
1560         * platform/graphics/MediaPlayer.cpp:
1561         (WebCore::MediaPlayer::wouldTaintOrigin const):
1562         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1563         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1564         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1565         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
1566         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1567         (webKitMediaSrcUpdatePresentationSize):
1568         * platform/mac/NSScrollerImpDetails.mm:
1569         (WebCore::ScrollerStyle::recommendedScrollerStyle):
1570         * rendering/RenderListItem.cpp:
1571         (WebCore::RenderListItem::setExplicitValue):
1572
1573 2018-12-20  Chris Dumez  <cdumez@apple.com>
1574
1575         Move HTTPS_UPGRADE code behind a runtime flag, off by default
1576         https://bugs.webkit.org/show_bug.cgi?id=192937
1577
1578         Reviewed by Youenn Fablet.
1579
1580         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
1581
1582         * page/Settings.yaml:
1583
1584 2018-12-20  Youenn Fablet  <youenn@apple.com>
1585
1586         Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
1587         https://bugs.webkit.org/show_bug.cgi?id=192838
1588
1589         Reviewed by Chris Dumez.
1590
1591         Generate constructor code in case of a Private but not Public constructor.
1592         Make sure this is correctly exposed in global objects.
1593         Add JS built-in constructor implementations for those two objects.
1594
1595         Also add JS built-in constructors for controller and byob request.
1596         To keep existing behavior, JS built-ins calling these constructors need to pass
1597         an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
1598         In the latter case, the constructor will throw.
1599
1600         Covered by existing tests, no observable change of behavior.
1601
1602         * Modules/streams/ReadableByteStreamController.idl:
1603         * Modules/streams/ReadableByteStreamController.js:
1604         (initializeReadableByteStreamController):
1605         (getter.byobRequest):
1606         * Modules/streams/ReadableByteStreamInternals.js:
1607         (privateInitializeReadableByteStreamController): Deleted.
1608         (privateInitializeReadableStreamBYOBRequest): Deleted.
1609         * Modules/streams/ReadableStream.js:
1610         (initializeReadableStream):
1611         * Modules/streams/ReadableStreamBYOBReader.js:
1612         (initializeReadableStreamBYOBReader):
1613         * Modules/streams/ReadableStreamBYOBRequest.idl:
1614         * Modules/streams/ReadableStreamBYOBRequest.js:
1615         (initializeReadableStreamBYOBRequest):
1616         * Modules/streams/ReadableStreamDefaultController.idl:
1617         * Modules/streams/ReadableStreamDefaultController.js:
1618         (initializeReadableStreamDefaultController):
1619         (enqueue):
1620         * Modules/streams/ReadableStreamDefaultReader.js:
1621         (initializeReadableStreamDefaultReader):
1622         * Modules/streams/ReadableStreamInternals.js:
1623         (readableStreamDefaultControllerError): Deleted.
1624         * Sources.txt:
1625         * UnifiedSources-input.xcfilelist:
1626         * WebCore.xcodeproj/project.pbxproj:
1627         * bindings/js/JSDOMBuiltinConstructor.h:
1628         * bindings/js/JSDOMGlobalObject.cpp:
1629         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1630         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
1631         * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
1632         * bindings/scripts/CodeGeneratorJS.pm:
1633         (GeneratePropertiesHashTable):
1634         * bindings/scripts/preprocess-idls.pl:
1635         (shouldExposeInterface):
1636
1637 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1638
1639         [WebAuthN] Remove hash from Client Data
1640         https://bugs.webkit.org/show_bug.cgi?id=192727
1641         <rdar://problem/46746673>
1642
1643         Reviewed by Brent Fulgham.
1644
1645         The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
1646         https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
1647
1648         Covered by existing tests.
1649
1650         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1651         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
1652
1653 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1654
1655         [WebAuthN] Add a runtime flag for local authenticator
1656         https://bugs.webkit.org/show_bug.cgi?id=192792
1657         <rdar://problem/46798738>
1658
1659         Reviewed by Brent Fulgham.
1660
1661         No tests.
1662
1663         This patch adds a runtime flag for local authenticator and removes ways to
1664         set the runtime flag for web authentication in LegacyWebKit.
1665
1666         * page/RuntimeEnabledFeatures.h:
1667         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
1668         (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
1669
1670 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
1671
1672         Pointer lock causes abandoned documents
1673         https://bugs.webkit.org/show_bug.cgi?id=188727
1674         rdar://problem/44248197
1675         
1676         Reviewed by Simon Fraser.
1677
1678         Fixes --world-leaks in these tests:
1679
1680         pointer-lock/locked-element-removed-from-dom.html
1681         pointer-lock/mouse-event-delivery.html
1682         fast/shadow-dom/pointerlockelement-in-slot.html
1683
1684         PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
1685
1686         * page/PointerLockController.cpp:
1687         (WebCore::PointerLockController::elementRemoved):
1688         (WebCore::PointerLockController::documentDetached):
1689         (WebCore::PointerLockController::didAcquirePointerLock):
1690         * page/PointerLockController.h:
1691
1692 2018-12-20  Chris Dumez  <cdumez@apple.com>
1693
1694         Use Optional::valueOr() instead of Optional::value_or()
1695         https://bugs.webkit.org/show_bug.cgi?id=192933
1696
1697         Reviewed by Geoffrey Garen.
1698
1699         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1700         (WebCore::convert):
1701         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
1702         * Modules/encryptedmedia/MediaKeySession.cpp:
1703         (WebCore::MediaKeySession::load):
1704         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1705         (WebCore::IDBDatabaseIdentifier::hash const):
1706         * Modules/indexeddb/IDBFactory.cpp:
1707         (WebCore::IDBFactory::open):
1708         * Modules/mediastream/MediaStreamTrack.cpp:
1709         (WebCore::MediaStreamTrack::applyConstraints):
1710         * Modules/mediastream/RTCDTMFSender.cpp:
1711         (WebCore::RTCDTMFSender::insertDTMF):
1712         * Modules/webdatabase/SQLTransaction.cpp:
1713         (WebCore::SQLTransaction::executeSql):
1714         * Modules/webvr/VRFrameData.cpp:
1715         (WebCore::VRFrameData::update):
1716         * animation/AnimationTimeline.cpp:
1717         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1718         * animation/DeclarativeAnimation.cpp:
1719         (WebCore::DeclarativeAnimation::cancel):
1720         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1721         * animation/KeyframeEffect.cpp:
1722         (WebCore::computeMissingKeyframeOffsets):
1723         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1724         * animation/WebAnimation.cpp:
1725         (WebCore::WebAnimation::runPendingPlayTask):
1726         (WebCore::WebAnimation::runPendingPauseTask):
1727         * bindings/js/SerializedScriptValue.cpp:
1728         (WebCore::CloneSerializer::write):
1729         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1730         (WebCore::CryptoAlgorithmHMAC::generateKey):
1731         (WebCore::CryptoAlgorithmHMAC::importKey):
1732         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
1733         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1734         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1735         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1736         (WebCore::CryptoKeyRSA::importSpki):
1737         (WebCore::CryptoKeyRSA::importPkcs8):
1738         * crypto/keys/CryptoKeyRSA.cpp:
1739         (WebCore::CryptoKeyRSA::importJwk):
1740         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1741         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1742         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1743         * crypto/mac/CryptoKeyRSAMac.cpp:
1744         (WebCore::CryptoKeyRSA::importSpki):
1745         (WebCore::CryptoKeyRSA::importPkcs8):
1746         * css/CSSComputedStyleDeclaration.cpp:
1747         (WebCore::counterToCSSValue):
1748         * css/CSSFontFace.cpp:
1749         (WebCore::calculateItalicRange):
1750         * css/CSSPrimitiveValue.cpp:
1751         (WebCore::CSSPrimitiveValue::doubleValue const):
1752         * css/CSSStyleSheet.cpp:
1753         (WebCore::CSSStyleSheet::addRule):
1754         * css/DOMMatrix.cpp:
1755         (WebCore::DOMMatrix::rotateSelf):
1756         * css/DOMMatrixReadOnly.cpp:
1757         (WebCore::DOMMatrixReadOnly::validateAndFixup):
1758         * css/StyleBuilderCustom.h:
1759         (WebCore::StyleBuilderCustom::applyValueCounter):
1760         * css/parser/MediaQueryParser.cpp:
1761         (WebCore::MediaQueryParser::commitMediaQuery):
1762         * dom/Document.h:
1763         (WebCore::Document::referrerPolicy const):
1764         * dom/Element.cpp:
1765         (WebCore::toScrollAlignment):
1766         * dom/EventTarget.cpp:
1767         (WebCore::EventTarget::addEventListener):
1768         * dom/MutationObserver.cpp:
1769         (WebCore::MutationObserver::observe):
1770         * editing/cocoa/FontAttributeChangesCocoa.mm:
1771         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
1772         * fileapi/File.cpp:
1773         (WebCore::File::File):
1774         * html/DOMTokenList.cpp:
1775         (WebCore::DOMTokenList::toggle):
1776         * html/HTMLOListElement.h:
1777         * html/ImageBitmap.cpp:
1778         (WebCore::croppedSourceRectangleWithFormatting):
1779         * html/canvas/CanvasPattern.cpp:
1780         (WebCore::CanvasPattern::setTransform):
1781         * html/canvas/CanvasRenderingContext2DBase.cpp:
1782         (WebCore::CanvasRenderingContext2DBase::setTransform):
1783         (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
1784         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
1785         * html/canvas/Path2D.cpp:
1786         (WebCore::Path2D::addPath):
1787         * inspector/InspectorCanvas.cpp:
1788         (WebCore::InspectorCanvas::buildAction):
1789         * inspector/InspectorFrontendHost.cpp:
1790         (WebCore::populateContextMenu):
1791         * layout/FormattingContext.cpp:
1792         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1793         * layout/FormattingContextGeometry.cpp:
1794         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1795         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1796         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1797         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1798         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1799         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1800         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
1801         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1802         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1803         * layout/FormattingContextQuirks.cpp:
1804         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1805         * layout/MarginTypes.h:
1806         (WebCore::Layout::VerticalMargin::usedValues const):
1807         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1808         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1809         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1810         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1811         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1812         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1813         * layout/displaytree/DisplayBox.h:
1814         (WebCore::Display::Box::width const):
1815         (WebCore::Display::Box::height const):
1816         (WebCore::Display::Box::contentBoxTop const):
1817         (WebCore::Display::Box::contentBoxLeft const):
1818         * layout/floats/FloatingContext.cpp:
1819         (WebCore::Layout::Iterator::set):
1820         * layout/inlineformatting/InlineFormattingContext.cpp:
1821         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
1822         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
1823         * loader/FrameLoader.cpp:
1824         (WebCore::FrameLoader::urlSelected):
1825         * loader/NavigationAction.cpp:
1826         * page/FrameView.cpp:
1827         (WebCore::FrameView::setLayoutViewportOverrideRect):
1828         (WebCore::FrameView::documentToAbsoluteScaleFactor const):
1829         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
1830         * page/Page.cpp:
1831         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
1832         * page/SecurityOriginData.cpp:
1833         (WebCore::SecurityOriginData::databaseIdentifier const):
1834         * page/SecurityOriginData.h:
1835         (WebCore::SecurityOriginDataHash::hash):
1836         * page/SecurityOriginHash.h:
1837         (WebCore::SecurityOriginHash::hash):
1838         * page/ViewportConfiguration.cpp:
1839         (WebCore::ViewportConfiguration::setViewLayoutSize):
1840         * page/WindowFeatures.cpp:
1841         (WebCore::parseDialogFeatures):
1842         * page/animation/AnimationBase.cpp:
1843         (WebCore::AnimationBase::updateStateMachine):
1844         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1845         (WebCore::AnimationBase::getTimeToNextEvent const):
1846         (WebCore::AnimationBase::freezeAtTime):
1847         (WebCore::AnimationBase::getElapsedTime const):
1848         * page/animation/CSSAnimationController.cpp:
1849         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
1850         * page/cocoa/ResourceUsageThreadCocoa.mm:
1851         (WebCore::ResourceUsageThread::platformThreadBody):
1852         * page/linux/ResourceUsageThreadLinux.cpp:
1853         (WebCore::ResourceUsageThread::platformThreadBody):
1854         * platform/graphics/ComplexTextController.cpp:
1855         (WebCore::ComplexTextController::offsetForPosition):
1856         * platform/graphics/FontCache.h:
1857         (WebCore::FontDescriptionKey::computeHash const):
1858         * platform/graphics/FontCascade.cpp:
1859         (WebCore::FontCascade::drawText const):
1860         (WebCore::FontCascade::drawEmphasisMarks const):
1861         (WebCore::FontCascade::displayListForTextRun const):
1862         (WebCore::FontCascade::adjustSelectionRectForText const):
1863         (WebCore::FontCascade::codePath const):
1864         * platform/graphics/FontSelectionAlgorithm.cpp:
1865         (WebCore::FontSelectionAlgorithm::styleDistance const):
1866         * platform/graphics/FontSelectionAlgorithm.h:
1867         (WebCore::operator<<):
1868         (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
1869         (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
1870         (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
1871         * platform/graphics/ShadowBlur.cpp:
1872         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1873         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1874         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1875         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1876         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1877         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1878         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
1879         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1880         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
1881         * platform/graphics/ca/GraphicsLayerCA.cpp:
1882         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1883         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1884         (WebCore::preparePlatformFont):
1885         * platform/graphics/filters/FETurbulence.cpp:
1886         (WebCore::FETurbulence::fillRegion const):
1887         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1888         (WebCore::initializeGStreamer):
1889         * platform/graphics/texmap/TextureMapperLayer.cpp:
1890         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
1891         (WebCore::TextureMapperLayer::replicaTransform):
1892         (WebCore::TextureMapperLayer::syncAnimations):
1893         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1894         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
1895         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
1896         * platform/graphics/transforms/TransformState.cpp:
1897         (WebCore::TransformState::mappedPoint const):
1898         (WebCore::TransformState::mapQuad const):
1899         (WebCore::TransformState::flattenWithTransform):
1900         * platform/network/CacheValidation.cpp:
1901         (WebCore::computeCurrentAge):
1902         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1903         * platform/network/NetworkStateNotifier.cpp:
1904         (WebCore::NetworkStateNotifier::onLine):
1905         * rendering/FloatingObjects.cpp:
1906         (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
1907         (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
1908         * rendering/GridBaselineAlignment.cpp:
1909         (WebCore::GridBaselineAlignment::ascentForChild const):
1910         * rendering/GridTrackSizingAlgorithm.cpp:
1911         (WebCore::GridTrack::setGrowthLimit):
1912         (WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
1913         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
1914         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
1915         (WebCore::sortByGridTrackGrowthPotential):
1916         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
1917         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1918         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
1919         * rendering/PaintInfo.h:
1920         (WebCore::PaintInfo::applyTransform):
1921         * rendering/RenderBox.cpp:
1922         (WebCore::RenderBox::computeLogicalHeight const):
1923         * rendering/RenderCounter.cpp:
1924         (WebCore::planCounter):
1925         * rendering/RenderDeprecatedFlexibleBox.cpp:
1926         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1927         * rendering/RenderFlexibleBox.cpp:
1928         (WebCore::RenderFlexibleBox::baselinePosition const):
1929         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
1930         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
1931         * rendering/RenderGrid.cpp:
1932         (WebCore::RenderGrid::gridGap const):
1933         (WebCore::RenderGrid::baselinePosition const):
1934         * rendering/RenderLayer.cpp:
1935         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1936         * rendering/RenderListBox.cpp:
1937         (WebCore::RenderListBox::paintItem):
1938         (WebCore::RenderListBox::listIndexIsVisible):
1939         * rendering/RenderMultiColumnSet.cpp:
1940         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
1941         * rendering/RenderTable.cpp:
1942         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
1943         * rendering/RenderTableCell.cpp:
1944         (WebCore::RenderTableCell::cellBaselinePosition const):
1945         * rendering/RenderTableSection.cpp:
1946         (WebCore::RenderTableSection::firstLineBaseline const):
1947         * rendering/RenderText.cpp:
1948         (WebCore::RenderText::computePreferredLogicalWidths):
1949         (WebCore::RenderText::previousOffset const):
1950         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
1951         (WebCore::RenderText::nextOffset const):
1952         (WebCore::RenderText::stringView const):
1953         * rendering/RenderView.cpp:
1954         (WebCore::RenderView::layout):
1955         * rendering/mathml/RenderMathMLBlock.cpp:
1956         (WebCore::RenderMathMLBlock::baselinePosition const):
1957         * rendering/mathml/RenderMathMLBlock.h:
1958         (WebCore::RenderMathMLBlock::ascentForChild):
1959         * rendering/style/GridPosition.cpp:
1960         (WebCore::GridPosition::max):
1961         * rendering/style/TextUnderlineOffset.h:
1962         (WebCore::TextUnderlineOffset::lengthOr const):
1963         * rendering/svg/RenderSVGContainer.cpp:
1964         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
1965         * rendering/svg/RenderSVGForeignObject.cpp:
1966         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
1967         * rendering/svg/RenderSVGImage.cpp:
1968         (WebCore::RenderSVGImage::nodeAtFloatPoint):
1969         * rendering/svg/RenderSVGResourceClipper.cpp:
1970         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
1971         * rendering/svg/RenderSVGResourceFilter.cpp:
1972         (WebCore::RenderSVGResourceFilter::postApplyResource):
1973         * rendering/svg/RenderSVGRoot.cpp:
1974         (WebCore::RenderSVGRoot::nodeAtPoint):
1975         * rendering/svg/RenderSVGShape.cpp:
1976         (WebCore::RenderSVGShape::nodeAtFloatPoint):
1977         * rendering/svg/RenderSVGText.cpp:
1978         (WebCore::RenderSVGText::nodeAtFloatPoint):
1979         * rendering/svg/SVGRenderingContext.cpp:
1980         (WebCore::SVGRenderingContext::clipToImageBuffer):
1981         * svg/SVGToOTFFontConversion.cpp:
1982         (WebCore::SVGToOTFFontConverter::processGlyphElement):
1983         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1984
1985 2018-12-20  Jer Noble  <jer.noble@apple.com>
1986
1987         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
1988         https://bugs.webkit.org/show_bug.cgi?id=192941
1989         <rdar://problem/46874096>
1990
1991         Reviewed by Brent Fulgham.
1992
1993         Don't delete the locked lock before unlocking the lock. 
1994
1995         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1996         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
1997
1998 2018-12-20  Keith Rollin  <krollin@apple.com>
1999
2000         Improve release-level page-load logging
2001         https://bugs.webkit.org/show_bug.cgi?id=192872
2002         <rdar://problem/46850309>
2003
2004         Reviewed by Chris Dumez.
2005
2006         There are a number of reported bugs that are difficult or impossible
2007         to track down with our current level of logging. Additionally, some
2008         software groups lower in the page-loading stack have requested logging
2009         sufficient for tracking a user-visible error message down to the
2010         requested resource that caused the message. Add more-comprehensive
2011         logging to address these issues/requests.
2012
2013         No new tests -- no changed functionality.
2014
2015         * loader/DocumentLoader.cpp:
2016         (WebCore::DocumentLoader::setMainDocumentError):
2017         (WebCore::DocumentLoader::mainReceivedError):
2018         (WebCore::DocumentLoader::stopLoading):
2019         (WebCore::DocumentLoader::notifyFinished):
2020         (WebCore::DocumentLoader::willSendRequest):
2021         (WebCore::DocumentLoader::continueAfterContentPolicy):
2022         (WebCore::DocumentLoader::startLoadingMainResource):
2023         (WebCore::DocumentLoader::loadMainResource):
2024         (WebCore::DocumentLoader::cancelMainResourceLoad):
2025         * loader/FrameLoader.cpp:
2026         (WebCore::FrameLoader::urlSelected):
2027         (WebCore::FrameLoader::loadURLIntoChildFrame):
2028         (WebCore::FrameLoader::loadArchive):
2029         (WebCore::FrameLoader::loadInSameDocument):
2030         (WebCore::FrameLoader::loadFrameRequest):
2031         (WebCore::FrameLoader::loadURL):
2032         (WebCore::FrameLoader::load):
2033         (WebCore::FrameLoader::loadWithNavigationAction):
2034         (WebCore::FrameLoader::loadWithDocumentLoader):
2035         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2036         (WebCore::FrameLoader::reload):
2037         (WebCore::FrameLoader::setState):
2038         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2039         (WebCore::FrameLoader::loadPostRequest):
2040         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2041         (WebCore::FrameLoader::loadDifferentDocumentItem):
2042         * loader/ProgressTracker.cpp:
2043         (WebCore::ProgressItem::ProgressItem):
2044         (WebCore::ProgressTracker::reset):
2045         (WebCore::ProgressTracker::progressStarted):
2046         (WebCore::ProgressTracker::progressCompleted):
2047         (WebCore::ProgressTracker::finalProgressComplete):
2048         (WebCore::ProgressTracker::incrementProgress):
2049         (WebCore::ProgressTracker::completeProgress):
2050         (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
2051         * loader/ProgressTracker.h:
2052         * loader/ResourceLoader.cpp:
2053         (WebCore::ResourceLoader::loadDataURL):
2054         (WebCore::ResourceLoader::willSendRequestInternal):
2055         (WebCore::ResourceLoader::didFinishLoading):
2056         (WebCore::ResourceLoader::didFail):
2057         (WebCore::ResourceLoader::willSendRequestAsync):
2058         (WebCore::ResourceLoader::wasBlocked):
2059         (WebCore::ResourceLoader::cannotShowURL):
2060         * loader/SubresourceLoader.cpp:
2061         (WebCore::SubresourceLoader::willSendRequestInternal):
2062         (WebCore::=):
2063         (WebCore::SubresourceLoader::didReceiveResponse):
2064         (WebCore::SubresourceLoader::didFinishLoading):
2065         (WebCore::SubresourceLoader::didFail):
2066         (WebCore::SubresourceLoader::willCancel):
2067         * loader/cache/CachedResource.cpp:
2068         (WebCore::CachedResource::load):
2069
2070 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
2071
2072         Switch tabs before retuning PiP video to inline.
2073         https://bugs.webkit.org/show_bug.cgi?id=192767
2074         rdar://problem/46006046
2075
2076         Reviewed by Jer Noble.
2077
2078         No new tests because this code path only happens with a user action on system UI.
2079
2080         When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
2081
2082         * platform/mac/VideoFullscreenInterfaceMac.mm:
2083         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
2084
2085 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2086
2087         Unreviewed, fix GTK build after r239410
2088
2089         It added a new file to the build, breaking the unified sources magic that obscured a bug in
2090         URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
2091         included via another source file in the unified source bundle.
2092
2093         * platform/network/soup/URLSoup.h:
2094
2095 2018-12-19  Chris Dumez  <cdumez@apple.com>
2096
2097         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
2098         https://bugs.webkit.org/show_bug.cgi?id=192728
2099         <rdar://problem/46746779>
2100
2101         Reviewed by Geoff Garen.
2102
2103         * Modules/*:
2104         * animation/*:
2105         * bindings/*:
2106         * crypto/*:
2107         * css/*:
2108         * dom/*:
2109         * editing/*:
2110         * fileapi/*:
2111         * html/*:
2112         * inspector/*:
2113         * layout/*:
2114         * loader/*:
2115         * mathml/*:
2116         * page/*:
2117         * platform/*:
2118         * plugins/*:
2119         * rendering/*:
2120         * testing/*:
2121         * workers/*:
2122         * xml/*:
2123
2124 2018-12-19  Jer Noble  <jer.noble@apple.com>
2125
2126         Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2127         https://bugs.webkit.org/show_bug.cgi?id=192896
2128         <rdar://46732186>
2129
2130         Reviewed by Eric Carlson.
2131
2132         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2133         (WebCore::AudioSourceProviderAVFObjC::initCallback):
2134
2135 2018-12-19  Timothy Hatcher  <timothy@apple.com>
2136
2137         REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
2138         https://bugs.webkit.org/show_bug.cgi?id=188891
2139         rdar://problem/42344352
2140
2141         Reviewed by Simon Fraser.
2142
2143         * rendering/RenderLayerCompositor.cpp:
2144         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
2145         Don't return early when m_layerForOverhangAreas is null to avoid skipping
2146         setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
2147
2148 2018-12-19  Justin Fan  <justin_fan@apple.com>
2149
2150         [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
2151         https://bugs.webkit.org/show_bug.cgi?id=192843
2152         <rdar://problem/46820395>
2153
2154         Reviewed by Myles Maxfield.
2155
2156         Test: webgpu/pipeline-layouts.html
2157
2158         Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
2159         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
2160         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2161         * Modules/webgpu/WebGPUBindGroupLayout.h:
2162         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
2163         * Modules/webgpu/WebGPUDevice.cpp:
2164         (WebCore::WebGPUDevice::createPipelineLayout const): Added.
2165         * Modules/webgpu/WebGPUDevice.h:
2166         * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
2167         * Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
2168         (WebCore::WebGPUPipelineLayout::create):
2169         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
2170         * Modules/webgpu/WebGPUPipelineLayout.h: Added.
2171         * Modules/webgpu/WebGPUPipelineLayout.idl: Added.
2172         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
2173         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
2174         * platform/graphics/gpu/GPUDevice.cpp:
2175         (WebCore::GPUDevice::createPipelineLayout const): Added.
2176         * platform/graphics/gpu/GPUDevice.h:
2177         * platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
2178         (WebCore::GPUPipelineLayout::create):
2179         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
2180         * platform/graphics/gpu/GPUPipelineLayout.h: Added.
2181         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
2182
2183         Add files and symbols to project:
2184         * CMakeLists.txt:
2185         * DerivedSources.make:
2186         * Sources.txt:
2187         * WebCore.xcodeproj/project.pbxproj:
2188         * bindings/js/WebCoreBuiltinNames.h:
2189
2190         Add missing include:
2191         * Modules/webgpu/WebGPUQueue.h:
2192
2193 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
2194
2195         SVGUseElement::findTarget should return nullptr when there is a cycle
2196         https://bugs.webkit.org/show_bug.cgi?id=192840
2197
2198         Reviewed by Tim Horton.
2199
2200         r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
2201         Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
2202         the SVG use element itself had a corresponding element.
2203
2204         No new tests since there should be no behavioral change.
2205
2206         * svg/SVGUseElement.cpp:
2207         (WebCore::SVGUseElement::updateShadowTree):
2208         (WebCore::SVGUseElement::findTarget const):
2209
2210 2018-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
2211
2212         [WHLSL] Add a handwritten lexer
2213         https://bugs.webkit.org/show_bug.cgi?id=192294
2214
2215         Reviewed by Jon Lee.
2216
2217         This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
2218         implementation matches the lexing rules in the spec (specifically, the rules that start
2219         with an uppercase letter). The spec is at
2220         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
2221
2222         This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
2223
2224         No new tests because the lexer isn't hooked up yet; there are tests in the parser,
2225         once that gets committed.
2226
2227         * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
2228         (WebCore::WHLSL::Lexer::Token::typeName):
2229         (WebCore::WHLSL::Lexer::recognizeKeyword):
2230         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
2231         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
2232         (WebCore::WHLSL::isWhitespace):
2233         (WebCore::WHLSL::isNewline):
2234         (WebCore::WHLSL::Lexer::skipWhitespace):
2235         (WebCore::WHLSL::Lexer::skipLineComment):
2236         (WebCore::WHLSL::Lexer::skipLongComment):
2237         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
2238         (WebCore::WHLSL::Lexer::decimalIntLiteral const):
2239         (WebCore::WHLSL::Lexer::decimalUintLiteral const):
2240         (WebCore::WHLSL::isHexadecimalCharacter):
2241         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
2242         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
2243         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
2244         (WebCore::WHLSL::Lexer::intLiteral const):
2245         (WebCore::WHLSL::Lexer::uintLiteral const):
2246         (WebCore::WHLSL::Lexer::digit const):
2247         (WebCore::WHLSL::Lexer::digitStar const):
2248         (WebCore::WHLSL::Lexer::character const):
2249         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
2250         (WebCore::WHLSL::Lexer::coreFloatLiteral const):
2251         (WebCore::WHLSL::Lexer::floatLiteral const):
2252         (WebCore::WHLSL::Lexer::validIdentifier const):
2253         (WebCore::WHLSL::Lexer::identifier const):
2254         (WebCore::WHLSL::Lexer::operatorName const):
2255         * Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
2256         (WebCore::WHLSL::Lexer::Lexer):
2257         (WebCore::WHLSL::Lexer::consumeToken):
2258         (WebCore::WHLSL::Lexer::unconsumeToken):
2259         (WebCore::WHLSL::Lexer::state const):
2260         (WebCore::WHLSL::Lexer::setState):
2261         (WebCore::WHLSL::Lexer::isFullyConsumed const):
2262         (WebCore::WHLSL::Lexer::errorString):
2263         (WebCore::WHLSL::Lexer::string const):
2264         (WebCore::WHLSL::Lexer::anyCharacter const):
2265         * Sources.txt:
2266         * WebCore.xcodeproj/project.pbxproj:
2267
2268 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
2269
2270         Web Inspector: Timelines: correctly label Intersection Observer callbacks
2271         https://bugs.webkit.org/show_bug.cgi?id=192669
2272         <rdar://problem/46702490>
2273
2274         Reviewed by Joseph Pecoraro.
2275
2276         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
2277         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
2278         that they get correctly labeled in the Inspector timeline.
2279
2280         * dom/MutationObserver.cpp:
2281         (WebCore::MutationObserver::deliver):
2282         * en.lproj/Localizable.strings:
2283         * inspector/InspectorInstrumentation.cpp:
2284         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
2285         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
2286         * inspector/InspectorInstrumentation.h:
2287         (WebCore::InspectorInstrumentation::willFireObserverCallback):
2288         (WebCore::InspectorInstrumentation::didFireObserverCallback):
2289         * inspector/TimelineRecordFactory.cpp:
2290         (WebCore::TimelineRecordFactory::createObserverCallbackData):
2291         * inspector/TimelineRecordFactory.h:
2292         * inspector/agents/InspectorTimelineAgent.cpp:
2293         (WebCore::InspectorTimelineAgent::willFireObserverCallback):
2294         (WebCore::InspectorTimelineAgent::didFireObserverCallback):
2295         (WebCore::toProtocol):
2296         * inspector/agents/InspectorTimelineAgent.h:
2297         * page/IntersectionObserver.cpp:
2298         (WebCore::IntersectionObserver::notify):
2299         * page/PerformanceObserver.cpp:
2300         (WebCore::PerformanceObserver::deliver):
2301
2302 2018-12-19  Claudio Saavedra  <csaavedra@igalia.com>
2303
2304         ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
2305         https://bugs.webkit.org/show_bug.cgi?id=192854
2306
2307         Reviewed by Alex Christensen.
2308
2309         * contentextensions/DFANode.h: Define CharRange's chars as signed
2310
2311 2018-12-19  Youenn Fablet  <youenn@apple.com>
2312
2313         Remove RTCRtpTransceiver.setDirection
2314         https://bugs.webkit.org/show_bug.cgi?id=192869
2315
2316         Reviewed by Alex Christensen.
2317
2318         Covered by rebased test.
2319
2320         * Modules/mediastream/RTCRtpTransceiver.idl:
2321
2322 2018-12-19  Jer Noble  <jer.noble@apple.com>
2323
2324         Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
2325         https://bugs.webkit.org/show_bug.cgi?id=192856
2326         <rdar://problem/46843245>
2327
2328         Reviewed by Alex Christensen.
2329
2330         Some decoders exposed through VideoToolbox will decode asynchronously even when 
2331         kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
2332
2333         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2334         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
2335
2336 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
2337
2338         Allow clients to set the navigator platform
2339         https://bugs.webkit.org/show_bug.cgi?id=192735
2340
2341         Reviewed by Tim Horton.
2342
2343         Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
2344
2345         Lots of piping to allow the setting of a custom navigator platform.
2346
2347         * loader/DocumentLoader.h:
2348         (WebCore::DocumentLoader::setCustomNavigatorPlatform):
2349         (WebCore::DocumentLoader::customNavigatorPlatform const):
2350         * loader/FrameLoader.cpp:
2351         (WebCore::FrameLoader::navigatorPlatform const):
2352         * loader/FrameLoader.h:
2353         * page/Navigator.cpp:
2354         (WebCore::Navigator::platform const):
2355         * page/Navigator.h:
2356         * page/NavigatorBase.cpp:
2357         (WebCore::NavigatorBase::platform const):
2358         (WebCore::NavigatorBase::platform): Deleted.
2359         * page/NavigatorBase.h:
2360
2361 2018-12-19  Ryan Haddad  <ryanhaddad@apple.com>
2362
2363         Unreviewed, rolling out r239347.
2364
2365         Caused the leaks bot to hit an exception and the new test
2366         crashes on certain configurations.
2367
2368         Reverted changeset:
2369
2370         "Synchronous media query evaluation could destroy current
2371         Frame/FrameView."
2372         https://bugs.webkit.org/show_bug.cgi?id=192781
2373         https://trac.webkit.org/changeset/239347
2374
2375 2018-12-19  Truitt Savell  <tsavell@apple.com>
2376
2377         Unreviewed, rolling out r239358.
2378
2379         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
2380         crash on Debug bots
2381
2382         Reverted changeset:
2383
2384         "Clean up IndexedDB files between tests"
2385         https://bugs.webkit.org/show_bug.cgi?id=192796
2386         https://trac.webkit.org/changeset/239358
2387
2388 2018-12-19  Don Olmstead  <don.olmstead@sony.com>
2389
2390         Sync some include directories in WebCore
2391         https://bugs.webkit.org/show_bug.cgi?id=192819
2392
2393         Reviewed by Michael Catanzaro.
2394
2395         Added missing include directories around features that have only been enabled on
2396         Apple ports. Removes obsolete directories from list and moves harfbuzz directories
2397         into the freetype cmake file.
2398
2399         * CMakeLists.txt:
2400         * platform/FreeType.cmake:
2401
2402 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2403
2404         [MSE] Remove unused method: stopAskingForMoreSamples()
2405         https://bugs.webkit.org/show_bug.cgi?id=192754
2406
2407         Reviewed by Xabier Rodriguez-Calvar.
2408
2409         The stopAskingForMoreSamples() method from SourceBufferPrivate is not
2410         being used by anyone. SourceBuffer is not calling it and no
2411         SourceBufferPrivate is implementing it. Let's remove that noise.
2412
2413         * platform/graphics/SourceBufferPrivate.h:
2414         (WebCore::SourceBufferPrivate::setActive):
2415         (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
2416         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2417         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
2418         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2419
2420 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2421
2422         [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
2423         https://bugs.webkit.org/show_bug.cgi?id=192827
2424
2425         Reviewed by Xabier Rodriguez-Calvar.
2426
2427         This patch makes two dead code removal changes in
2428         SourceBufferPrivateClient:
2429
2430         First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
2431         virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
2432         is only inherited by SourceBuffer, it makes no sense to have default
2433         implementations there (they will never be used), moreso it being a
2434         client interface.
2435
2436         Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
2437         to had an empty implementation, which SourceBuffer did not overwrite,
2438         therefore making any calls to it useless.
2439
2440         All calls to sourceBufferPrivateSeekToTime() have been removed:
2441
2442         SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
2443         itself, used to call this method. This patch deletes it completely.
2444
2445         MockSourceBufferPrivate::seekToTime(), which only called this empty
2446         method, has also been removed along with its only usage in
2447         MockMediaSourcePrivate::seekToTime().
2448
2449         * platform/graphics/SourceBufferPrivateClient.h:
2450         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
2451         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
2452         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2453         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2454         (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
2455         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
2456         (WebCore::MockMediaSourcePrivate::seekToTime):
2457         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2458         (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
2459         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2460
2461 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2462
2463         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
2464         https://bugs.webkit.org/show_bug.cgi?id=192815
2465
2466         Reviewed by Jer Noble.
2467
2468         https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
2469         says that distinctiveIdentifier and persistentState default to
2470         optional. Our implementation does not define a default leaving it
2471         to the first option of the enum, which currently is Required.
2472
2473         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
2474
2475 2018-12-19  Rob Buis  <rbuis@igalia.com>
2476
2477         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
2478         https://bugs.webkit.org/show_bug.cgi?id=192288
2479
2480         Reviewed by Frédéric Wang.
2481
2482         Prefer return value to out parameter for parseAccessControlAllowList.
2483
2484         * loader/CrossOriginPreflightResultCache.cpp:
2485         (WebCore::CrossOriginPreflightResultCacheItem::parse):
2486         * platform/network/HTTPParsers.h:
2487         (WebCore::parseAccessControlAllowList):
2488         * platform/network/ResourceResponseBase.cpp:
2489         (WebCore::ResourceResponseBase::filter):
2490         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2491
2492 2018-12-18  Zan Dobersek  <zdobersek@igalia.com>
2493
2494         REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
2495         https://bugs.webkit.org/show_bug.cgi?id=192230
2496
2497         Reviewed by Carlos Garcia Campos.
2498
2499         Single tile can after r235165 be assigned multiple content updates
2500         without a commit occurring between each update, whereas before these
2501         commits were done for each update.
2502
2503         To avoid repeating updates for a single tile purging information about
2504         the previous update, these updates are now accumulated inside a Vector
2505         and then iterated over during the commit phase.
2506
2507         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
2508         (WebCore::CoordinatedBackingStoreTile::addUpdate):
2509         (WebCore::CoordinatedBackingStoreTile::swapBuffers):
2510         (WebCore::CoordinatedBackingStore::updateTile):
2511         (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
2512         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
2513         (WebCore::CoordinatedBackingStoreTile::scale const):
2514
2515 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2516
2517         [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
2518         https://bugs.webkit.org/show_bug.cgi?id=192842
2519         <rdar://problem/46823586>
2520
2521         Reviewed by Tim Horton.
2522
2523         Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
2524         registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
2525         inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
2526         this is internally tracked in <rdar://problem/46830277>.
2527
2528         * platform/ios/PlatformPasteboardIOS.mm:
2529         (WebCore::PlatformPasteboard::write):
2530
2531 2018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2532
2533         Unreviewed, add a missing UNUSED_PARAM()
2534
2535         * Modules/mediarecorder/MediaRecorder.cpp:
2536         (WebCore::MediaRecorder::getPrivateImpl):
2537
2538 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2539
2540         Update CSS Properties and Values API to use new cycle fallback behaviour
2541         https://bugs.webkit.org/show_bug.cgi?id=192800
2542
2543         Reviewed by Antti Koivisto.
2544
2545         Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
2546         wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. 
2547
2548         * css/CSSCustomPropertyValue.h:
2549         * css/CSSVariableReferenceValue.cpp:
2550         (WebCore::resolveVariableReference):
2551         * css/DOMCSSRegisterCustomProperty.cpp:
2552         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2553         * css/StyleResolver.cpp:
2554         (WebCore::StyleResolver::applyCascadedCustomProperty):
2555         * css/parser/CSSPropertyParser.cpp:
2556         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
2557
2558 2018-12-18  Daniel Bates  <dabates@apple.com>
2559
2560         Wrong value for key property in keydown and keyup events generated holding Control key
2561         https://bugs.webkit.org/show_bug.cgi?id=192788
2562         <rdar://problem/46795214>
2563
2564         Reviewed by Wenson Hsieh.
2565
2566         Similar to what we do on Mac, compute the DOM key property from the characters ignoring
2567         modifier keys input string when the Control key is held down.
2568
2569         * platform/ios/PlatformEventFactoryIOS.mm:
2570         (WebCore::keyForKeyEvent):
2571         * platform/mac/PlatformEventFactoryMac.mm:
2572         (WebCore::keyForKeyEvent):
2573
2574 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
2575
2576         Clean up IndexedDB files between tests
2577         https://bugs.webkit.org/show_bug.cgi?id=192796
2578
2579         Reviewed by Geoffrey Garen.
2580
2581         We should clean up the IndexedDB files between tests to make sure each test is independent of others.
2582
2583         This patch also fixes some issues in IDB.
2584
2585         Covered by existing tests.
2586
2587         * Modules/indexeddb/server/IDBServer.cpp:
2588         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2589         We should shut down all open databases instead of databases from open database connections before deleting 
2590         files, because database starts accessing files before connection to database is established.
2591
2592         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2593         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
2594         We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase 
2595         and UniqueIDBDatabase can be destructed after shutdown.
2596
2597         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2598         didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be 
2599         invoked during the hard close.
2600
2601         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2602         Tasks like didOpenBackingStore could be posted from database thread to main thread after 
2603         immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any 
2604         database operation. 
2605
2606         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2607         performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access 
2608         m_backingStore when m_backingStore may already be deleted. 
2609
2610         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2611         immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. 
2612         m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in 
2613         transactionCompleted, so they do not need to be cleared here.
2614
2615 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
2616
2617         Thick overlines and line-throughs grow in the wrong direction
2618         https://bugs.webkit.org/show_bug.cgi?id=192264
2619
2620         Reviewed by Dean Jackson.
2621
2622         Overlines should grow upward, and line-throughs should stay centered.
2623
2624         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
2625
2626         * rendering/TextDecorationPainter.cpp:
2627         (WebCore::TextDecorationPainter::paintTextDecoration):
2628         * style/InlineTextBoxStyle.cpp:
2629         (WebCore::visualOverflowForDecorations):
2630
2631 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
2632
2633         Some iOS app crash in FrameLoader::checkCompleted
2634         https://bugs.webkit.org/show_bug.cgi?id=192804
2635         <rdar://problem/44240573>
2636
2637         Reviewed by Tim Horton.
2638
2639         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
2640         is trying to send a delegate message. Disable the release assertion while this is happening
2641         so that iOS app would not crash.
2642
2643         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
2644         and this requires a race between the web thread & the main thread.
2645
2646         * dom/ScriptDisallowedScope.h:
2647         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
2648         * platform/ios/wak/WebCoreThread.h:
2649         * platform/ios/wak/WebCoreThread.mm:
2650         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
2651         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
2652         (SendDelegateMessage):
2653
2654 2018-12-18  David Kilzer  <ddkilzer@apple.com>
2655
2656         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
2657         <https://webkit.org/b/192814>
2658
2659         Reviewed by Mark Lam.
2660
2661         * bindings/js/JSDOMConvertNumbers.h:
2662         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
2663
2664 2018-12-18  Justin Fan  <justin_fan@apple.com>
2665
2666         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
2667         https://bugs.webkit.org/show_bug.cgi?id=192817
2668
2669         Reviewed by Dean Jackson.
2670
2671         Update bind-group-layouts to test new functionality.
2672
2673         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
2674         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
2675         (WebCore::WebGPUBindGroupLayout::create):
2676         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2677         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
2678         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
2679         * Modules/webgpu/WebGPUDevice.cpp:
2680         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
2681         * Modules/webgpu/WebGPUDevice.h:
2682         * Modules/webgpu/WebGPUDevice.idl:
2683         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
2684         (WebCore::GPUBindGroupLayout::tryCreate):
2685         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2686         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
2687         * platform/graphics/gpu/GPUDevice.cpp:
2688         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
2689         * platform/graphics/gpu/GPUDevice.h:
2690
2691         Add files and symbols to project:
2692         * CMakeLists.txt:
2693         * DerivedSources.make:
2694         * Sources.txt:
2695         * WebCore.xcodeproj/project.pbxproj:
2696         * bindings/js/WebCoreBuiltinNames.h:
2697
2698         Missing includes that were previously provided via UnifiedSources:
2699         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
2700         * platform/sql/SQLiteFileSystem.h:
2701
2702 2018-12-18  Youenn Fablet  <youenn@apple.com>
2703
2704         Make ReadableStreamXX constructs use PrivateIdentifier
2705         https://bugs.webkit.org/show_bug.cgi?id=192771
2706
2707         Reviewed by Chris Dumez.
2708
2709         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
2710         Covered by existing binding tests.
2711
2712         * Modules/streams/ReadableByteStreamController.idl:
2713         * Modules/streams/ReadableStreamBYOBReader.idl:
2714         * Modules/streams/ReadableStreamBYOBRequest.idl:
2715         * Modules/streams/ReadableStreamDefaultController.idl:
2716         * Modules/streams/ReadableStreamDefaultReader.idl:
2717         * bindings/scripts/CodeGeneratorJS.pm:
2718         (NeedsConstructorProperty):
2719         * bindings/scripts/preprocess-idls.pl:
2720         (shouldExposeInterface):
2721         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
2722         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
2723         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
2724
2725 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2726
2727         Synchronous media query evaluation could destroy current Frame/FrameView.
2728         https://bugs.webkit.org/show_bug.cgi?id=192781
2729         <rdar://problem/34416793>
2730
2731         Reviewed by Chris Dumez.
2732
2733         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
2734
2735         Test: printing/print-with-media-query-destory.html
2736
2737         * loader/DocumentLoader.cpp:
2738         (WebCore::DocumentLoader::finishedLoading):
2739         * page/Frame.cpp:
2740         (WebCore::Frame::setPrinting):
2741         * page/FrameView.cpp:
2742         (WebCore::FrameView::forceLayoutForPagination):
2743
2744 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
2745
2746         Web Inspector: m3u8 content not shown, it should be text
2747         https://bugs.webkit.org/show_bug.cgi?id=192731
2748         <rdar://problem/46747728>
2749
2750         Reviewed by Devin Rousso.
2751
2752         * inspector/NetworkResourcesData.cpp:
2753         (WebCore::NetworkResourcesData::setResourceContent):
2754         Don't clobber data if setting empty content on a resource that has content.
2755
2756         * inspector/agents/InspectorNetworkAgent.cpp:
2757         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
2758         Additional non-"text/" mime types that can be treated as text.
2759
2760         * platform/MIMETypeRegistry.cpp:
2761         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
2762         * platform/MIMETypeRegistry.h:
2763         Detect media playlist mime types that are text (m3u8/m3u).
2764
2765 2018-12-18  Daniel Bates  <dabates@apple.com>
2766
2767         Remove <meta http-equiv=set-cookie> support
2768         https://bugs.webkit.org/show_bug.cgi?id=185077
2769         <rdar://problem/41791397>
2770
2771         Reviewed by Brent Fulgham.
2772
2773         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
2774         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
2775         removed support for this pragma and Firefox has an open bug to remove it.
2776
2777         * dom/Document.cpp:
2778         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
2779         was ignored instead of setting the cookie.
2780         * html/parser/XSSAuditor.cpp:
2781         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
2782         as dangerous and erase attribute http-equiv when we find it because we no longer honor
2783         this pragma.
2784
2785 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2786
2787         CSS Typed OM should expose attributeStyleMap
2788         https://bugs.webkit.org/show_bug.cgi?id=192671
2789
2790         Reviewed by Ryosuke Niwa.
2791
2792         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
2793         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
2794
2795         Test: css-typedom/attributeStyleMap.html
2796
2797         * CMakeLists.txt:
2798         * DerivedSources.make:
2799         * Sources.txt:
2800         * WebCore.xcodeproj/project.pbxproj:
2801         * bindings/js/WebCoreBuiltinNames.h:
2802         * css/ElementCSSInlineStyle.idl:
2803         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
2804         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
2805         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
2806         (WebCore::StylePropertyMapReadOnly::reifyValue):
2807         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
2808         * css/typedom/StylePropertyMapReadOnly.h:
2809         (WebCore::StylePropertyMapReadOnly::create): Deleted.
2810         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
2811         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
2812         * css/typedom/StylePropertyMapReadOnly.idl:
2813         * css/typedom/TypedOMCSSImageValue.h:
2814         * dom/Element.cpp:
2815         (WebCore::Element::attributeStyleMap):
2816         (WebCore::Element::setAttributeStyleMap):
2817         * dom/Element.h:
2818         * dom/ElementRareData.cpp:
2819         * dom/ElementRareData.h:
2820         (WebCore::ElementRareData::attributeStyleMap):
2821         (WebCore::ElementRareData::setAttributeStyleMap):
2822         * dom/StyledElement.cpp:
2823         (WebCore::StyledElement::ensureAttributeStyleMap):
2824         * dom/StyledElement.h:
2825         * html/canvas/CanvasRenderingContext2DBase.cpp:
2826         (WebCore::size):
2827         (WebCore::CanvasRenderingContext2DBase::drawImage):
2828         * platform/graphics/CustomPaintImage.cpp:
2829         (WebCore::extractComputedProperty):
2830         (WebCore::CustomPaintImage::doCustomPaint):
2831
2832 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2833
2834         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
2835         https://bugs.webkit.org/show_bug.cgi?id=192785
2836         <rdar://problem/45321184>
2837
2838         Reviewed by Tim Horton.
2839
2840         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
2841         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
2842         need to know when the user is typing in a text form control, but the page is preventing default text insertion
2843         behavior and instead updating values programmatically.
2844
2845         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
2846
2847         * html/TextFieldInputType.cpp:
2848         (WebCore::TextFieldInputType::setValue):
2849
2850 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2851
2852         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
2853         https://bugs.webkit.org/show_bug.cgi?id=192801
2854
2855         Reviewed by Antti Koivisto.
2856
2857         * layout/blockformatting/BlockFormattingContext.h:
2858         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2859         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2860         * layout/blockformatting/BlockMarginCollapse.cpp:
2861         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
2862
2863 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2864
2865         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
2866         https://bugs.webkit.org/show_bug.cgi?id=192799
2867
2868         Reviewed by Antti Koivisto.
2869
2870         * layout/blockformatting/BlockFormattingContext.h:
2871         * layout/blockformatting/BlockMarginCollapse.cpp:
2872         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2873         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2874
2875 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2876
2877         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
2878         https://bugs.webkit.org/show_bug.cgi?id=192798
2879
2880         Reviewed by Antti Koivisto.
2881
2882         * layout/blockformatting/BlockFormattingContext.h:
2883         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2884         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2885         * layout/blockformatting/BlockMarginCollapse.cpp:
2886         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
2887         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2888         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2889         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2890
2891 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2892
2893         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
2894         https://bugs.webkit.org/show_bug.cgi?id=192794
2895
2896         Reviewed by Antti Koivisto.
2897
2898         * layout/blockformatting/BlockFormattingContext.h:
2899         * layout/blockformatting/BlockMarginCollapse.cpp:
2900         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
2901         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
2902         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2903
2904 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2905
2906         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
2907         https://bugs.webkit.org/show_bug.cgi?id=192791
2908
2909         Reviewed by Antti Koivisto.
2910
2911         * layout/blockformatting/BlockMarginCollapse.cpp:
2912         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
2913         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
2914
2915 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2916
2917         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
2918         https://bugs.webkit.org/show_bug.cgi?id=192787
2919
2920         Reviewed by Antti Koivisto.
2921
2922         * layout/blockformatting/BlockFormattingContext.h:
2923         * layout/blockformatting/BlockMarginCollapse.cpp:
2924         (WebCore::Layout::hasClearance):
2925         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
2926         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2927         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2928         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2929
2930 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
2931
2932         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
2933         https://bugs.webkit.org/show_bug.cgi?id=192752
2934
2935         Reviewed by Don Olmstead.
2936
2937         No new tests, no behavior changes.
2938
2939         * platform/graphics/win/DIBPixelData.cpp:
2940         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
2941         * platform/graphics/win/FontPlatformDataWin.cpp:
2942         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
2943         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
2944         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2945         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
2946         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
2947         Reorder the initializer list.
2948         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
2949         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
2950         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
2951         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
2952         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
2953         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
2954         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
2955         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
2956         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
2957         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
2958         (WebCore::Font::boundsForGDIGlyph const): Ditto.
2959         (WebCore::Font::widthForGDIGlyph const): Ditto.
2960         * platform/graphics/win/UniscribeController.cpp:
2961         (WebCore::UniscribeController::UniscribeController):
2962         Reorder the initializer list.
2963         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
2964         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
2965
2966 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
2967
2968         [MediaStream] A stream's first video frame should be rendered
2969         https://bugs.webkit.org/show_bug.cgi?id=192629
2970         <rdar://problem/46664353>
2971
2972         Reviewed by Youenn Fablet.
2973
2974         Test: fast/mediastream/media-stream-renders-first-frame.html
2975
2976         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2977         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2978         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2979         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2980         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
2981         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
2982         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
2983         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
2984         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
2985         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
2986         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
2987         * platform/mediastream/RealtimeMediaSource.cpp:
2988         (WebCore::RealtimeMediaSource::size const):
2989         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2990         (WebCore::AVVideoCaptureSource::processNewFrame):
2991         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2992         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
2993
2994 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
2995
2996         Bindings generator should support Conditional= along with CachedAttribute
2997         https://bugs.webkit.org/show_bug.cgi?id=192721
2998
2999         Reviewed by Ryosuke Niwa.
3000
3001         Fix a bug where specifying both attributes causes compilation errors because the compile-time
3002         condition is not included in the derived code.
3003
3004         * bindings/scripts/CodeGeneratorJS.pm:
3005         (GenerateImplementation):
3006         * bindings/scripts/test/JS/JSTestObj.cpp:
3007         (WebCore::jsTestObjCachedAttribute3Getter):
3008         (WebCore::jsTestObjCachedAttribute3):
3009         (WebCore::JSTestObj::visitChildren):
3010         * bindings/scripts/test/JS/JSTestObj.h:
3011         * bindings/scripts/test/TestObj.idl:
3012
3013 2018-12-17  David Kilzer  <ddkilzer@apple.com>
3014
3015         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
3016         <https://webkit.org/b/192707>
3017         <rdar://problem/46734926>
3018
3019         Reviewed by Daniel Bates.
3020
3021         * platform/CPUMonitor.cpp:
3022         (WebCore::CPUMonitor::setCPULimit):
3023         * platform/CPUMonitor.h:
3024         (WebCore::CPUMonitor::setCPULimit):
3025         - Change parameter to const reference to fix unnecessary copies.
3026
3027 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
3028
3029         offsetLeft and offsetParent should adjust across shadow boundaries
3030         https://bugs.webkit.org/show_bug.cgi?id=157437
3031         <rdar://problem/26154021>
3032
3033         Reviewed by Simon Fraser.
3034
3035         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
3036         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
3037         and https://github.com/w3c/webcomponents/issues/763
3038
3039         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
3040         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
3041         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
3042
3043         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
3044         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
3045         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
3046
3047         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
3048         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
3049         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
3050
3051         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
3052
3053         * dom/Element.cpp:
3054         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
3055         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
3056         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
3057         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
3058         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
3059         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
3060         until it finds the first offset parent which is a shadow-including ancestor.
3061         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
3062         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
3063         functions meant to be used for bindings code.
3064         * dom/Element.h:
3065         * html/HTMLElement.idl:
3066
3067 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
3068
3069         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
3070         https://bugs.webkit.org/show_bug.cgi?id=192780
3071         rdar://problem/43394387
3072
3073         Reviewed by Tim Horton.
3074         
3075         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
3076         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
3077         
3078         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
3079         and consult it when making decisions that affect layer backing store format.
3080
3081         Tested by new results for existing tests.
3082
3083         * platform/graphics/FontCascade.cpp:
3084         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
3085         * platform/graphics/FontCascade.h:
3086         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3087         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
3088         it once.
3089         * rendering/RenderLayerBacking.cpp:
3090         (WebCore::RenderLayerBacking::updateAfterDescendants):
3091         * testing/Internals.cpp:
3092         (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
3093
3094 2018-12-17  Daniel Bates  <dabates@apple.com>
3095
3096         Make DocumentMarker::allMarkers() constexpr
3097         https://bugs.webkit.org/show_bug.cgi?id=192634
3098
3099         Reviewed by Simon Fraser.
3100
3101         The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
3102         it constexpr to do just that.
3103
3104         * dom/DocumentMarker.h:
3105         (WebCore::DocumentMarker::allMarkers):
3106
3107 2018-12-17  Justin Fan  <justin_fan@apple.com>
3108
3109         [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
3110         https://bugs.webkit.org/show_bug.cgi?id=192726
3111
3112         Reviewed by Myles C. Maxfield.
3113
3114         Test: webgpu/bind-group-layouts.html
3115         Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
3116         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
3117         * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
3118         * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
3119         * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
3120         * Modules/webgpu/WebGPUShaderStageBit.h: Added.
3121         * Modules/webgpu/WebGPUShaderStageBit.idl: Added.
3122         * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
3123         * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
3124
3125         Add the new symbols and files to the project:
3126         * CMakeLists.txt:
3127         * DerivedSources.make:
3128         * Sources.txt:
3129         * WebCore.xcodeproj/project.pbxproj:
3130         * bindings/js/WebCoreBuiltinNames.h:
3131
3132         Small FIXME update for later:
3133         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3134         (WebCore::GPURenderPassEncoder::setVertexBuffers):
3135
3136 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3137
3138         Unreviewed build fix.
3139
3140         * page/ios/FrameIOS.mm:
3141         (WebCore::Frame::interpretationsForCurrentRoot const):
3142
3143 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3144
3145         Reproducible ASSERTion failure when toggling layer borders with find-in-page up
3146         https://bugs.webkit.org/show_bug.cgi?id=192762
3147         <rdar://problem/46676873>
3148
3149         Reviewed by Simon Fraser.
3150
3151         DocumentMarkerController::markersFor() should take a reference instead of a Node*.
3152
3153         Test: editing/document-marker-null-check.html
3154
3155         * dom/DocumentMarkerController.cpp:
3156         (DocumentMarkerController::hasMarkers):
3157         * dom/DocumentMarkerController.h:
3158         * editing/AlternativeTextController.cpp:
3159         (WebCore::AlternativeTextController::respondToChangedSelection):
3160         * editing/Editor.cpp:
3161         (WebCore::Editor::selectionStartHasMarkerFor const):
3162         * rendering/InlineTextBox.cpp:
3163         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
3164         * rendering/RenderReplaced.cpp:
3165         (WebCore::RenderReplaced::paint):
3166         * rendering/RenderText.cpp:
3167         (WebCore::RenderText::draggedContentRangesBetweenOffsets const):
3168         * rendering/SimpleLineLayout.cpp:
3169         (WebCore::SimpleLineLayout::canUseForWithReason):
3170         * testing/Internals.cpp:
3171         (WebCore::Internals::markerCountForNode):
3172
3173 2018-12-17  Commit Queue  <commit-queue@webkit.org>
3174
3175         Unreviewed, rolling out r239265 and r239274.
3176         https://bugs.webkit.org/show_bug.cgi?id=192765
3177
3178         unorm_normalize is deprecated, and broke an internal build
3179         (Requested by Truitt on #webkit).
3180
3181         Reverted changesets:
3182
3183         "[GTK][WPE] Need a function to convert internal URI to display
3184         ("pretty") URI"
3185         https://bugs.webkit.org/show_bug.cgi?id=174816
3186         https://trac.webkit.org/changeset/239265
3187
3188         "Fix the Apple Internal Mac build with a newer SDK"
3189         https://trac.webkit.org/changeset/239274
3190
3191 2018-12-17  Daniel Bates  <dabates@apple.com>
3192
3193         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
3194         https://bugs.webkit.org/show_bug.cgi?id=192633
3195
3196         Reviewed by Wenson Hsieh.
3197
3198         UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
3199         input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
3200         for binary compatibility.
3201
3202         * platform/ios/WebEvent.h:
3203         * platform/ios/WebEvent.mm:
3204         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
3205
3206 2018-12-17  Matt Lewis  <jlewis3@apple.com>
3207
3208         Unreviewed, rolling out r239254.
3209
3210         This broke the Windows 10 Debug build
3211
3212         Reverted changeset:
3213
3214         "Replace many uses of String::format with more type-safe
3215         alternatives"
3216         https://bugs.webkit.org/show_bug.cgi?id=192742
3217         https://trac.webkit.org/changeset/239254
3218
3219 2018-12-17  Antoine Quint  <graouts@apple.com>
3220
3221         [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
3222         https://bugs.webkit.org/show_bug.cgi?id=192758
3223
3224         Reviewed by Dean Jackson.
3225
3226         We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
3227         gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
3228         less bookkeeping to perform.
3229
3230         No new test since there is no user-observable change.
3231
3232         * animation/WebAnimation.cpp:
3233         (WebCore::WebAnimation::updateFinishedState):
3234         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
3235         (WebCore::WebAnimation::performMicrotask): Deleted.
3236         * animation/WebAnimation.h:
3237
3238 2018-12-17  Antoine Quint  <graouts@apple.com>
3239
3240         [Web Animations] Ensure we don't update an animation's finished state twice when updating animations
3241         https://bugs.webkit.org/show_bug.cgi?id=192757
3242
3243         Reviewed by Dean Jackson.
3244
3245         When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
3246         twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
3247         whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
3248         next call to resolve(), unless any of the timing properties have changed in the meantime.
3249
3250         No new test since there is no user-observable change.
3251
3252         * animation/WebAnimation.cpp:
3253         (WebCore::WebAnimation::timingDidChange):
3254         (WebCore::WebAnimation::tick):
3255         (WebCore::WebAnimation::resolve):
3256         * animation/WebAnimation.h:
3257
3258 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
3259
3260         REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
3261         https://bugs.webkit.org/show_bug.cgi?id=192725
3262         rdar://problem/46011418
3263
3264         Reviewed by Antoine Quint.
3265
3266         There were two problems with backing store attachment and animation.
3267         
3268         First, animations are an input into the "backing store attached" logic, so when they change
3269         we should set the CoverageRectChanged bit on GraphicsLayerCA.
3270         
3271         Secondly, when an ancestor has unknown animation extent, all its descendants need to
3272         get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
3273         the current layer has no animation extent.
3274
3275         Tests: compositing/backing/animate-into-view-with-descendant.html
3276                compositing/backing/animate-into-view.html
3277
3278         * platform/graphics/ca/GraphicsLayerCA.cpp:
3279         (WebCore::GraphicsLayerCA::addAnimation):
3280         (WebCore::GraphicsLayerCA::removeAnimation):
3281         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3282
3283 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3284
3285         [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
3286         https://bugs.webkit.org/show_bug.cgi?id=192747
3287
3288         Reviewed by Antti Koivisto.
3289
3290         Rename some margin collapse getters.
3291
3292         * layout/blockformatting/BlockFormattingContext.h:
3293         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3294         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3295         * layout/blockformatting/BlockMarginCollapse.cpp:
3296         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
3297         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
3298         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
3299         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
3300         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
3301         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
3302         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
3303         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
3304         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3305         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
3306         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
3307         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
3308         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
3309         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3310         (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
3311         (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
3312         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
3313         (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
3314         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
3315         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
3316
3317 2018-12-17  David Kilzer  <ddkilzer@apple.com>
3318
3319         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
3320         <https://webkit.org/b/192751>
3321         <rdar://problem/46771623>
3322
3323         Reviewed by Daniel Bates.
3324
3325         Change loop variables to const references to avoid unnecessary
3326         copies.
3327
3328         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3329         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3330         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3331         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
3332         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3333         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
3334         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3335         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
3336         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
3337         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
3338         (WebCore::IDBDatabaseInfo::loggingString const):
3339         * Modules/mediasource/SourceBuffer.cpp:
3340         (WebCore::removeSamplesFromTrackBuffer):
3341         * accessibility/AccessibilityRenderObject.cpp:
3342         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
3343         * accessibility/AccessibilityTableRow.cpp:
3344         (WebCore::AccessibilityTableRow::headerObject):
3345         * animation/KeyframeEffect.cpp:
3346         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
3347         * crypto/keys/CryptoKeyRSA.cpp:
3348         (WebCore::CryptoKeyRSA::importJwk):
3349         (WebCore::CryptoKeyRSA::exportJwk const):
3350         * css/CSSComputedStyleDeclaration.cpp:
3351         (WebCore::OrderedNamedLinesCollector::appendLines const):
3352         * dom/DataTransfer.cpp:
3353         (WebCore::readURLsFromPasteboardAsString):
3354         * dom/TreeScope.cpp:
3355         (WebCore::TreeScope::elementsFromPoint):
3356         * html/track/WebVTTParser.cpp:
3357         (WebCore::WebVTTParser::checkAndStoreRegion):
3358         * inspector/agents/InspectorTimelineAgent.cpp:
3359         (WebCore::InspectorTimelineAgent::setInstruments):
3360         * page/Page.cpp:
3361         (WebCore::Page::updateIntersectionObservations):
3362         * page/TextIndicator.cpp:
3363         (WebCore::estimatedBackgroundColorForRange):
3364         * page/animation/KeyframeAnimation.cpp:
3365         (WebCore::KeyframeAnimation::computeLayoutDependency):
3366         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3367         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3368         * platform/graphics/ca/GraphicsLayerCA.cpp:
3369         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
3370         (WebCore::GraphicsLayerCA::updateAnimations):
3371         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
3372         * platform/graphics/mac/ImageMac.mm:
3373         (WebCore::BitmapImage::tiffRepresentation):
3374         * rendering/HitTestResult.cpp:
3375         (WebCore::HitTestResult::append):
3376         * testing/Internals.cpp:
3377         (WebCore::Internals::acceleratedAnimationsForElement):
3378
3379 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
3380
3381         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3382         https://bugs.webkit.org/show_bug.cgi?id=174816
3383
3384         Reviewed by Michael Catanzaro.
3385
3386         Tests: enabled fast/url/user-visible/.
3387
3388         * testing/Internals.cpp:
3389         (WebCore::Internals::userVisibleString): Enable method on all platforms.
3390
3391 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3392
3393         Null pointer dereference in JSC::WriteBarrierBase()
3394         https://bugs.webkit.org/show_bug.cgi?id=191252
3395
3396         Reviewed by Keith Miller.
3397
3398         * bindings/js/JSCustomElementRegistryCustom.cpp:
3399         (WebCore::JSCustomElementRegistry::whenDefined):
3400         * bindings/js/JSDOMPromiseDeferred.cpp:
3401         (WebCore::createDeferredPromise):
3402         * bindings/js/JSDOMPromiseDeferred.h:
3403         (WebCore::DeferredPromise::create):
3404         (WebCore::callPromiseFunction):
3405         * bindings/js/JSDOMWindowBase.cpp:
3406         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
3407         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
3408         * bindings/js/ScriptModuleLoader.cpp:
3409         (WebCore::ScriptModuleLoader::fetch):
3410         (WebCore::rejectPromise):
3411
3412 2018-12-15  Darin Adler  <darin@apple.com>
3413
3414         Use warning-ignoring macros more consistently and simply
3415         https://bugs.webkit.org/show_bug.cgi?id=192743
3416
3417         Reviewed by Mark Lam.
3418
3419         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
3420         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
3421         files like this one with non-clang compilers, and no need to worry about
3422         them when choosing the macro.
3423
3424         * crypto/mac/CryptoKeyRSAMac.cpp:
3425         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3426
3427         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
3428         the "unknown-pragmas" trick, which the macro should take care of.
3429         * css/makevalues.pl: Ditto.
3430         * platform/ColorData.gperf: Ditto.
3431
3432         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3433         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
3434         (see rationale above for Objective-C++).
3435
3436         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3437         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
3438         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3439         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3440         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
3441
3442         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
3443         (see rationale above for Objective-C++).
3444
3445         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3446         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
3447         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3448
3449         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
3450         (see rationale above for Objective-C++).
3451
3452         * platform/network/cocoa/ResourceResponseCocoa.mm:
3453         (WebCore::ResourceResponse::platformCertificateInfo const): Use
3454         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3455
3456 2018-12-15  Darin Adler  <darin@apple.com>
3457
3458         Replace many uses of String::format with more type-safe alternatives
3459         https://bugs.webkit.org/show_bug.cgi?id=192742
3460
3461         Reviewed by Mark Lam.
3462
3463         A while back, String::format was more efficient than string concatenation,
3464         but that is no longer true, and we should prefer String::number, makeString,
3465         or concatenation with the "+" operator to String::format for new code.
3466
3467         This is not as good for programmers who are fond of printf formatting
3468         style, and in some cases it's a little harder to read the strings
3469         interspersed with variables rather than a format string, but it's better
3470         in a few ways:
3471
3472         - more efficient (I didn't measure the difference, but it's definitely
3473           slower to use String::Format which calls vsnprintf twice than to use
3474           the WTF code)
3475         - works in a type-safe way without a need to use a format specifier such
3476           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
3477           subtle differences between platforms
3478         - allows us to use StringView in some cases to sidestep the need to
3479           allocate temporary WTF::String objects
3480         - does not require converting each WTF::String to a C string, allowing
3481           us to remove many cases of ".utf8().data()" and similar expressions,
3482           eliminating the allocation of temporary WTF::CString objects
3483
3484         This patch covers a batch of easiest-to-convert call sites.
3485         Later patches will allow us to deprecate or remove String::format.
3486
3487         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3488         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
3489         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3490         (WebCore::IDBCursorInfo::loggingString const): Ditto.
3491         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
3492         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
3493         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
3494         (WebCore::IDBGetRecordData::loggingString const): Ditto.
3495         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
3496         (WebCore::IDBIndexInfo::loggingString const): Ditto.
3497         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
3498         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
3499         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
3500         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3501         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
3502         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3503         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
3504         * Modules/webdatabase/Database.cpp:
3505         (WebCore::formatErrorMessage): Ditto.
3506         * Modules/webdatabase/SQLError.h:
3507         (WebCore::SQLError::create): Ditto.
3508
3509         * bindings/scripts/CodeGeneratorJS.pm:
3510         (GenerateImplementation): Use makeString.
3511
3512         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3513         * bindings/scripts/test/JS/JSMapLike.cpp:
3514         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3515         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3516         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3517         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3518         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3519         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3520         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3521         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3522         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3523         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3524         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3525         * bindings/scripts/test/JS/JSTestException.cpp:
3526         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3527         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3528         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3529         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3530         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3531         * bindings/scripts/test/JS/JSTestInterface.cpp:
3532         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3533         * bindings/scripts/test/JS/JSTestIterable.cpp:
3534         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3535         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3536         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3537         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3538         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3539         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3540         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3541         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3542         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3543         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3544         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3545         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3546         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3547         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3548         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3549         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3550         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3551         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3552         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3553         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3554         * bindings/scripts/test/JS/JSTestNode.cpp:
3555         * bindings/scripts/test/JS/JSTestObj.cpp:
3556         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3557         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3558         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3559         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3560         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3561         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3562         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3563         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3564         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3565         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3566         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3567         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3568         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3569         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3570         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3571         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3572         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3573         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3574         Updated expected results.
3575 :
3576         * css/parser/CSSPropertyParserHelpers.cpp:
3577         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
3578         and makeString.
3579
3580         * html/HTMLSelectElement.cpp:
3581         (WebCore::HTMLSelectElement::setLength): Use makeString.
3582         * html/ImageDocument.cpp:
3583         (WebCore::ImageDocument::imageUpdated): Ditto.
3584         * html/parser/XSSAuditor.cpp:
3585         (WebCore::XSSAuditor::init): Ditto.
3586         * inspector/InspectorFrontendClientLocal.cpp:
3587         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
3588         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
3589         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
3590         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
3591         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
3592         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
3593         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
3594         * page/MemoryRelease.cpp:
3595         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
3596
3597         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3598         (WebCore::formatByteNumber): Use String::number.
3599         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
3600
3601         * page/cocoa/ResourceUsageThreadCocoa.mm:
3602         (WebCore::logFootprintComparison): Use makeString.
3603         * platform/animation/TimingFunction.cpp:
3604         (WebCore::TimingFunction::cssText const): Ditto.
3605
3606         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3607         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
3608         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3609         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
3610
3611         * platform/graphics/ca/GraphicsLayerCA.cpp:
3612         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
3613         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
3614         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
3615         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
3616         * platform/mock/MockRealtimeVideoSource.cpp:
3617         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
3618
3619         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
3620
3621         * platform/network/ParsedContentRange.cpp:
3622         (WebCore::ParsedContentRange::headerValue const): Use makeString.
3623
3624         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
3625         compiler conditionals and reorganized the start/stop of namespaces.
3626         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
3627
3628         * platform/sql/SQLiteDatabase.cpp:
3629         (WebCore::unauthorizedSQLFunction): Use makeString.
3630         * rendering/RenderLayerCompositor.cpp:
3631         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
3632         * workers/service/server/RegistrationDatabase.cpp:
3633         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
3634         (WebCore::RegistrationDatabase::importRecords): Ditto.
3635
3636 2018-12-15  Youenn Fablet  <youenn@apple.com>
3637
3638         Make RTCRtpSender.setParameters to activate specific encodings
3639         https://bugs.webkit.org/show_bug.cgi?id=192732
3640
3641         Reviewed by Eric Carlson.
3642
3643         The conversion between libwebrtc and WebCore is lossy for send parameters.
3644         Libwebrtc checking the differences of values, call to setParameters will often fail.
3645
3646         Given some parameters cannot be exposed, the sender backend keeps the
3647         current set of parameters when gathered and reuses them when parameters are set.
3648
3649         For encodings, we only change activate/maxBitRate/maxFrameRate as
3650         these are the most important parameters to be able to modify.
3651
3652         Covered by added tests in webrtc/video.html.
3653
3654         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
3655         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
3656         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
3657         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
3658         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3659         (WebCore::fromRTCRtpSendParameters):
3660         (WebCore::fromRTCEncodingParameters): Deleted.
3661         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
3662
3663 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
3664
3665         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
3666         https://bugs.webkit.org/show_bug.cgi?id=192724
3667         <rdar://problem/46745911>
3668
3669         Reviewed by Devin Rousso.
3670
3671         iOS never installs the InspectorOverlay page as a page overlay.
3672         It also uses its own node highlighting painting. Avoid any work
3673         and resources associated with the overlay page for iOS.
3674
3675         * inspector/InspectorOverlay.cpp:
3676         (WebCore::InspectorOverlay::paint):
3677         (WebCore::InspectorOverlay::update):
3678         (WebCore::InspectorOverlay::overlayPage):
3679         (WebCore::evaluateCommandInOverlay):
3680
3681 2018-12-14  Youenn Fablet  <youenn@apple.com>
3682
3683         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
3684         https://bugs.webkit.org/show_bug.cgi?id=192720
3685
3686         Reviewed by Eric Carlson.
3687
3688         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
3689         as the latter is a ref counted object.
3690         Made some refactoring to return early in case of error.
3691
3692         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
3693         the MediaRecorder will stop listening for its tracks.
3694         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
3695
3696         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
3697
3698         * Modules/mediarecorder/MediaRecorder.cpp:
3699         (WebCore::MediaRecorder::didAddOrRemoveTrack):
3700         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
3701         * Modules/mediarecorder/MediaRecorder.h:
3702         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
3703         (WebCore::MediaRecorderPrivateAVFImpl::create):
3704         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
3705         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
3706         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
3707         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
3708         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
3709         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
3710         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
3711         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3712         (WebCore::MediaRecorderPrivateWriter::create):
3713         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
3714         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
3715         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
3716
3717 2018-12-14  Youenn Fablet  <youenn@apple.com>
3718
3719         getSenders/getReceivers() should not return closed transceiver senders/receivers
3720         https://bugs.webkit.org/show_bug.cgi?id=192706
3721
3722         Reviewed by Eric Carlson.
3723
3724         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
3725         This forces us to compute the sender/receiver list at getter call time.
3726         Updated the internal call sites of senders to use the list of transceivers instead.
3727
3728         Covered by updated WPT tests.
3729
3730         * Modules/mediastream/RTCPeerConnection.cpp:
3731         (WebCore::RTCPeerConnection::addTrack):
3732         (WebCore::RTCPeerConnection::getSenders const):
3733         (WebCore::RTCPeerConnection::getReceivers const):
3734         * Modules/mediastream/RTCPeerConnection.h:
3735         * Modules/mediastream/RTCRtpTransceiver.cpp:
3736         (WebCore::RTCRtpTransceiver::stopped const):
3737         (WebCore::RtpTransceiverSet::append):
3738         (WebCore::RtpTransceiverSet::senders const):
3739         (WebCore::RtpTransceiverSet::receivers const):
3740         * Modules/mediastream/RTCRtpTransceiver.h:
3741         (WebCore::RtpTransceiverSet::senders const): Deleted.
3742         (WebCore::RtpTransceiverSet::receivers const): Deleted.
3743         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3744         (WebCore::findExistingSender):
3745         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
3746
3747 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3748
3749         clang-tidy: Fix unnecessary copy of objects for operator==() methods
3750         <https://webkit.org/b/192712>
3751         <rdar://problem/46739332>
3752
3753         Reviewed by Andy Estes.
3754
3755         * contentextensions/HashableActionList.h:
3756         (WebCore::ContentExtensions::HashableActionList::operator== const):
3757         (WebCore::ContentExtensions::HashableActionList::operator!= const):
3758         * platform/network/FormData.h:
3759         (WebCore::FormDataElement::EncodedFileData::operator== const):
3760         (WebCore::FormDataElement::EncodedBlobData::operator== const):
3761         - Change arguments from const to const reference to avoid
3762           copies.
3763
3764 2018-12-14  Jer Noble  <jer.noble@apple.com>
3765
3766         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
3767         https://bugs.webkit.org/show_bug.cgi?id=192713
3768         <rdar://problem/46739706>
3769
3770         Reviewed by Eric Carlson.
3771
3772         A callback is being called twice, and the second time has a null Promise. Instead of these
3773         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
3774         have ASSERTS() that they are called once-and-only-once.
3775
3776         * platform/encryptedmedia/CDMInstanceSession.h:
3777         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3778         (WebCore::CDMInstanceSessionClearKey::closeSession):
3779         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3780         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
3781         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
3782         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
3783         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
3784         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
3785
3786 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3787
3788         clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
3789         <https://webkit.org/b/192708>
3790         <rdar://problem/46735907>
3791
3792         Reviewed by Jer Noble.
3793
3794         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3795         (WebCore::toSample):
3796         - Make argument a const reference.
3797
3798         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3799         - Update method signatures for implementation changes.
3800         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3801         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
3802         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
3803         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
3804         - Make RetainPtr<> argument an rvalue reference and use WTFMove().
3805         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3806         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
3807         - Make RetainPtr<> argument a const reference.
3808
3809         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3810         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
3811         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
3812         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
3813         - Change for loop keys to be const references.
3814
3815         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3816         - Update method signatures for implementation changes.
3817         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3818         (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
3819         (WebCore::SourceBufferPrivateAVFObjC::seekToTime):
3820         - Make Mediatime arguments a const reference.
3821
3822 2018-12-14  Simon Fraser  <simon.fraser@apple.com>
3823
3824         REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
3825         https://bugs.webkit.org/show_bug.cgi?id=188655
3826         rdar://problem/43382687
3827
3828         Reviewed by Antoine Quint.
3829
3830         The logic that computes animation extent, used by backing store attachment code, failed
3831         to account for the behavior where a keyframe animation with a missing 0% keyframe uses
3832         the transform from the unanimated style. This resulted in the computed extent being wrong,
3833         which caused us to remove the layer's backing store in some scenarios.
3834
3835         Fix both animation code paths to use the renderer style if the first keyframe doesn't
3836         contain a transform.
3837
3838         Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
3839                legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html
3840
3841         * animation/KeyframeEffect.cpp:
3842         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
3843         * page/animation/KeyframeAnimation.cpp:
3844         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
3845
3846 2018-12-14  Chris Dumez  <cdumez@apple.com>
3847
3848         [PSON] Stop exposing PolicyAction::Suspend to WebCore
3849         https://bugs.webkit.org/show_bug.cgi?id=192701
3850
3851         Reviewed by Brady Eidson.
3852
3853         Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.
3854
3855         * loader/DocumentLoader.cpp:
3856         (WebCore::DocumentLoader::continueAfterContentPolicy):
3857         * loader/FrameLoaderTypes.h:
3858         * loader/PolicyChecker.cpp:
3859         (WebCore::PolicyChecker::checkNavigationPolicy):
3860         (WebCore::PolicyChecker::checkNewWindowPolicy):
3861
3862 2018-12-14  Youenn Fablet  <youenn@apple.com>
3863
3864         IDB should store RTCCertificate
3865         https://bugs.webkit.org/show_bug.cgi?id=192599
3866
3867         Reviewed by Brady Eidson.
3868
3869         In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
3870         Instead, create an empty object so that the deserialization can still succeed.
3871         This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.
3872
3873         Test: webrtc/certificates-indexeddb.html
3874
3875         * bindings/js/SerializedScriptValue.cpp:
3876         (WebCore::CloneDeserializer::readTerminal):
3877
3878 2018-12-14  Zalan Bujtas  <zalan@apple.com>
3879
3880         [LFC][BFC] Transition to logical margin types.
3881         https://bugs.webkit.org/show_bug.cgi?id=192699
3882
3883         Reviewed by Antti Koivisto.
3884
3885         This is in preparation for moving over to logical types.
3886         (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))
3887
3888         * layout/FormattingContext.cpp:
3889         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3890         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3891         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3892         * layout/FormattingContext.h:
3893         * layout/FormattingContextGeometry.cpp:
3894         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
3895         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3896         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3897         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3898         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3899         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3900         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3901         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3902         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3903         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3904         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3905         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3906         * layout/FormattingContextQuirks.cpp:
3907         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3908         * layout/MarginTypes.h:
3909         (WebCore::Layout::VerticalMargin::usedValues const):
3910         * layout/Verification.cpp:
3911         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3912         * layout/blockformatting/BlockFormattingContext.cpp:
3913         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
3914         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
3915         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
3916         (WebCore::Layout::hasPrecomputedMarginBefore):
3917         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3918         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
3919         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3920         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3921         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3922         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
3923         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
3924         (WebCore::Layout::hasPrecomputedMarginTop): Deleted.
3925         * layout/blockformatting/BlockFormattingContext.h:
3926         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3927         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3928         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3929         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3930         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
3931         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3932         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
3933         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
3934         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
3935         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
3936         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
3937         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3938         (WebCore::Layout::hasMarginBeforeQuirkValue):
3939         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3940         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
3941         (WebCore::Layout::hasMarginTopQuirkValue): Deleted.
3942         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
3943         * layout/blockformatting/BlockMarginCollapse.cpp:
3944         (WebCore::Layout::isMarginBeforeCollapsedWithSibling):
3945         (WebCore::Layout::isMarginAfterCollapsedWithSibling):
3946         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
3947         (WebCore::Layout::isMarginAfterCollapsedThrough):
3948         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
3949         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
3950         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
3951         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
3952         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
3953         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3954         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
3955         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
3956         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
3957         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
3958         (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
3959         (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
3960         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
3961         (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
3962         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
3963         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
3964         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
3965         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
3966         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
3967         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
3968         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
3969         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
3970         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
3971         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
3972         * layout/displaytree/DisplayBox.cpp:
3973         (WebCore::Display::Box::Box):
3974         (WebCore::Display::Box::marginBox const):
3975         (WebCore::Display::Box::nonCollapsedMarginBox const):
3976         * layout/displaytree/DisplayBox.h:
3977         (WebCore::Display::Box::rectWithMargin const):
3978         (WebCore::Display::Box::estimatedMarginBefore const):
3979         (WebCore::Display::Box::setEstimatedMarginBefore):
3980         (WebCore::Display::Box::top