.:
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-07-24  Thibault Saunier  <tsaunier@igalia.com>
2
3         [WPE][GTK] Implement PeerConnection API on top of libwebrtc
4         https://bugs.webkit.org/show_bug.cgi?id=186932
5
6         Reviewed by Philippe Normand.
7
8         Enabled many webrtc tests.
9
10         * platform/GStreamer.cmake: Build new files
11         * platform/graphics/gstreamer/GStreamerCommon.cpp: Fix minor style issues
12         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Add a way to give precise name to pipelines
13         and give useful names to pipelines with sources comming from a PeerConnection
14         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
15         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: Added. Implement a subclass of webrtc::VideoFrame
16         to represent a kNative GStreamer video frame.
17         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: Added. Ditto.
18         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: Handle incoming audio samples from libwebrtc.
19         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h: Ditto.
20         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp: Handle incoming video frames from libwebrtc.
21         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h: Ditto.
22         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: Handle passing locally captured audio sample to libwebrtc.
23         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: Ditto.
24         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: Handle passing locally captured vidoe frames to libwebrtc.
25         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Added. Implement a video decoder factory and LibWebRTC Video decoders based on GStreamer.
26         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h: Added. Ditto.
27         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Added. Implement a video encoder factory and LibWebRTC H264/VP8 Video encoders based on GStreamer.
28         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Added. Ditto.
29         * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Add information about signness of the LibWebRTC audio format.
30         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Add support for newly added Encoder/Decoder factories.
31         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Ditto.
32
33 2018-07-24  Dirk Schulze  <krit@webkit.org>
34
35         [css-masking] Black backdrop on -webkit-clip-path on SVG root
36         https://bugs.webkit.org/show_bug.cgi?id=187880
37
38         Reviewed by Simon Fraser.
39
40         For SVG document root elements, we currently clip twice:
41         In RenderLayer and SVGRenderSupport.
42         Avoid clipping in RenderLayer which currently clips before we established a
43         backdrop for an SVG document.
44
45         Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
46                svg/clip-path/clip-path-on-svg-005.svg
47
48         * rendering/RenderLayer.cpp:
49         (WebCore::RenderLayer::setupClipPath): Skip actual clipping.
50
51 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
52
53         [Nicosia] Add TextureMapperAnimations member to CompositingLayer::LayerState
54         https://bugs.webkit.org/show_bug.cgi?id=187941
55
56         Reviewed by Carlos Garcia Campos.
57
58         Nicosia::CompositingLayer::LayerState gains a TextureMapperAnimations
59         member that will be assigned a list of all active animations during each
60         layer flush. Despite the name, TextureMapperAnimations doesn't depend on
61         any other TextureMapper class. It might be renamed and moved in the
62         future, but for now it's used as-is.
63
64         In CoordinatedGraphicsLayer, the syncAnimations() method now flips on
65         the animationsChanged flag in the LayerState::Delta struct. This causes
66         all the active animations to be copied over into the layer state in
67         flushCompositingStateForThisLayerOnly().
68
69         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
70         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
71         (WebCore::CoordinatedGraphicsLayer::syncAnimations):
72         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
73
74 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
75
76         [Nicosia] Add FilterOperations member to CompositionLayer::LayerState
77         https://bugs.webkit.org/show_bug.cgi?id=187901
78
79         Reviewed by Carlos Garcia Campos.
80
81         Nicosia::CompositionLayer::LayerState gains a FilterOperations member
82         that can be assigned the list of filter operations for a given layer.
83         The corresponding filtersChanged boolean is added to LayerState::Delta.
84
85         CoordinatedGraphicsLayer::syncFilters() flips on that delta member,
86         which in turn causes the FilterOperations value to be updated during
87         the layer flush, in flushCompositingStateForThisLayerOnly().
88
89         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
90         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
91         (WebCore::CoordinatedGraphicsLayer::syncFilters):
92         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
93
94 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
95
96         [CoordGraphics] Use adjusted position, anchor point, size values for Nicosia::CompositionLayer state
97         https://bugs.webkit.org/show_bug.cgi?id=187899
98
99         Reviewed by Carlos Garcia Campos.
100
101         As is done for the CoordinatedGraphicsLayerState, the scale-adjusted
102         position, anchor point and size values should be used when updating the
103         corresponding Nicosia::CompositionLayer::LayerState members.
104
105         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
106         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
107
108 2018-07-23  Manuel Rego Casasnovas  <rego@igalia.com>
109
110         [css-grid] Add support for calc() in gutter properties
111         https://bugs.webkit.org/show_bug.cgi?id=187902
112
113         Reviewed by Simon Fraser.
114
115         The parsing was already accepting calc() in grid row and column gaps,
116         however the code was not taking that into account properly.
117         If the calc() had a percentage it was ignored and that's wrong.
118
119         The fix is just a change in the ceck at RenderGrid::availableSpaceForGutters().
120
121         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html
122                imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002.html
123                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-011.html
124                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-012.html
125
126         * rendering/RenderGrid.cpp:
127         (WebCore::RenderGrid::availableSpaceForGutters const):
128
129 2018-07-23  Aditya Keerthi  <akeerthi@apple.com>
130
131         Remove extraneous #endif in html.css
132         https://bugs.webkit.org/show_bug.cgi?id=187934
133
134         Reviewed by Tim Horton.
135
136         * css/html.css: Remove extraneous #endif.
137
138 2018-07-23  Sihui Liu  <sihui_liu@apple.com>
139
140         CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
141         https://bugs.webkit.org/show_bug.cgi?id=187927
142
143         Reviewed by Chris Dumez.
144
145         IDBKeyData is valid only when each key of it is valid.
146
147         Test: LayoutTests/storage/indexeddb/index-multientry.html
148
149         * Modules/indexeddb/IDBKeyData.cpp:
150         (WebCore::IDBKeyData::isValid const):
151         * Modules/indexeddb/IDBKeyData.h:
152         (WebCore::IDBKeyData::isValid const): Deleted.
153
154 2018-07-23  Ben Richards  <benton_richards@apple.com>
155
156         We should cache the compiled sandbox profile in a data vault
157         https://bugs.webkit.org/show_bug.cgi?id=184991
158
159         Reviewed by Ryosuke Niwa.
160
161         Added functionality to FileHandle so that it can lock a file while open.
162         Added a function to FileSystem to delete non empty directories.
163
164         * platform/FileHandle.cpp:
165         (WebCore::FileHandle::FileHandle):
166         (WebCore::FileHandle::open):
167         (WebCore::FileHandle::close):
168         * platform/FileHandle.h:
169         * platform/FileSystem.h:
170         * platform/cocoa/FileSystemCocoa.mm:
171         (WebCore::FileSystem::deleteNonEmptyDirectory):
172
173 2018-07-23  Justin Fan  <justin_fan@apple.com>
174
175         [macOS] Ensure that WebGL contexts are always set to an accelerated virtual screen
176         https://bugs.webkit.org/show_bug.cgi?id=187923
177
178         Reviewed by Dean Jackson.
179
180         On eGPU displays, it is possible that CGL does not match the preferred renderer. 
181         In this case, and when the web process is blocked from accessing the window server, 
182         3D contexts *may* default to the software renderer. Ensure that even if this occurs,
183         we set the context to use a hardware-accelerated renderer/virtual screen.
184
185         No new tests. Existing behavior covered by existing tests.
186         Requires multiple screens, at least one attached to an eGPU, to stress. 
187
188         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
189         (WebCore::identifyAndSetCurrentGPU):
190
191 2018-07-23  Sam Weinig  <sam@webkit.org>
192
193         Convert some obvious never-null pointers to references in the editing code
194         https://bugs.webkit.org/show_bug.cgi?id=187914
195
196         Reviewed by Dean Jackson.
197
198         Fixup trivial cases of never-null pointers that really should be references.
199
200         * editing/ApplyStyleCommand.cpp:
201         (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
202         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
203         (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
204         (WebCore::ApplyStyleCommand::removeCSSStyle):
205         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
206         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
207         * editing/EditingStyle.cpp:
208         (WebCore::EditingStyle::overrideWithStyle):
209         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
210         (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement const):
211         (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes const):
212         (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes const):
213         (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
214         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
215         (WebCore::EditingStyle::mergeInlineStyleOfElement):
216         (WebCore::EditingStyle::wrappingStyleForSerialization):
217         (WebCore::EditingStyle::legacyFontSize const):
218         (WebCore::StyleChange::StyleChange):
219         (WebCore::StyleChange::extractTextStyles):
220         (WebCore::legacyFontSizeFromCSSValue):
221         * editing/EditingStyle.h:
222         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
223         * editing/Editor.cpp:
224         (WebCore::Editor::selectionStartCSSPropertyValue):
225         * editing/ReplaceSelectionCommand.cpp:
226         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
227         (WebCore::isInlineNodeWithStyle):
228         * editing/markup.cpp:
229         (WebCore::StyledMarkupAccumulator::appendElement):
230         (WebCore::StyledMarkupAccumulator::serializeNodes):
231
232 2018-07-23  Per Arne Vollan  <pvollan@apple.com>
233
234         WebCore::primaryScreenDisplayID() always return 0
235         https://bugs.webkit.org/show_bug.cgi?id=187922
236         <rdar://problem/42286933>
237
238         Reviewed by Geoffrey Garen.
239
240         This function should return a valid display ID.
241
242         No new tests. Testing this requires a dual monitor setup.
243
244         * platform/mac/PlatformScreenMac.mm:
245         (WebCore::primaryScreenDisplayID):
246
247 2018-07-23  Nan Wang  <n_wang@apple.com>
248
249         AX: Press tab to highlight items on a webpage is not working with voiceover enabled
250         https://bugs.webkit.org/show_bug.cgi?id=187824
251
252         Reviewed by Zalan Bujtas.
253
254         We are deferring posting focused element change notification when the document needs a
255         style recalculation. However, we only perform the cache update after a layout is completed.
256         Added a timer to perform the cache update in the next runloop when non-layout type of mutation
257         happens.
258         
259         Test: accessibility/mac/tab-focus-post-notification.html
260
261         * accessibility/AXObjectCache.cpp:
262         (WebCore::AXObjectCache::AXObjectCache):
263         (WebCore::AXObjectCache::~AXObjectCache):
264         (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
265         (WebCore::AXObjectCache::performCacheUpdateTimerFired):
266         * accessibility/AXObjectCache.h:
267         (WebCore::AXObjectCache::AXObjectCache):
268         (WebCore::AXObjectCache::performCacheUpdateTimerFired):
269
270 2018-07-23  Chris Dumez  <cdumez@apple.com>
271
272         WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
273         https://bugs.webkit.org/show_bug.cgi?id=187910
274         <rdar://problem/42356526>
275
276         Reviewed by Brent Fulgham.
277
278         Add internals API that causes the ResourceLoadObserver to notify its observer, and avoid waiting
279         for the 5 second delay.
280
281         * testing/Internals.cpp:
282         (WebCore::Internals::notifyResourceLoadObserver):
283         * testing/Internals.h:
284         * testing/Internals.idl:
285
286 2018-07-23  Zalan Bujtas  <zalan@apple.com>
287
288         [LCF][IFC] Add support for hyphenation.
289         https://bugs.webkit.org/show_bug.cgi?id=187913
290
291         Reviewed by Antti Koivisto.
292
293         Move the hyphenation logic over from SimpleLineLayout::TextFragmentIterator.
294
295         * layout/inlineformatting/textlayout/Runs.h:
296         (WebCore::Layout::TextRun::hasHyphen const):
297         (WebCore::Layout::LayoutRun::setHasHyphen):
298         (WebCore::Layout::LayoutRun::hasHyphen const):
299         (WebCore::Layout::LayoutRun::LayoutRun):
300         (WebCore::Layout::TextRun::createNonWhitespaceRunWithHyphen):
301         (WebCore::Layout::TextRun::TextRun):
302         * layout/inlineformatting/textlayout/TextContentProvider.cpp:
303         (WebCore::Layout::TextContentProvider::findTextItemSlow const):
304         (WebCore::Layout::TextContentProvider::width const):
305         (WebCore::Layout::TextContentProvider::hyphenPositionBefore const):
306         * layout/inlineformatting/textlayout/TextContentProvider.h:
307         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
308         (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
309         (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
310         (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
311         (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
312         (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
313         (WebCore::Layout::SimpleLineBreaker::Line::append):
314         (WebCore::Layout::SimpleLineBreaker::Line::reset):
315         (WebCore::Layout::SimpleLineBreaker::Style::Style):
316         (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
317         (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
318         (WebCore::Layout::SimpleLineBreaker::hyphenPositionBefore const):
319         (WebCore::Layout::SimpleLineBreaker::adjustSplitPositionWithHyphenation const):
320         (WebCore::Layout::SimpleLineBreaker::split const):
321         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
322
323 2018-07-23  Antoine Quint  <graouts@apple.com>
324
325         [Web Animations] Querying the current time of a finished CSSAnimation after removing its target leads to a crash
326         https://bugs.webkit.org/show_bug.cgi?id=187906
327
328         Reviewed by Dean Jackson.
329
330         Test: webanimations/accessing-current-time-after-finished-css-animation-target-removal.html
331
332         Because we carelessly look at a CSSAnimation's effect's timing in DeclarativeAnimation::bindingsCurrentTime
333         without checking that the effect is non-null, we can crash in the case where the animation is finished and
334         its target element has been removed, which caused the effect to be set to null.
335
336         We do not actually fix the lack of a null check, which will be the scope of a different patch, but instead
337         ensure that we do _not_ set the animation's effect to null when its target is removed, which used to be
338         performed via a call to WebAnimation::remove(). Instead, we introduce AnimationTimeline::elementWasRemoved()
339         which notifies the timeline of an element being removed such that we may stop referencing any animation
340         targeting this element from the various data structures holding strong references to the animation in question,
341         and we then cancel the animation silently, which is a new option that ensures promises aren't resolved or
342         rejected as a result.
343
344         Finally, the WebAnimation and AnimationEffectReadOnly classes established a ref-cycle as WebAnimation has
345         `RefPtr<AnimationEffectReadOnly> m_effect` and AnimationEffectReadOnly has `RefPtr<WebAnimation> m_animation`.
346         While it is correct that WebAnimation owns its effect, which is established by the DOM API, the
347         reverse is not correct since we only hold the reverse internally for the benefit of our implementation.
348         As such, we change AnimationEffectReadOnly's m_animation to be a WeakPtr<WebAnimation>. This means not
349         calling WebAnimation::remove() and simply removing the animation from the animation maps on the timeline
350         is sufficient to guarantee that the document timeline will not leak (and with it the document).
351
352         * animation/AnimationEffectReadOnly.h:
353         (WebCore::AnimationEffectReadOnly::setAnimation):
354         * animation/AnimationTimeline.cpp:
355         (WebCore::AnimationTimeline::elementWasRemoved):
356         * animation/AnimationTimeline.h:
357         * animation/WebAnimation.cpp:
358         (WebCore::WebAnimation::cancel):
359         (WebCore::WebAnimation::resetPendingTasks):
360         * animation/WebAnimation.h:
361         * dom/Element.cpp:
362         (WebCore::Element::removedFromAncestor):
363         * rendering/updating/RenderTreeUpdater.cpp:
364         (WebCore::RenderTreeUpdater::tearDownRenderers):
365
366 2018-07-23  Aditya Keerthi  <akeerthi@apple.com>
367
368         [iOS] Add support for input[type=color]
369         https://bugs.webkit.org/show_bug.cgi?id=187871
370
371         Reviewed by Tim Horton.
372
373         * css/html.css: Remove unwanted styling for color inputs with a list attribute.
374         * html/ColorInputType.cpp: Make the element focusable.
375         (WebCore::ColorInputType::isMouseFocusable const):
376         (WebCore::ColorInputType::isKeyboardFocusable const):
377         * html/ColorInputType.h:
378         * html/HTMLInputElement.h: Expose isColorControl() to WebKit.
379         * page/Chrome.cpp:
380         (WebCore::Chrome::createColorChooser):
381
382 2018-07-22  Dean Jackson  <dino@apple.com>
383
384         fullscreen env() variables should have initial values
385         https://bugs.webkit.org/show_bug.cgi?id=187897
386         <rdar://problem/42485682>
387
388         Reviewed by Sam Weinig.
389
390         The env() values for fullscreen properties need to be
391         initialized, rather than wait for values to be set from WebKit.
392         Without this, feature detection doesn't work, and properties
393         won't parse correctly.
394
395         Test: fullscreen/fullscreen-env-initial.html
396
397         * dom/ConstantPropertyMap.cpp:
398         (WebCore::ConstantPropertyMap::buildValues): Initialize the fullscreen values.
399         (WebCore::ConstantPropertyMap::updateConstantsForFullscreen): Renamed function, because it
400         also updates the duration value.
401         (WebCore::ConstantPropertyMap::didChangeFullscreenInsets): Call new name.
402         (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): Deleted.
403         * dom/ConstantPropertyMap.h:
404         * page/Page.cpp:
405         (WebCore::Page::setFullscreenAutoHideDuration): Don't change the value if it doesn't need it.
406         * page/Page.h: Add accessor for fullscreenAutoHideDuration. Also add a member variable.
407         (WebCore::Page::fullscreenAutoHideDuration const):
408
409 2018-07-22  Zalan Bujtas  <zalan@apple.com>
410
411         [LFC][IFC] Add center/right/justify line alignment support.
412         https://bugs.webkit.org/show_bug.cgi?id=187890
413
414         Reviewed by Antti Koivisto.
415
416         Move over some more code from simple line layout.
417         (though text-align: justify is more preformant as now expansion opportunities are added as we process the text runs
418         -as opposed to iterting through the runs again when we reach the end of the line.) 
419
420         * layout/inlineformatting/textlayout/Runs.h:
421         (WebCore::Layout::LayoutRun::setLeft):
422         (WebCore::Layout::LayoutRun::setExpansion):
423         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
424         (WebCore::Layout::SimpleLineBreaker::Line::Line):
425         (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
426         (WebCore::Layout::SimpleLineBreaker::Line::adjustedLeftForTextAlign const):
427         (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
428         (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
429         (WebCore::Layout::expansionOpportunity):
430         (WebCore::Layout::expansionBehavior):
431         (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
432         (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
433         (WebCore::Layout::SimpleLineBreaker::Line::append):
434         (WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
435         (WebCore::Layout::SimpleLineBreaker::Line::reset):
436         (WebCore::Layout::SimpleLineBreaker::Style::Style):
437         (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
438         (WebCore::Layout::SimpleLineBreaker::handleLineStart):
439         (WebCore::Layout::isTextAlignRight):
440         (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
441         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
442         (WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
443         (WebCore::Layout::SimpleLineBreaker::Line::setCollapseWhitespace):
444
445 2018-07-21  Zalan Bujtas  <zalan@apple.com>
446
447         [LFC][IFC] Add verification for inline text runs.
448         https://bugs.webkit.org/show_bug.cgi?id=187879
449
450         Reviewed by Antti Koivisto.
451
452         * layout/Verification.cpp:
453         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
454         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
455         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
456         (WebCore::Layout::verifyAndOutputSubtree):
457         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded): Deleted.
458         * layout/inlineformatting/InlineFormattingContext.cpp:
459         (WebCore::Layout::InlineFormattingContext::layout const):
460         * layout/inlineformatting/InlineFormattingState.h:
461         (WebCore::Layout::InlineFormattingState::addLayoutRuns):
462         (WebCore::Layout::InlineFormattingState::layoutRuns const):
463         * layout/layouttree/LayoutTreeBuilder.cpp:
464         (WebCore::Layout::outputLayoutBox):
465         (WebCore::Layout::outputLayoutTree):
466         (WebCore::Layout::TreeBuilder::showLayoutTree):
467
468 2018-07-21  Zalan Bujtas  <zalan@apple.com>
469
470         [LFC] Do not use virtual methods to construct floating/formatting states.
471         https://bugs.webkit.org/show_bug.cgi?id=187875
472
473         Reviewed by Antti Koivisto.
474
475         LayoutContext::establishedFormattingState() does not require FormattingContext anymore only the root of the context.
476
477         * layout/FormattingContext.cpp:
478         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
479         * layout/FormattingContext.h:
480         * layout/LayoutContext.cpp:
481         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
482         (WebCore::Layout::LayoutContext::formattingStateForBox const):
483         (WebCore::Layout::LayoutContext::establishedFormattingState):
484         * layout/LayoutContext.h:
485         * layout/blockformatting/BlockFormattingContext.cpp:
486         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
487         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
488         (WebCore::Layout::BlockFormattingContext::createFormattingState const): Deleted.
489         (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const): Deleted.
490         * layout/blockformatting/BlockFormattingContext.h:
491         * layout/inlineformatting/InlineFormattingContext.cpp:
492         (WebCore::Layout::InlineFormattingContext::createFormattingState const): Deleted.
493         (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const): Deleted.
494         * layout/inlineformatting/InlineFormattingContext.h:
495
496 2018-07-21  Zalan Bujtas  <zalan@apple.com>
497
498         [LFC][BFC] Do not collapse top/bottom margin with first/last inflow child from a non-block formatting context.
499         https://bugs.webkit.org/show_bug.cgi?id=187867
500
501         Reviewed by Antti Koivisto.
502
503         The box's top/bottom margin never collapses with a non-block inflow child.
504
505         * layout/blockformatting/BlockMarginCollapse.cpp:
506         (WebCore::Layout::isMarginTopCollapsedWithSibling):
507         (WebCore::Layout::isMarginBottomCollapsedWithSibling):
508         (WebCore::Layout::isMarginTopCollapsedWithParent):
509         (WebCore::Layout::isMarginBottomCollapsedThrough):
510         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
511         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
512         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
513         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
514         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
515         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
516         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
517         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
518         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
519         * layout/layouttree/LayoutBox.cpp:
520         (WebCore::Layout::Box::establishesBlockFormattingContextOnly const): <div style="overflow: hidden">foobar</div> establishes both inline and block formatting context (inline wins though).
521         * layout/layouttree/LayoutBox.h: establishesBlockFormattingContext() does not need to be virtual since we can determine it by looking at the box's style. -while in case
522         of inline formatting context, it is about the content.
523
524 2018-07-20  Jer Noble  <jer.noble@apple.com>
525
526         REGRESSION (r233974): Cannot close pip'd video; pops back into PiP.
527         https://bugs.webkit.org/show_bug.cgi?id=187873
528
529         Reviewed by Jon Lee.
530
531         When the PIP machinery on Mac wants to close the PIP window (due to the close button being clicked), it does
532         not consult our -shouldClosePiP handler; it just tells us that we're going to close. So we never setup the 
533         necessary state on the WebProcess side and still think that our "targetIsFullscreen". When we get the "stop"
534         action, just request exit fullscreen, but set up the _pipState to think we're already exiting (because we are).
535
536         * platform/mac/VideoFullscreenInterfaceMac.mm:
537         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
538
539 2018-07-20  Justin Fan  <justin_fan@apple.com>
540
541         Safari WebGL does not consistently provide correct GPU context on eGPU systems
542         https://bugs.webkit.org/show_bug.cgi?id=187750
543         <rdar://problem/39531436>
544
545         Reviewed by Dean Jackson.
546
547         Move GraphicsContext3DManager into its own class, and notify it when page/Chrome receives a 
548         windowScreenDidChange message. Add a private data struct to track which hostWindow created each context.
549         Upon notification, Manager updates the contexts that match the hostWindow with the
550         provided displayID. Each context matches displayID to rendererID (set during process creation 
551         if window server is blocked), which is matched to a virtual screen, and updates its GPU accordingly.
552
553         No new tests. This requires multiple GPUs or eGPUs, each with attached display(s), to test.
554
555         * WebCore.xcodeproj/project.pbxproj:
556         * page/Chrome.cpp:
557         (WebCore::Chrome::windowScreenDidChange): Now calls GraphicsContext3DManager::screenDidChange().
558         * platform/PlatformScreen.h:
559         * platform/ScreenProperties.h: Add rendererID to struct.
560         (WebCore::ScreenData::encode const):
561         (WebCore::ScreenData::decode):
562         * platform/graphics/GraphicsContext3D.h:
563         * platform/graphics/GraphicsContext3DManager.cpp: Added (copied out of GraphicsContext3DCocoa.mm).
564         (WebCore::attachToAppleGraphicsControl):
565         (WebCore::hasMuxCapability):
566         (WebCore::hasMuxableGPU):
567         (WebCore::GraphicsContext3DManager::sharedManager):
568         (WebCore::displayWasReconfigured):
569         (WebCore::GraphicsContext3DManager::updateAllContexts):
570         (WebCore::GraphicsContext3DManager::screenDidChange):
571         (WebCore::GraphicsContext3DManager::addContext):
572         (WebCore::GraphicsContext3DManager::removeContext):
573         (WebCore::GraphicsContext3DManager::hostWindowForContext const):
574         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
575         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
576         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
577         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
578         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
579         * platform/graphics/GraphicsContext3DManager.h: Added (copied out of GraphicsContext3DCocoa.mm).
580         (WebCore::GraphicsContext3DManager::hasTooManyContexts const):
581         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager):
582         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
583         (WebCore::GraphicsContext3D::create):
584         (WebCore::GraphicsContext3D::createShared):
585         (WebCore::identifyAndSetCurrentGPU): Now matches rendererIDs to determine virtual screen. 
586         (WebCore::GraphicsContext3D::GraphicsContext3D):
587         (WebCore::GraphicsContext3D::~GraphicsContext3D):
588         (WebCore::GraphicsContext3D::setContextVisibility):
589         (WebCore::GraphicsContext3D::simulateContextChanged):
590         (WebCore::GraphicsContext3D::screenDidChange):
591         (WebCore::attachToAppleGraphicsControl): Deleted.
592         (WebCore::hasMuxCapability): Deleted.
593         (WebCore::hasMuxableGPU): Deleted.
594         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Deleted.
595         (WebCore::GraphicsContext3DManager::hasTooManyContexts const): Deleted.
596         (WebCore::manager): Deleted.
597         (WebCore::displayWasReconfigured): Deleted.
598         (WebCore::GraphicsContext3DManager::updateAllContexts): Deleted.
599         (WebCore::GraphicsContext3DManager::addContext): Deleted.
600         (WebCore::GraphicsContext3DManager::removeContext): Deleted.
601         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance): Deleted.
602         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance): Deleted.
603         (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Deleted.
604         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Deleted.
605         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Deleted.
606         * platform/mac/PlatformScreenMac.mm: Provide a display's rendererID.
607         (WebCore::rendererIDForDisplayMask):
608         (WebCore::collectScreenProperties):
609         (WebCore::rendererIDForDisplay):
610         (WebCore::primaryRendererID):
611
612 2018-07-19  Simon Fraser  <simon.fraser@apple.com>
613
614         Remove completed animations from GraphicsLayer, thus avoiding excessive backing store allocation
615         https://bugs.webkit.org/show_bug.cgi?id=187844
616         rdar://problem/40387294
617
618         Reviewed by Dean Jackson.
619         
620         A keyframe animation which animates 3D transforms, and is fill-forwards, currently
621         leaves the GraphicsLayer in a state where it has a "running" animation. However, the
622         logic that computes animation extent in RenderLayerBacking::updateGeometry() only does
623         so for running or paused animations. GraphicsLayer then thinks that it has an active
624         transform animation with unknown extent, and refuses to detach its backing store.
625         
626         This triggers excessive layer creation on some sites (e.g. https://www.kqed.org).
627         
628         Fix by always removing animations from the GraphicsLayer when they finish, whether
629         or not they fill forwards. This is done by having KeyframeAnimation::onAnimationEnd()
630         always call endAnimation().
631         
632         This change only fixes the non-Web Animation code path. webkit.org/b/187845 exists
633         to fix the other code path.
634         
635         Also improve some logging that would have revealed this problem sooner.
636
637         Test: compositing/backing/backing-store-attachment-fill-forwards-animation.html
638
639         * page/animation/AnimationBase.h:
640         (WebCore::AnimationBase::endAnimation):
641         * page/animation/ImplicitAnimation.cpp:
642         (WebCore::ImplicitAnimation::endAnimation):
643         * page/animation/ImplicitAnimation.h:
644         * page/animation/KeyframeAnimation.cpp:
645         (WebCore::KeyframeAnimation::endAnimation):
646         (WebCore::KeyframeAnimation::onAnimationEnd):
647         * page/animation/KeyframeAnimation.h:
648         * platform/graphics/ca/GraphicsLayerCA.cpp:
649         (WebCore::GraphicsLayerCA::addAnimation):
650         (WebCore::GraphicsLayerCA::updateCoverage):
651
652 2018-07-20  Ryosuke Niwa  <rniwa@apple.com>
653
654         Picking a color from the color panel for typing attributes needs to inverse transform through color-filter
655         https://bugs.webkit.org/show_bug.cgi?id=187846
656
657         Reviewed by Simon Fraser.
658
659         This patch refines the color inversion for editing introduced in r234005 so that font panels and WebKit embedders
660         can get and set inverted colors using attributed strings for a selected text in an editable region.
661
662         More specifically, when font panels or WebKit embedders set a font color or a background color via WebView's
663         _applyStyleToSelection and _applyEditingStyleToSelection, WebKit would automatically invert the color before inserting
664         into DOM so that the color visible to the user matches that's given to WebKit. Conversely,
665         [WebView attributedSubstringFromRange:nsRange] now return the color visible to the user, i.e. the color after
666         the color filter had been applied, so that some WebKit embedders can present the visually identical color to the user.
667
668         Because DOM never sees the color filter's effect in the computed style, etc... this patch reverts the change made to
669         StyleChange in r234005 to avoid inverting the color passed to execCommand. This makes editing apps which is unaware
670         of the dark mode or -apple-color-filter continue to function (because the color picker implemented in DOM will be
671         applied of the same color filter before being presented to the user).
672
673         Finally, this patch introduces a testing hook in applyCommandToFrame so that executing foreColor or backColor with
674         the soruce of CommandFromMenuOrKeyBinding would trigger the same code path as the one taken by Objective-C 
675
676         Tests: editing/execCommand/set-backColor-with-color-filter-from-scripts.html
677                editing/execCommand/set-foreColor-with-color-filter-from-scripts.html
678                editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html
679                editing/style/set-backColor-with-color-filter.html
680                editing/style/set-foreColor-with-color-filter.html
681
682         * editing/EditingStyle.cpp:
683         (WebCore::EditingStyle::inverseTransformColorIfNeeded): Added.
684         (WebCore::StyleChange::StyleChange): Revert the change made in r234005 since this code is also used by execCommand
685         which is not desirable, and won't work for background color.
686         (WebCore::StyleChange::extractTextStyles): Ditto.
687         * editing/EditingStyle.h:
688         * editing/Editor.cpp:
689         (WebCore::Editor::applyStyle):
690         (WebCore::Editor::applyStyleToSelection): Call EditingStyle::inverseTransformColorIfNeeded when ColorFilterMode is
691         set to InvertColor.
692         * editing/Editor.h:
693         * editing/EditorCommand.cpp:
694         (WebCore::applyCommandToFrame): Added the aforementioned testing hook.
695         * editing/cocoa/HTMLConverter.mm:
696         (WebCore::editingAttributedStringFromRange): Take the color filtr into account. Some WebKit embedders use this
697         function to compute the font color in the selected text. Note that this function is mostly used for input methods
698         so the color doesn't really matter, and its implementation is distinct from that of HTMLConverter.
699
700 2018-07-19  Jer Noble  <jer.noble@apple.com>
701
702         HLS resources with remote subresources will not taint canvasses.
703         https://bugs.webkit.org/show_bug.cgi?id=187731
704         <rdar://problem/42290703>
705
706         Reviewed by Brady Eidson.
707
708         Test: http/tests/security/canvas-remote-read-remote-video-hls.html
709
710         Most media sources are single-resource; they are accessed from a single origin. HLS manifests can contain many
711         subresources from arbitrary origins, and canvases should be tainted when painted from media elements whose
712         subresources were retrieved from tainting origins.
713
714         Add a new method to HTMLMediaElement, wouldTaintOrigin(), taking a SecurityOrigin, and returning whether the
715         media element would taint that origin. This gets piped all the way down to MediaPlayerPrivateAVFoundationObjC
716         which uses WebCoreNSURLSession to track all the origins of all the responses which resulted from the media
717         element's load.
718
719         Drive-by fix: also fix this issue for media elements which render to an AudioContext.
720
721         Drive-by fix #2: CanvasRenderingContext2DBase::createPattern() needs to check the return value of
722         ImageBuffer::create() before using it.
723
724         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
725         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
726         * html/HTMLMediaElement.cpp:
727         (WebCore::HTMLMediaElement::didAttachRenderers):
728         (WebCore::HTMLMediaElement::didDetachRenderers):
729         (WebCore::HTMLMediaElement::scheduleUpdateShouldAutoplay):
730         * html/HTMLMediaElement.h:
731         (WebCore::HTMLMediaElement::wouldTaintOrigin const):
732         * html/canvas/CanvasRenderingContext.cpp:
733         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
734         * html/canvas/CanvasRenderingContext2DBase.cpp:
735         (WebCore::CanvasRenderingContext2DBase::createPattern):
736         * platform/graphics/MediaPlayer.cpp:
737         (WebCore::MediaPlayer::wouldTaintOrigin const):
738         * platform/graphics/MediaPlayer.h:
739         * platform/graphics/MediaPlayerPrivate.h:
740         (WebCore::MediaPlayerPrivateInterface::hasSingleSecurityOrigin const):
741         (WebCore::MediaPlayerPrivateInterface::wouldTaintOrigin const):
742         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
743         (WebCore::CDMSessionAVContentKeySession::update):
744         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
745         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
746         (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
747         * platform/network/cocoa/WebCoreNSURLSession.h:
748         * platform/network/cocoa/WebCoreNSURLSession.mm:
749         (-[WebCoreNSURLSession task:didReceiveResponseFromOrigin:]):
750         (-[WebCoreNSURLSession wouldTaintOrigin:]):
751         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
752
753 2018-07-20  Zalan Bujtas  <zalan@apple.com>
754
755         Update FrameView::paintContents to use release logging.
756         https://bugs.webkit.org/show_bug.cgi?id=187854
757         <rdar://problem/42432371>
758
759         Reviewed by Simon Fraser.
760
761         Adding release logging helps identifying blank content cases. 
762
763         * page/FrameView.cpp:
764         (WebCore::FrameView::paintContents):
765
766 2018-07-20  Jer Noble  <jer.noble@apple.com>
767
768         First Auto-PiP from Fullscreen too small & animation blocks
769         https://bugs.webkit.org/show_bug.cgi?id=187745
770         <rdar://problem/42316583>
771
772         Reviewed by Jon Lee.
773
774         1) When Auto-PiPing, we don't have the luxury of setting up the fullscreen state
775         ahead of time; we get notified that PiP has already started. The area of the code
776         which does this just-in-time setup needs to set the video layer's frame so that the
777         transform within the PiP window is correct.
778
779         2) We generate a placeholder image when going into fullscreen, but we need to do
780         so synchronously. Create the AVPlayerItemVideoOutput up front at AVPlayerItem creation
781         time wherever AVPIVO is available.
782
783         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
784         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
785         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
786         (VideoFullscreenInterfaceAVKit::doSetup):
787
788 2018-07-20  Antoine Quint  <graouts@apple.com>
789
790         DeclarativeAnimation should suspend, resume, & stop m_eventQueue
791         https://bugs.webkit.org/show_bug.cgi?id=187216
792         <rdar://problem/41669739>
793
794         Reviewed by Ryosuke Niwa.
795
796         Suspend, resume and close the GenericEventQueue for DeclarativeAnimation as instructed through the DOMActiveObject protocol.
797
798         * animation/DeclarativeAnimation.cpp:
799         (WebCore::DeclarativeAnimation::stop):
800         (WebCore::DeclarativeAnimation::suspend):
801         (WebCore::DeclarativeAnimation::resume):
802         * animation/DeclarativeAnimation.h:
803         * animation/WebAnimation.h:
804
805 2018-07-20  Zalan Bujtas  <zalan@apple.com>
806
807         [LFC][Inline formatting context] Add basic text content handling.
808         https://bugs.webkit.org/show_bug.cgi?id=187860
809
810         Reviewed by Antti Koivisto.
811
812         InlineFormattingContext::layout() walks through the formatting root's descendant list in a post-order fashion and
813         feeds the TextContentProvider.
814         Eventually this would turn into a more generic loop where we stop and process the text content when finding a non-text content box (float, inline-box etc), but right now
815         this is about text content only.
816
817         * layout/displaytree/DisplayBox.h:
818         (WebCore::Display::Box::contentBoxBottom const):
819         (WebCore::Display::Box::contentBoxRight const):
820         * layout/inlineformatting/InlineFormattingContext.cpp:
821         (WebCore::Layout::InlineFormattingContext::layout const):
822         * layout/inlineformatting/textlayout/TextContentProvider.cpp:
823         (WebCore::Layout::TextContentProvider::textRuns): Add a helper function to support the case when all we need is just the run list in one go.
824         * layout/inlineformatting/textlayout/TextContentProvider.h:
825         * layout/layouttree/LayoutBox.cpp:
826         (WebCore::Layout::Box::isDescendantOf const):
827         * layout/layouttree/LayoutBox.h:
828         * layout/layouttree/LayoutInlineBox.h:
829         (WebCore::Layout::InlineBox::textContent const):
830
831 2018-07-20  Youenn Fablet  <youenn@apple.com>
832
833         FetchResponse should close its stream when loading finishes
834         https://bugs.webkit.org/show_bug.cgi?id=187790
835
836         Reviewed by Chris Dumez.
837
838         It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
839         Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
840         Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
841         This is consistent to errors sent back through callbacks.
842
843         Covered by existing tests.
844
845         * Modules/fetch/FetchBodyOwner.cpp:
846         (WebCore::FetchBodyOwner::~FetchBodyOwner):
847         * Modules/fetch/FetchBodyOwner.h:
848         * Modules/fetch/FetchBodySource.cpp:
849         (WebCore::FetchBodySource::FetchBodySource):
850         (WebCore::FetchBodySource::setActive):
851         (WebCore::FetchBodySource::setInactive):
852         (WebCore::FetchBodySource::doStart):
853         (WebCore::FetchBodySource::doPull):
854         (WebCore::FetchBodySource::doCancel):
855         (WebCore::FetchBodySource::cleanBodyOwner):
856         * Modules/fetch/FetchBodySource.h:
857         * Modules/fetch/FetchResponse.cpp:
858         (WebCore::FetchResponse::BodyLoader::didSucceed):
859         (WebCore::FetchResponse::BodyLoader::didFail):
860
861 2018-07-20  Jer Noble  <jer.noble@apple.com>
862
863         REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
864         https://bugs.webkit.org/show_bug.cgi?id=187814
865         <rdar://problem/42391869>
866
867         Reviewed by Eric Carlson.
868
869         After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
870         VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
871         assertion no longer holds true.
872
873         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
874         (-[WebAVPlayerLayer layoutSublayers]):
875         (-[WebAVPlayerLayer resolveBounds]):
876         (-[WebAVPlayerLayer setVideoGravity:]):
877
878 2018-07-19  Antoine Quint  <graouts@apple.com>
879
880         Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation
881         https://bugs.webkit.org/show_bug.cgi?id=187530
882         <rdar://problem/42095186>
883
884         Reviewed by Dean Jackson.
885
886         We would crash in cancelOrRemoveDeclarativeAnimation() because updateCSSAnimationsForElement() would pass
887         nullptr values due to the return value of cssAnimationsByName.take(nameOfAnimationToRemove). This is because
888         we would create animations for animation names that may be empty or not match an existing @keyframes rule.
889         Not only was that wasteful, but it was also non-compliant, and as a result of fixing this we're actually
890         seeing a progression in the CSS Animations WPT tests.
891
892         * animation/AnimationTimeline.cpp:
893         (WebCore::shouldConsiderAnimation): New function that performs all required steps to see if a provided animation
894         is valid and has a name that is not "none", not the empty string and matches the name of a @keyframes rule.
895         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
896         * animation/KeyframeEffectReadOnly.cpp:
897         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): We no longer need to check whether we have
898         an empty animation name since we're no longer creating CSSAnimation objects in that circumstance.
899         * css/StyleResolver.cpp:
900         (WebCore::StyleResolver::isAnimationNameValid): Add a new method that checks whether the provided animation name
901         a known @keyframes rule.
902         * css/StyleResolver.h:
903
904 2018-07-19  Chris Dumez  <cdumez@apple.com>
905
906         Crash under WebCore::DocumentWriter::addData()
907         https://bugs.webkit.org/show_bug.cgi?id=187819
908         <rdar://problem/41328743>
909
910         Reviewed by Brady Eidson.
911
912         When AppCache is used a DocumentLoader may start a NetworkLoad even though it has substitute data.
913         In DocumentLoader::continueAfterContentPolicy(), if we have substitute data we commit this data
914         and call finishLoad(). However, if the case where there was a NetworkLoad started, we'll send the
915         ContinueDidReceiveResponse IPC back to the network process and it will start sending us data for
916         the load. This could lead to crashes such as <rdar://problem/41328743> since the DocumentLoader
917         has already committed data and finished loading when it gets the data from the network process.
918
919         To address the issue, we now call clearMainResource() in continueAfterContentPolicy(), after we've
920         decided to commit the substitute data. This effectively removes the DocumentLoader as a client of
921         the CachedResource so that its will not be notified of following load progress. We do not cancel
922         the load as other CachedResourceClients may be interested in the load (ApplicationCacheResourceLoader
923         in particular, in order to update its cached data).
924
925         * loader/DocumentLoader.cpp:
926         (WebCore::DocumentLoader::continueAfterContentPolicy):
927
928 2018-07-19  Dean Jackson  <dino@apple.com>
929
930         CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: std::optional<WTF::Vector<WebCore::PluginInfo, 0ul, WTF::CrashOnOverflow, 16ul> >::operator* & + 73
931         https://bugs.webkit.org/show_bug.cgi?id=187820
932         <rdar://problem/42017759>
933
934         Reviewed by Antoine Quint.
935
936         Speculative fix for this crash, which is accessing an optional without checking
937         if it exists. The crash logs didn't point to a reproducible test case.
938
939         * plugins/PluginData.cpp:
940         (WebCore::PluginData::supportsWebVisibleMimeTypeForURL const): Return false if
941         the optional doesn't exist.
942
943 2018-07-19  Antoine Quint  <graouts@apple.com>
944
945         Ensure DocumentTimeline is kept alive until the VM::whenIdle callback is called
946         https://bugs.webkit.org/show_bug.cgi?id=187692
947
948         Reviewed by Ryosuke Niwa.
949
950         Ensure we keep the DocumentTimeline alive until the VM::whenIdle callback is called.
951
952         * animation/DocumentTimeline.cpp:
953         (WebCore::DocumentTimeline::currentTime):
954
955 2018-07-18  Simon Fraser  <simon.fraser@apple.com>
956
957         Setting foreground color when editing should take color-filter into account, and report the correct foreground color for collapsed selections
958         https://bugs.webkit.org/show_bug.cgi?id=187778
959
960         Reviewed by Ryosuke Niwa.
961         
962         Fix two aspects of editing with color-filter:
963
964         1. When setting foreground color, inverse-transform the color through -apple-color-filter so that the user gets the color
965            they chose when in Dark Mode. Tested by editing/style/exec-command-foreColor-with-color-filter.html.
966
967         2. When retrieving the style of the collapsed selection, take color filter into account so that color picker
968            reflects the color the users sees, instead of the content color. Tested by editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
969
970         Add two additional tests that ensure that -apple-color-filter does not impact the NSAttributedString code
971         path, since -apple-color-filter should not affect the behavior of Copy.
972
973         Tests: editing/mac/attributed-string/attrib-string-colors-with-color-filter.html
974                editing/mac/attributed-string/attrib-string-range-with-color-filter.html
975                editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
976                editing/style/exec-command-foreColor-with-color-filter.html
977
978         * editing/EditingStyle.cpp:
979         (WebCore::StyleChange::StyleChange):
980         (WebCore::StyleChange::extractTextStyles):
981         * editing/EditingStyle.h:
982         * editing/cocoa/EditorCocoa.mm:
983         (WebCore::Editor::fontAttributesForSelectionStart const):
984         * platform/graphics/filters/FilterOperation.cpp:
985         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
986         * platform/graphics/filters/FilterOperation.h:
987         (WebCore::FilterOperation::inverseTransformColor const):
988         * platform/graphics/filters/FilterOperations.cpp:
989         (WebCore::FilterOperations::transformColor const):
990         (WebCore::FilterOperations::inverseTransformColor const):
991         * platform/graphics/filters/FilterOperations.h:
992
993 2018-07-19  David Fenton  <david_fenton@apple.com>
994
995         Unreviewed, rolling out r233994.
996
997         Caused EWS and bot failures due to assertions added
998
999         Reverted changeset:
1000
1001         "FetchResponse should close its stream when loading finishes"
1002         https://bugs.webkit.org/show_bug.cgi?id=187790
1003         https://trac.webkit.org/changeset/233994
1004
1005 2018-07-19  Jer Noble  <jer.noble@apple.com>
1006
1007         REGRESSION(r233926): media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html is a TIMEOUT failure
1008         https://bugs.webkit.org/show_bug.cgi?id=187813
1009
1010         Reviewed by Jon Lee.
1011
1012         In r233926, we changed the behavior of entering PiP to exit fullscreen only after entering PiP completes. The
1013         test in question will immediately request "inline" presentation mode once the PiP animation begins, and thus
1014         it's asking to "exit fullscreen" when both in standard fullscreen and also in PiP. The fix is not to bail out
1015         early if we're in standard (element) fullscreen, but to allow the remaining steps to complete and exit PiP as
1016         well.
1017
1018         * html/HTMLMediaElement.cpp:
1019         (WebCore::HTMLMediaElement::exitFullscreen):
1020
1021 2018-07-19  Zalan Bujtas  <zalan@apple.com>
1022
1023         [LFC] Introduce simple line breaker.
1024         https://bugs.webkit.org/show_bug.cgi?id=187688
1025
1026         Reviewed by Antti Koivisto.
1027
1028         This patch takes the simple line layout implementation and refactors it in a way it is no longer requires a RenderBlockFlow object to run on.
1029         Also this patch decouples text run generation and line breaking (and this implementation is going to replace the current simple line layout codebase)
1030
1031         TextContentProvider: Acts both as the container for all the text content (including hard line breaks) and as an iterator for the generated text runs.
1032         SimpleTextRunGenerator: TextContentProvider uses it as the text run generator for simple content (in the future we'll have a ComplexTextRunGenerator).
1033         SimpleLineBreaker: Input -> text runs + line constraints; Output -> layout runs after line breaking.
1034
1035         * Sources.txt:
1036         * WebCore.xcodeproj/project.pbxproj:
1037         * layout/inlineformatting/textlayout/ContentProvider.cpp: Added.
1038         (WebCore::Layout::TextContentProvider::TextItem::Style::Style):
1039         (WebCore::Layout::TextContentProvider::ContentProvider):
1040         (WebCore::Layout::TextContentProvider::~ContentProvider):
1041         (WebCore::Layout::TextContentProvider::appendText):
1042         (WebCore::Layout::TextContentProvider::appendLineBreak):
1043         (WebCore::Layout::TextContentProvider::width const):
1044         (WebCore::Layout::TextContentProvider::textWidth const):
1045         (WebCore::Layout::TextContentProvider::fixedPitchWidth const):
1046         (WebCore::Layout::TextContentProvider::toTextItemIndex const):
1047         (WebCore::Layout::TextContentProvider::length const):
1048         (WebCore::Layout::TextContentProvider::iterator):
1049         (WebCore::Layout::TextContentProvider::findNextRun):
1050         (WebCore::Layout::TextContentProvider::current const):
1051         * layout/inlineformatting/textlayout/ContentProvider.h: Added.
1052         (WebCore::Layout::TextContentProvider::textContent const):
1053         (WebCore::Layout::TextContentProvider::hardLineBreaks const):
1054         (WebCore::Layout::TextContentProvider::Iterator::current const):
1055         (WebCore::Layout::TextContentProvider::contains const):
1056         (WebCore::Layout::TextContentProvider::Iterator::Iterator):
1057         (WebCore::Layout::TextContentProvider::Iterator::operator++):
1058         * layout/inlineformatting/textlayout/Runs.h: Added.
1059         (WebCore::Layout::TextRun::isWhitespace const):
1060         (WebCore::Layout::TextRun::isNonWhitespace const):
1061         (WebCore::Layout::TextRun::isLineBreak const):
1062         (WebCore::Layout::TextRun::isSoftLineBreak const):
1063         (WebCore::Layout::TextRun::isHardLineBreak const):
1064         (WebCore::Layout::TextRun::isValid const):
1065         (WebCore::Layout::TextRun::isCollapsed const):
1066         (WebCore::Layout::TextRun::type const):
1067         (WebCore::Layout::TextRun::setIsCollapsed):
1068         (WebCore::Layout::TextRun::setWidth):
1069         (WebCore::Layout::LayoutRun::start const):
1070         (WebCore::Layout::LayoutRun::end const):
1071         (WebCore::Layout::LayoutRun::length const):
1072         (WebCore::Layout::LayoutRun::left const):
1073         (WebCore::Layout::LayoutRun::right const):
1074         (WebCore::Layout::LayoutRun::width const):
1075         (WebCore::Layout::LayoutRun::isEndOfLine const):
1076         (WebCore::Layout::LayoutRun::setEnd):
1077         (WebCore::Layout::LayoutRun::setRight):
1078         (WebCore::Layout::LayoutRun::setIsEndOfLine):
1079         (WebCore::Layout::LayoutRun::LayoutRun):
1080         (WebCore::Layout::TextRun::createWhitespaceRun):
1081         (WebCore::Layout::TextRun::createNonWhitespaceRun):
1082         (WebCore::Layout::TextRun::createSoftLineBreakRun):
1083         (WebCore::Layout::TextRun::createHardLineBreakRun):
1084         (WebCore::Layout::TextRun::TextRun):
1085         (WebCore::Layout::TextRun::start const):
1086         (WebCore::Layout::TextRun::end const):
1087         (WebCore::Layout::TextRun::length const):
1088         (WebCore::Layout::TextRun::width const):
1089         * layout/inlineformatting/textlayout/simple/SimpleContentProvider.cpp: Added.
1090         (WebCore::Layout::SimpleContentProvider::SimpleContentProvider):
1091         (WebCore::Layout::SimpleContentProvider::current const):
1092         (WebCore::Layout::SimpleContentProvider::reset):
1093         (WebCore::Layout::SimpleContentProvider::findNextRun):
1094         (WebCore::Layout::SimpleContentProvider::moveToNextBreakablePosition):
1095         (WebCore::Layout::SimpleContentProvider::moveToNextNonWhitespacePosition):
1096         (WebCore::Layout::SimpleContentProvider::isAtLineBreak const):
1097         (WebCore::Layout::SimpleContentProvider::isAtSoftLineBreak const):
1098         * layout/inlineformatting/textlayout/simple/SimpleContentProvider.h: Added.
1099         (WebCore::Layout::SimpleContentProvider::Iterator::reset):
1100         (WebCore::Layout::SimpleContentProvider::Position::operator== const):
1101         (WebCore::Layout::SimpleContentProvider::Position::operator< const):
1102         (WebCore::Layout::SimpleContentProvider::Position::operator ContentPosition const):
1103         (WebCore::Layout::SimpleContentProvider::Position::resetItemPosition):
1104         (WebCore::Layout::SimpleContentProvider::Position::contentPosition const):
1105         (WebCore::Layout::SimpleContentProvider::Position::itemPosition const):
1106         (WebCore::Layout::SimpleContentProvider::Iterator<T>::Iterator):
1107         (WebCore::Layout::SimpleContentProvider::Iterator<T>::current const):
1108         (WebCore::Layout::SimpleContentProvider::Iterator<T>::operator):
1109         (WebCore::Layout::SimpleContentProvider::Position::operator++):
1110         (WebCore::Layout::SimpleContentProvider::Position::operator+=):
1111         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Added.
1112         (WebCore::Layout::SimpleLineBreaker::TextRunList::TextRunList):
1113         (WebCore::Layout::SimpleLineBreaker::Line::Line):
1114         (WebCore::Layout::adjustedEndPosition):
1115         (WebCore::Layout::SimpleLineBreaker::Line::append):
1116         (WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
1117         (WebCore::Layout::SimpleLineBreaker::Line::reset):
1118         (WebCore::Layout::SimpleLineBreaker::Style::Style):
1119         (WebCore::Layout::SimpleLineBreaker::SimpleLineBreaker):
1120         (WebCore::Layout::SimpleLineBreaker::runs):
1121         (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
1122         (WebCore::Layout::SimpleLineBreaker::handleOverflownRun):
1123         (WebCore::Layout::SimpleLineBreaker::collapseLeadingWhitespace):
1124         (WebCore::Layout::SimpleLineBreaker::collapseTrailingWhitespace):
1125         (WebCore::Layout::SimpleLineBreaker::splitTextRun):
1126         (WebCore::Layout::SimpleLineBreaker::split const):
1127         (WebCore::Layout::SimpleLineBreaker::availableWidth const):
1128         (WebCore::Layout::SimpleLineBreaker::verticalPosition const):
1129         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Added.
1130         (WebCore::Layout::SimpleLineBreaker::TextRunList::overrideCurrent):
1131         (WebCore::Layout::SimpleLineBreaker::TextRunList::isCurrentOverridden const):
1132         (WebCore::Layout::SimpleLineBreaker::Line::availableWidth const):
1133         (WebCore::Layout::SimpleLineBreaker::Line::hasContent const):
1134         (WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
1135         (WebCore::Layout::SimpleLineBreaker::Line::hasTrailingWhitespace const):
1136         (WebCore::Layout::SimpleLineBreaker::Line::isWhitespaceOnly const):
1137         (WebCore::Layout::SimpleLineBreaker::wrapContentOnOverflow const):
1138         (WebCore::Layout::SimpleLineBreaker::TextRunList::current const):
1139         (WebCore::Layout::SimpleLineBreaker::TextRunList::operator++):
1140
1141 2018-07-19  Keith Rollin  <krollin@apple.com>
1142
1143         Remove duplicate compilation of WebKitNSImageExtras.mm
1144         https://bugs.webkit.org/show_bug.cgi?id=187782
1145
1146         Reviewed by Alex Christensen.
1147
1148         WebKitNSImageExtras.mm gets compiled twice, once because it's in
1149         WebCore.xcodeproj/project.pbxproj and once because it's in
1150         Webcore/SourcesCocoa.txt. This can lead to duplicate definition
1151         errors, particularly when building with LTO enabled. Fix this by
1152         removing the entry from the Xcode project.
1153
1154         No new tests -- no change in WebKit functionality.
1155
1156         * WebCore.xcodeproj/project.pbxproj:
1157
1158 2018-07-19  Youenn Fablet  <youenn@apple.com>
1159
1160         FetchResponse should close its stream when loading finishes
1161         https://bugs.webkit.org/show_bug.cgi?id=187790
1162
1163         Reviewed by Chris Dumez.
1164
1165         It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
1166         Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
1167         Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
1168         This is consistent to errors sent back through callbacks.
1169
1170         Covered by existing tests.
1171
1172         * Modules/fetch/FetchBodyOwner.cpp:
1173         (WebCore::FetchBodyOwner::~FetchBodyOwner):
1174         * Modules/fetch/FetchBodyOwner.h:
1175         * Modules/fetch/FetchBodySource.cpp:
1176         (WebCore::FetchBodySource::FetchBodySource):
1177         (WebCore::FetchBodySource::setActive):
1178         (WebCore::FetchBodySource::setInactive):
1179         (WebCore::FetchBodySource::doStart):
1180         (WebCore::FetchBodySource::doPull):
1181         (WebCore::FetchBodySource::doCancel):
1182         (WebCore::FetchBodySource::cleanBodyOwner):
1183         * Modules/fetch/FetchBodySource.h:
1184         * Modules/fetch/FetchResponse.cpp:
1185         (WebCore::FetchResponse::BodyLoader::didSucceed):
1186         (WebCore::FetchResponse::BodyLoader::didFail):
1187
1188 2018-07-19  Jon Lee  <jonlee@apple.com>
1189
1190         Update iOS fullscreen alert text again
1191         https://bugs.webkit.org/show_bug.cgi?id=187797
1192         rdar://problem/42373783
1193
1194         Reviewed by Jer Noble.
1195
1196         * English.lproj/Localizable.strings:
1197
1198 2018-07-19  Keith Rollin  <krollin@apple.com>
1199
1200         Adjust WEBCORE_EXPORT annotations for LTO
1201         https://bugs.webkit.org/show_bug.cgi?id=187781
1202         <rdar://problem/42351124>
1203
1204         Reviewed by Alex Christensen.
1205
1206         Continuation of Bug 186944. This bug addresses issues not caught
1207         during the first pass of adjustments. The initial work focussed on
1208         macOS; this one addresses issues found when building for iOS. From
1209         186944:
1210
1211         Adjust a number of places that result in WebKit's
1212         'check-for-weak-vtables-and-externals' script reporting weak external
1213         symbols:
1214
1215             ERROR: WebCore has a weak external symbol in it (/Volumes/Data/dev/webkit/OpenSource/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore)
1216             ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
1217             ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
1218             ...
1219
1220         These cases are caused by inline methods being marked with WTF_EXPORT
1221         (or related macro) or with an inline function being in a class marked
1222         as such, and when enabling LTO builds.
1223
1224         For the most part, address these by removing the WEBCORE_EXPORT
1225         annotation from inline methods. In some cases, move the implementation
1226         out-of-line because it's the class that has the WEBCORE_EXPORT on it
1227         and removing the annotation from the class would be too disruptive.
1228         Finally, in other cases, move the implementation out-of-line because
1229         check-for-weak-vtables-and-externals still complains when keeping the
1230         implementation inline and removing the annotation; this seems to
1231         typically (but not always) happen with destructors.
1232
1233         No new tests. There is no changed functionality. Only the annotation
1234         and treatment of inline methods are altered.
1235
1236         * platform/graphics/FourCC.h:
1237         (WebCore::FourCC::FourCC):
1238         * platform/graphics/IntPoint.h:
1239         (WebCore::IntPoint::IntPoint):
1240         * platform/mediastream/RealtimeMediaSource.cpp:
1241         (WebCore::RealtimeMediaSource::Observer::~Observer):
1242         (WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory):
1243         (WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory):
1244         * platform/mediastream/RealtimeMediaSource.h:
1245         * workers/service/ServiceWorkerProvider.cpp:
1246         (WebCore::ServiceWorkerProvider::~ServiceWorkerProvider):
1247         * workers/service/ServiceWorkerProvider.h:
1248
1249 2018-07-19  Charlie Turner  <cturner@igalia.com>
1250
1251         [GStreamer] Return a valid time values in unprerolled states
1252         https://bugs.webkit.org/show_bug.cgi?id=187111
1253
1254         Reviewed by Xabier Rodriguez-Calvar.
1255
1256         After r230584 in bug 180253, asserts were added in
1257         PlatformTimeRanges::add to check that both ends of the range were
1258         valid times. In the non-MSE GStreamer player, this assert was
1259         firing on https://www.w3.org/2010/05/video/mediaevents.html due to
1260         seekable being called in nonprerolled states. In this case
1261         MediaPlayerPrivateInterface::seekable was calling GStreamer's
1262         maxTimeSeekable, which calls in durationMediaTime. The guard
1263         against calling gst_element_query_duration when not prerolled was
1264         returning a different time value than when the duration query
1265         itself failed. Hence the assert firing.
1266
1267         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1268         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
1269
1270 2018-07-19  Antoine Quint  <graouts@apple.com>
1271
1272         Hitting RELEASE_ASSERT(!m_activeDOMObjectAdditionForbidden) under HTMLMediaElement::resume()
1273         https://bugs.webkit.org/show_bug.cgi?id=187793
1274         <rdar://problem/42308469>
1275
1276         Reviewed by Chris Dumez.
1277
1278         Ensure we do not call JS under resume(), which would happen as a result of calling configureMediaControls() in prepareForLoad().
1279
1280         * html/HTMLMediaElement.cpp:
1281         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1282         (WebCore::HTMLMediaElement::contextDestroyed):
1283         (WebCore::HTMLMediaElement::stop):
1284         (WebCore::HTMLMediaElement::suspend):
1285         (WebCore::HTMLMediaElement::resume):
1286         * html/HTMLMediaElement.h:
1287
1288 2018-07-19  Philippe Normand  <pnormand@igalia.com>
1289
1290         [GStreamer][MSE] imported/w3c/web-platform-tests/media-source/mediasource-is-type-supported.html crashes
1291         https://bugs.webkit.org/show_bug.cgi?id=187469
1292
1293         Reviewed by Žan Doberšek.
1294
1295         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1296         (webKitMediaSrcFreeStream): Fix critical warning. The appsrc
1297         element is created only when a valid sourcebuffer is in use.
1298
1299 2018-07-19  Frederic Wang  <fwang@igalia.com>
1300
1301         Fix message of NotSupportedError exception thrown during custom element creation
1302         https://bugs.webkit.org/show_bug.cgi?id=187757
1303
1304         Reviewed by Yusuke Suzuki.
1305
1306         In bug 161528, some new exceptions were introduced for custom element creation [1] but the
1307         actual text has some issues. This patch fixes one typo and one wrong message.
1308
1309         [1] https://dom.spec.whatwg.org/#concept-create-element
1310
1311         Test: fast/custom-elements/exceptions-for-synchronous-custom-element-creation.html
1312
1313         * bindings/js/JSCustomElementInterface.cpp:
1314         (WebCore::constructCustomElementSynchronously):
1315
1316 2018-07-18  Jer Noble  <jer.noble@apple.com>
1317
1318         Unreviewed API Test fix; restored a line inadventantly removed in r233926.
1319
1320         * platform/mac/VideoFullscreenInterfaceMac.mm:
1321         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
1322
1323 2018-07-18  Antoine Quint  <graouts@apple.com>
1324
1325         [Web Animations] Interpolation between font-styles with a keyword value should be discrete
1326         https://bugs.webkit.org/show_bug.cgi?id=187722
1327
1328         Reviewed by Myles Maxfield.
1329
1330         Animating between "font-style: normal" or "font-style: oblique" and any another value should yield a discrete
1331         interpolation where the from-value is used from 0 and up to (but excluding) 0.5, and the to-value from 0.5 to 1.
1332
1333         In order to be able to detect the "normal" value, we make the "slope" of a FontSelectionRequest an optional type
1334         where the std::nullopt value indicates "normal" and other values an "oblique" value. Since we also need to
1335         distinguish the "italic" value from an "oblique" value, we implement a custom PropertyWrapper for the "font-style"
1336         property where we ensure the fontStyleAxis property of the font description matches the value we're blending to.
1337         Indeed, in the case where we may animate from "normal" to "italic", the fontStyleAxis on the blended style would
1338         remain "slnt" since it is the base value for "normal".
1339
1340         * accessibility/AccessibilityRenderObject.cpp:
1341         (WebCore::AccessibilityRenderObject::hasPlainText const):
1342         * css/CSSComputedStyleDeclaration.cpp:
1343         (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
1344         * css/CSSComputedStyleDeclaration.h:
1345         * css/CSSFontFace.cpp:
1346         (WebCore::calculateItalicRange):
1347         * css/CSSFontFaceSet.cpp:
1348         (WebCore::computeFontSelectionRequest):
1349         * css/FontSelectionValueInlines.h:
1350         (WebCore::fontStyleKeyword):
1351         (WebCore::fontStyleValue): Deleted.
1352         * css/StyleBuilderConverter.h:
1353         (WebCore::StyleBuilderConverter::convertFontStyleFromValue):
1354         * page/animation/CSSPropertyAnimation.cpp:
1355         (WebCore::blendFunc):
1356         (WebCore::PropertyWrapperFontStyle::PropertyWrapperFontStyle):
1357         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1358         * platform/graphics/FontCache.h:
1359         (WebCore::FontDescriptionKey::computeHash const):
1360         * platform/graphics/FontCascade.h:
1361         (WebCore::FontCascade::italic const):
1362         * platform/graphics/FontDescription.h:
1363         (WebCore::FontDescription::italic const):
1364         (WebCore::FontDescription::setItalic):
1365         (WebCore::FontDescription::setIsItalic):
1366         (WebCore::FontCascadeDescription::initialItalic):
1367         * platform/graphics/FontSelectionAlgorithm.cpp:
1368         (WebCore::FontSelectionAlgorithm::styleDistance const):
1369         * platform/graphics/FontSelectionAlgorithm.h:
1370         (WebCore::isItalic):
1371         (WebCore::FontSelectionRequest::tied const):
1372         (WebCore::operator<<): Implement the required stream operator.
1373         (WebCore::operator==): Mark this function as inline instead of constexpr since tied() is no longer constexpr
1374         due to taking an std::optional<>.
1375         (WebCore::operator!=):
1376         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1377         (WebCore::preparePlatformFont):
1378         * platform/graphics/win/FontCacheWin.cpp:
1379         (WebCore::FontCache::createFontPlatformData):
1380         * rendering/style/RenderStyle.cpp:
1381         (WebCore::RenderStyle::setFontItalic):
1382         * rendering/style/RenderStyle.h:
1383         (WebCore::RenderStyle::fontItalic const):
1384
1385 2018-07-18  Jer Noble  <jer.noble@apple.com>
1386
1387         Unreviewed build fix after r233926; BOOL !== bool.
1388
1389         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1390         (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
1391
1392 2018-07-18  Jer Noble  <jer.noble@apple.com>
1393
1394         PiP from Element Fullscreen should match AVKit's behavior
1395         https://bugs.webkit.org/show_bug.cgi?id=187623
1396
1397         Reviewed by Jon Lee.
1398
1399         PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:
1400
1401         * html/HTMLMediaElement.cpp:
1402         (WebCore::HTMLMediaElement::enterFullscreen):
1403
1404         Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():
1405
1406         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1407         (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
1408
1409         Add VideoFullscreenModelClient virutal methods for PiP change notifications:
1410
1411         * platform/cocoa/VideoFullscreenModel.h:
1412         (WebCore::VideoFullscreenModelClient::hasVideoChanged):
1413         (WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
1414         (WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
1415         (WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
1416         (WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
1417         (WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
1418         (WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
1419         (WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
1420         * platform/cocoa/VideoFullscreenModelVideoElement.h:
1421         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1422         (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
1423         (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
1424         (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
1425         (VideoFullscreenModelVideoElement::willExitPictureInPicture):
1426         (VideoFullscreenModelVideoElement::didExitPictureInPicture):
1427         (VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
1428         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1429         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1430         (-[WebAVPlayerLayer layoutSublayers]):
1431         (-[WebAVPlayerLayer resolveBounds]):
1432         (-[WebAVPlayerLayer setVideoGravity:]):
1433         (VideoFullscreenInterfaceAVKit::setupFullscreen):
1434         (VideoFullscreenInterfaceAVKit::presentingViewController):
1435         (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
1436         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1437         (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
1438         (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
1439         (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
1440         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1441         (VideoFullscreenInterfaceAVKit::doSetup):
1442         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1443         (VideoFullscreenControllerContext::willEnterPictureInPicture):
1444         (VideoFullscreenControllerContext::didEnterPictureInPicture):
1445         (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
1446         (VideoFullscreenControllerContext::willExitPictureInPicture):
1447         (VideoFullscreenControllerContext::didExitPictureInPicture):
1448         (VideoFullscreenControllerContext::failedToExitPictureInPicture):
1449         * platform/mac/VideoFullscreenInterfaceMac.h:
1450         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
1451         * platform/mac/VideoFullscreenInterfaceMac.mm:
1452         (-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
1453         (-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
1454         (-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
1455         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
1456         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
1457         (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
1458         (WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
1459         (WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
1460         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
1461
1462 2018-07-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1463
1464         [Curl] Disable CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST specified by setAllowsAnyHTTPSCertificate.
1465         https://bugs.webkit.org/show_bug.cgi?id=187611
1466
1467         Reviewed by Fujii Hironori.
1468
1469         Current interface for TLS certificate validation for Curl port are as follows:
1470
1471         - WEBCORE_EXPORT void setHostAllowsAnyHTTPSCertificate(const String&);
1472         - bool isAllowedHTTPSCertificateHost(const String&);
1473         - bool canIgnoredHTTPSCertificate(const String&, const Vector<CertificateInfo::Certificate>&);
1474
1475         First one registers a host to be ignored for any certificate check. Once it is registered, no
1476         further certificate validation check is executed.
1477         Second one checks the host is registered in the list above.
1478         Third one is weird. The method signature implies it checks the certificate for the host and detect
1479         whether we can ignore this certificate for the host, but actually it  just check only the host and
1480         register the certificate into the vector. Then in the next request for the host, the certificate
1481         will be checked with the previously stored certificate.
1482
1483         It's hard to understand, but in short,
1484         - We can register a host as an exception for any TLS certificate validation.
1485         - But only certificate arrived first is ignored, not any certificates for the host
1486           (which is rare, but possible for mis configured web cluster).
1487
1488         This behavior is incomplete. To ignore any certificates of the host, these two methods are enough:
1489
1490         - void allowAnyHTTPSCertificatesForHost(const String&)
1491         - bool canIgnoreAnyHTTPSCertificatesForHost(const String&)
1492
1493         No new tests. Covered by existing tests.
1494
1495         * platform/network/curl/CertificateInfo.h:
1496         * platform/network/curl/CurlContext.cpp:
1497         (WebCore::CurlHandle::enableSSLForHost): Ignore TLS verification for registered host.
1498         * platform/network/curl/CurlSSLHandle.cpp:
1499         (WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): Added.
1500         (WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): Ditto.
1501         (WebCore::CurlSSLHandle::setClientCertificateInfo): Separate lock.
1502         (WebCore::CurlSSLHandle::getSSLClientCertificate const): Ditto and add const.
1503         (WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate): Deleted.
1504         (WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost): Deleted.
1505         (WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate): Deleted.
1506         (WebCore::CurlSSLHandle::getSSLClientCertificate): Deleted.
1507         * platform/network/curl/CurlSSLHandle.h:
1508         * platform/network/curl/CurlSSLVerifier.cpp:
1509         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
1510         (WebCore::CurlSSLVerifier::collectInfo): Renamed from verify.
1511         (WebCore::CurlSSLVerifier::verifyCallback):
1512         (WebCore::CurlSSLVerifier::verify): Renamed to collectInfo.
1513         * platform/network/curl/CurlSSLVerifier.h:
1514         * platform/network/curl/ResourceHandleCurl.cpp:
1515         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Rename calling method.
1516
1517 2018-07-18  Myles C. Maxfield  <mmaxfield@apple.com>
1518
1519         Rename WordBreak::Break to WordBreak::BreakWord
1520         https://bugs.webkit.org/show_bug.cgi?id=187767
1521
1522         Reviewed by Simon Fraser.
1523
1524         These breaking properties are very confusing. There are:
1525
1526         1. word-break: break-all, a standard value that allows breaking after every
1527         character.
1528         2. word-break: break-word, a non-standard value which allows for breaking after
1529         every character, but only if the word is too long for the available width (otherwise
1530         it works the same as word-break: normal). This affects the min-content-size of the
1531         text (and makes it equal to what it would be if word-break: break-all was
1532         specified).
1533         3. word-wrap: break-word, which is the same as word-break: break-word, but doesn't
1534         affect the min-content-size of the text.
1535         4. overflow-wrap: break-word, which is the same as word-wrap: break-word.
1536
1537         Because this is so confusing it's valuable for our internal enums to match the names
1538         of the official CSS properties/values.
1539
1540         No new tests because there is no behavior change.
1541
1542         * css/CSSPrimitiveValueMappings.h:
1543         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1544         (WebCore::CSSPrimitiveValue::operator WordBreak const):
1545         * rendering/RenderText.cpp:
1546         (WebCore::RenderText::computePreferredLogicalWidths):
1547         * rendering/style/RenderStyle.h:
1548         (WebCore::RenderStyle::breakWords const):
1549         * rendering/style/RenderStyleConstants.h:
1550
1551 2018-07-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1552
1553         Add SPI to defer running async script until after document load
1554         https://bugs.webkit.org/show_bug.cgi?id=187748
1555         <rdar://problem/42317378>
1556
1557         Reviewed by Ryosuke Niwa and Tim Horton.
1558
1559         On watchOS, we currently observe that time-consuming async scripts can block the first paint of Reader, leaving
1560         the user with a blank screen for tens of seconds. One way to mitigate this is to defer async script execution
1561         until after document load (i.e. the same timing as DOMContentLoaded).
1562
1563         This patch introduces an SPI configuration allowing internal clients to defer execution of asynchronous script
1564         until after document load; this, in combination with the parser yielding token introduced in r233891, allows
1565         Safari on watchOS to avoid being blocked on slow script execution before the first paint of the Reader page on
1566         most article-like pages. See below for more details.
1567
1568         Test: RunScriptAfterDocumentLoad.ExecutionOrderOfScriptsInDocument
1569
1570         * dom/Document.cpp:
1571         (WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
1572         (WebCore::Document::finishedParsing):
1573
1574         Notify ScriptRunner when the Document has finished parsing, and is about to fire DOMContentLoaded.
1575
1576         * dom/Document.h:
1577         * dom/ScriptRunner.cpp:
1578         (WebCore::ScriptRunner::documentFinishedParsing):
1579
1580         When the document is finished parsing, kick off the script execution timer if needed to run any async script
1581         that has been deferred.
1582
1583         (WebCore::ScriptRunner::notifyFinished):
1584         (WebCore::ScriptRunner::timerFired):
1585
1586         Instead of always taking from the list of async scripts to execute, check our document to see whether we should
1587         defer this until after document load. If so, ignore `m_scriptsToExecuteSoon`.
1588
1589         * dom/ScriptRunner.h:
1590         * page/Settings.yaml:
1591
1592         Add a WebCore setting for this behavior.
1593
1594 2018-07-18  Zan Dobersek  <zdobersek@igalia.com>
1595
1596         [Nicosia] Add debug border, repaint counter state tracking to Nicosia::CompositionLayer
1597         https://bugs.webkit.org/show_bug.cgi?id=187749
1598
1599         Reviewed by Carlos Garcia Campos.
1600
1601         Add the RepaintCounter and DebugBorder structs to
1602         Nicosia::CompositionLayer::LayerState, tracking visibility as well as
1603         repaint count or debug color and width.
1604
1605         Instances of RepaintCounter and DebugBorder types are kept in each
1606         CoordinatedGraphicsLayer object, updating the relevant data as it is
1607         changed (since the GraphicsLayer object isn't tracking these values on
1608         its own). During layer flush these values (if changed) are then copied
1609         over into the CompositionLayer state.
1610
1611         * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
1612         Also fix the year in the license header.
1613         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
1614         Also fix the year in the license header.
1615         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1616         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
1617         (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
1618         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
1619         (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
1620         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
1621         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1622
1623 2018-07-18  Zan Dobersek  <zdobersek@igalia.com>
1624
1625         [CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
1626         https://bugs.webkit.org/show_bug.cgi?id=187751
1627
1628         Reviewed by Carlos Garcia Campos.
1629
1630         Start including the Nicosia::CompositionLayer objects in the
1631         CoordinatedGraphicsState struct, under a separate NicosiaState struct.
1632         References to all the layers in a given scene are kept in a HashSet,
1633         and a separate reference to the root layer kept in a separate member
1634         variable.
1635
1636         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1637         (WebCore::CoordinatedGraphicsLayer::compositionLayer const):
1638         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1639         Add the getter method that returns internal Nicosia::CompositionLayer
1640         object. This can't be defined in the class definition because of
1641         WEBCORE_EXPORT used on the CoordinatedGraphicsLayer class.
1642         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1643
1644 2018-07-18  Simon Fraser  <simon.fraser@apple.com>
1645
1646         Shrink CompositeAnimation and AnimationBase
1647         https://bugs.webkit.org/show_bug.cgi?id=187683
1648
1649         Reviewed by Daniel Bates.
1650
1651         Reduce the size of CompositeAnimation and AnimationBase.
1652
1653         * page/animation/AnimationBase.h:
1654         * page/animation/CompositeAnimation.h:
1655
1656 2018-07-17  Antoine Quint  <graouts@apple.com>
1657
1658         Ensure timingFunctionForKeyframeAtIndex() can be used from setAnimatedPropertiesInStyle().
1659         https://bugs.webkit.org/show_bug.cgi?id=187637
1660         <rdar://problem/42157915>
1661
1662         Reviewed by Dean Jackson.
1663
1664         Test: webanimations/empty-keyframes-crash.html
1665
1666         Unlike what we assumed, it is possible to have a non-declarative animation without any parsed keyframes.
1667         This can happen as a result of calling `Element.animate({}, …)`. In this case, we want to return a null
1668         value in timingFunctionForKeyframeAtIndex() so we update the call site in setAnimatedPropertiesInStyle()
1669         which is the only place where we didn't check for a null value and didn't know for sure that there would
1670         be parsed keyframes to rely on in the case of a WebAnimation instance.
1671
1672         * animation/KeyframeEffectReadOnly.cpp:
1673         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
1674         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
1675
1676 2018-07-15  Jiewen Tan  <jiewen_tan@apple.com>
1677
1678         [WebCrypto] Crypto operations should copy their parameters before hoping to another thread
1679         https://bugs.webkit.org/show_bug.cgi?id=187501
1680         <rdar://problem/41438160>
1681
1682         Reviewed by Youenn Fablet.
1683
1684         This patch aims at making all captured variables in all crypto lambdas that need to be passed
1685         to a worker thread thread safe, which includes:
1686         1) changing ref counted objects to thread safe ref counted object.
1687         2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
1688
1689         In addition to above changes, this patch also does the following things:
1690         1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
1691         to make it clear that lambdas will be passed to a secondary thread.
1692         2) make CryptoAlgorithmParameters as const parameters for all methods.
1693         3) add null checks on BufferSource.length() and .data().
1694
1695         Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
1696                http/wpt/crypto/aes-cbc-crash.any.html
1697                http/wpt/crypto/aes-cbc-crash.any.worker.html
1698                http/wpt/crypto/aes-ctr-crash.any.html
1699                http/wpt/crypto/aes-ctr-crash.any.worker.html
1700                http/wpt/crypto/aes-gcm-crash.any.html
1701                http/wpt/crypto/aes-gcm-crash.any.worker.html
1702                http/wpt/crypto/derive-hmac-key-crash.any.html
1703                http/wpt/crypto/derive-hmac-key-crash.any.worker.html
1704                http/wpt/crypto/ecdsa-crash.any.html
1705                http/wpt/crypto/ecdsa-crash.any.worker.html
1706                http/wpt/crypto/hkdf-crash.any.html
1707                http/wpt/crypto/hkdf-crash.any.worker.html
1708                http/wpt/crypto/pbkdf2-crash.any.html
1709                http/wpt/crypto/pbkdf2-crash.any.worker.html
1710                http/wpt/crypto/rsa-oaep-crash.any.html
1711                http/wpt/crypto/rsa-oaep-crash.any.worker.html
1712                http/wpt/crypto/rsa-pss-crash.any.html
1713                http/wpt/crypto/rsa-pss-crash.any.worker.html
1714                http/wpt/crypto/unwrap-ec-key-crash.any.html
1715                http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
1716                http/wpt/crypto/unwrap-rsa-key-crash.any.html
1717                http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
1718
1719         * bindings/js/BufferSource.h:
1720         (WebCore::BufferSource::data const):
1721         (WebCore::BufferSource::length const):
1722         * crypto/CryptoAlgorithm.cpp:
1723         (WebCore::CryptoAlgorithm::encrypt):
1724         (WebCore::CryptoAlgorithm::decrypt):
1725         (WebCore::CryptoAlgorithm::sign):
1726         (WebCore::CryptoAlgorithm::verify):
1727         (WebCore::CryptoAlgorithm::deriveBits):
1728         (WebCore::CryptoAlgorithm::importKey):
1729         (WebCore::dispatchAlgorithmOperation):
1730         (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
1731         (WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
1732         * crypto/CryptoAlgorithm.h:
1733         * crypto/SubtleCrypto.cpp:
1734         (WebCore::crossThreadCopyImportParams):
1735         (WebCore::SubtleCrypto::encrypt):
1736         (WebCore::SubtleCrypto::decrypt):
1737         (WebCore::SubtleCrypto::sign):
1738         (WebCore::SubtleCrypto::verify):
1739         (WebCore::SubtleCrypto::deriveKey):
1740         (WebCore::SubtleCrypto::deriveBits):
1741         (WebCore::SubtleCrypto::importKey):
1742         (WebCore::SubtleCrypto::wrapKey):
1743         (WebCore::SubtleCrypto::unwrapKey):
1744         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1745         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
1746         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
1747         (WebCore::CryptoAlgorithmAES_CBC::importKey):
1748         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
1749         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
1750         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
1751         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
1752         (WebCore::CryptoAlgorithmAES_CFB::importKey):
1753         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
1754         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
1755         (WebCore::parametersAreValid):
1756         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
1757         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
1758         (WebCore::CryptoAlgorithmAES_CTR::importKey):
1759         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
1760         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
1761         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
1762         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
1763         (WebCore::CryptoAlgorithmAES_GCM::importKey):
1764         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
1765         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1766         (WebCore::CryptoAlgorithmAES_KW::importKey):
1767         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
1768         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
1769         (WebCore::CryptoAlgorithmECDH::deriveBits):
1770         (WebCore::CryptoAlgorithmECDH::importKey):
1771         * crypto/algorithms/CryptoAlgorithmECDH.h:
1772         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
1773         (WebCore::CryptoAlgorithmECDSA::sign):
1774         (WebCore::CryptoAlgorithmECDSA::verify):
1775         (WebCore::CryptoAlgorithmECDSA::importKey):
1776         * crypto/algorithms/CryptoAlgorithmECDSA.h:
1777         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
1778         (WebCore::CryptoAlgorithmHKDF::deriveBits):
1779         (WebCore::CryptoAlgorithmHKDF::importKey):
1780         * crypto/algorithms/CryptoAlgorithmHKDF.h:
1781         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1782         (WebCore::CryptoAlgorithmHMAC::sign):
1783         (WebCore::CryptoAlgorithmHMAC::verify):
1784         (WebCore::CryptoAlgorithmHMAC::importKey):
1785         * crypto/algorithms/CryptoAlgorithmHMAC.h:
1786         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
1787         (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
1788         (WebCore::CryptoAlgorithmPBKDF2::importKey):
1789         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
1790         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1791         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
1792         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
1793         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1794         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
1795         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1796         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
1797         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
1798         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1799         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
1800         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1801         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
1802         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
1803         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1804         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
1805         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
1806         (WebCore::CryptoAlgorithmRSA_PSS::sign):
1807         (WebCore::CryptoAlgorithmRSA_PSS::verify):
1808         (WebCore::CryptoAlgorithmRSA_PSS::importKey):
1809         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
1810         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
1811         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
1812         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
1813         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
1814         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
1815         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
1816         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
1817         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
1818         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
1819         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
1820         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1821         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1822         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
1823         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
1824         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
1825         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
1826         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
1827         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
1828         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
1829         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
1830         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
1831         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
1832         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
1833         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
1834         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
1835         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
1836         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
1837         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
1838         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
1839         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
1840         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
1841         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1842         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1843         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1844         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
1845         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
1846         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
1847         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
1848         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
1849         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
1850         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
1851         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
1852         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
1853         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
1854         * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
1855         * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
1856         * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
1857         * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
1858         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
1859         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
1860         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
1861         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
1862         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
1863         * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
1864         * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
1865
1866 2018-07-17  Antoine Quint  <graouts@apple.com>
1867
1868         [Web Animations] Interpolation between lengths with an "auto" value should be discrete
1869         https://bugs.webkit.org/show_bug.cgi?id=187721
1870
1871         Reviewed by Dean Jackson.
1872
1873         When interpolating between two Length values, if one is "auto", we should use the from-value
1874         from 0 and up to (but excluding) 0.5, and use the to-value from 0.5 to 1.
1875
1876         This change caused a regression in the legacy animation engine since it would create a CSS
1877         transition even when the underlying and target values were non-interpolable. As such, the
1878         underlying value would be used until the transition's mid-point and the tests at 
1879         legacy-animation-engine/imported/blink/transitions/transition-not-interpolable.html and
1880         legacy-animation-engine/fast/animation/height-auto-transition-computed-value.html would fail
1881         expecting the target value to be used immediately. We now ensure that no transition is actually
1882         started if two values for a given property cannot be interpolated.
1883
1884         * page/animation/CompositeAnimation.cpp:
1885         (WebCore::CompositeAnimation::updateTransitions):
1886         * platform/Length.cpp:
1887         (WebCore::blend):
1888
1889 2018-07-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1890
1891         Add an SPI hook to allow clients to yield document parsing and script execution
1892         https://bugs.webkit.org/show_bug.cgi?id=187682
1893         <rdar://problem/42207453>
1894
1895         Reviewed by Ryosuke Niwa.
1896
1897         Using a single web process for both the Reader page and original web page on watchOS has multiple benefits,
1898         including: (1) allowing the user to bail out of Reader and view the original web page without having to load it
1899         again, and (2) improving the bringup time of the Reader page, since subresources are already cached in process
1900         and we don't eat the additional cost of a web process launch if prewarming fails.
1901
1902         However, this has some drawbacks as well, one of which is that main thread work being done on behalf of the
1903         original page may contend with work being done to load and render the Reader page. This is especially bad when
1904         the page is in the middle of executing heavy script after Safari has already detected that the Reader version of
1905         the page is available, but before it has finished loading the Reader page. The result is that script on the
1906         original page may block the first paint of the Reader page (on New York Times articles, this often leads to an
1907         apparent page load time of 25-35 seconds before the user sees anything besides a blank screen).
1908
1909         To mitigate this, we introduce a way for injected bundle clients to yield parsing and async script execution on
1910         a document. This capability is surfaced in the form of an opaque token which clients may request from a
1911         WKDOMDocument. Construction of the token causes the document to begin yielding and defer execution of previously
1912         scheduled scripts, only if there were no active tokens on the document already. Similarly, destruction of all
1913         active tokens on the document causes it to stop yielding and resume execution of scripts if needed.
1914
1915         Tests:  ParserYieldTokenTests.PreventDocumentLoadByTakingParserYieldToken
1916                 ParserYieldTokenTests.TakeMultipleParserYieldTokens
1917                 ParserYieldTokenTests.DeferredScriptExecutesBeforeDocumentLoadWhenTakingParserYieldToken
1918                 ParserYieldTokenTests.AsyncScriptRunsWhenFetched
1919
1920         * dom/Document.cpp:
1921         (WebCore::Document::implicitOpen):
1922
1923         If the parser yield token was taken before the document's parser was created, tell the parser's scheduler to
1924         start yielding immediately after creation.
1925
1926         (WebCore::DocumentParserYieldToken::DocumentParserYieldToken):
1927         (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken):
1928         * dom/Document.h:
1929
1930         Introduce a parser yield count to Document; as long as this count is greater than 0, we consider the Document to
1931         have active yield tokens. When constructing or destroying a ParserYieldToken, we increment and decrement the
1932         parser yield count (respectively).
1933
1934         (WebCore::Document::createParserYieldToken):
1935         (WebCore::Document::hasActiveParserYieldToken const):
1936         * dom/DocumentParser.h:
1937         (WebCore::DocumentParser::didBeginYieldingParser):
1938         (WebCore::DocumentParser::didEndYieldingParser):
1939
1940         Hooks for Document to tell its parser that we've started or finished yielding. This updates a flag on the
1941         parser's scheduler which is consulted when we determine whether to yield before a pumping token or executing
1942         script.
1943
1944         * dom/ScriptRunner.cpp:
1945         (WebCore::ScriptRunner::resume):
1946         (WebCore::ScriptRunner::notifyFinished):
1947         * dom/ScriptRunner.h:
1948         (WebCore::ScriptRunner::didBeginYieldingParser):
1949         (WebCore::ScriptRunner::didEndYieldingParser):
1950
1951         Hooks for Document to tell its ScriptRunner that we've started or finished yielding. These wrap calls to suspend
1952         and resume.
1953
1954         * html/parser/HTMLDocumentParser.cpp:
1955         (WebCore::HTMLDocumentParser::didBeginYieldingParser):
1956         (WebCore::HTMLDocumentParser::didEndYieldingParser):
1957
1958         Plumb to didBegin/didEnd calls to the HTMLParserScheduler.
1959
1960         * html/parser/HTMLDocumentParser.h:
1961         * html/parser/HTMLParserScheduler.cpp:
1962         (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
1963         * html/parser/HTMLParserScheduler.h:
1964         (WebCore::HTMLParserScheduler::shouldYieldBeforeToken):
1965
1966         Consult a flag when determining whether to yield. This flag is set to true only while the document has an active
1967         parser yield token.
1968
1969         (WebCore::HTMLParserScheduler::isScheduledForResume const):
1970
1971         Consider the parser scheduler to be scheduled for resume if there are active tokens. Without this change, we
1972         incorrectly consider the document to be finished loading when we have yield tokens, since it appears that the
1973         parser is no longer scheduled to pump its tokenizer.
1974
1975         (WebCore::HTMLParserScheduler::didBeginYieldingParser):
1976         (WebCore::HTMLParserScheduler::didEndYieldingParser):
1977
1978         When the Document begins yielding due to the documet having active tokens or ends yielding after the document
1979         loses all of its yield tokens, update a flag on the parser scheduler. After we finish yielding, additionally
1980         reschedule the parser if needed to ensure that we continue parsing the document; without this additional change
1981         to resume, we'll never get the document load or load events after relinquishing the yield token.
1982
1983 2018-07-17  Dirk Schulze  <krit@webkit.org>
1984
1985         [clip-path] Implement support for margin-box as reference box and box shape
1986         https://bugs.webkit.org/show_bug.cgi?id=127984
1987
1988         Reviewed by Simon Fraser.
1989
1990         Compute the margin-box rectangle as needed for clip-path based on the actual
1991         computed values for the margin-top, *-left, *-bottom, *-right properties.
1992
1993         Test: css3/masking/clip-path-margin-box.html
1994
1995         * rendering/RenderBox.h:
1996         (WebCore::RenderBox::marginBoxRect const):
1997         * rendering/RenderBoxModelObject.h:
1998         * rendering/RenderLayer.cpp:
1999         (WebCore::computeReferenceBox):
2000
2001 2018-07-17  Javier Fernandez  <jfernandez@igalia.com>
2002
2003         Delete content of a single cell table should not delete the whole table
2004         https://bugs.webkit.org/show_bug.cgi?id=173117
2005
2006         Reviewed by Ryosuke Niwa.
2007
2008         We should not extend selection looking for special elements if the
2009         delete operation has been triggered by a caret based selection.
2010
2011         This change is based on a recent [1] resolution of the Editing TF,
2012         which acknowledges that behavior of single-cell tables must be the
2013         same that multi-cell tables and even if the last character is
2014         deleted, we should not delete the whole table structure.
2015
2016         A different case would be when the user actively selects the whole
2017         content of a table; in this case, as we do in multi-cell tables,
2018         the structure of single-cell tables should be deleted together
2019         with the content.
2020
2021         [1] https://github.com/w3c/editing/issues/163
2022
2023         Tests: editing/deleting/backspace-delete-last-char-in-table.html
2024                editing/deleting/forward-delete-last-char-in-table.html
2025                editing/deleting/select-and-delete-last-char-in-table.html
2026
2027         * editing/TypingCommand.cpp:
2028         (WebCore::TypingCommand::deleteKeyPressed):
2029         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2030
2031 2018-07-16  Megan Gardner  <megan_gardner@apple.com>
2032
2033         Correctly adjust scroll offsets when a page is zoomed
2034         https://bugs.webkit.org/show_bug.cgi?id=187673
2035         <rdar://problem/41712829>
2036
2037         Reviewed by Wenson Hsieh.
2038
2039         Will add test later.
2040
2041         Make sure that distance is scaled by the pageScaleFactor, to 
2042         make sure that we scroll correctly when we are zoomed in.
2043
2044         * page/ios/EventHandlerIOS.mm:
2045         (WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
2046         
2047 2018-07-16  Simon Fraser  <simon.fraser@apple.com>
2048
2049         Roll out r233873 and r233875 since they caused 8 new layout test crashes.
2050
2051         * crypto/CryptoAlgorithm.cpp:
2052         (WebCore::CryptoAlgorithm::encrypt):
2053         (WebCore::CryptoAlgorithm::decrypt):
2054         (WebCore::CryptoAlgorithm::sign):
2055         (WebCore::CryptoAlgorithm::verify):
2056         (WebCore::CryptoAlgorithm::deriveBits):
2057         (WebCore::CryptoAlgorithm::importKey):
2058         (WebCore::dispatchAlgorithmOperation):
2059         (WebCore::CryptoAlgorithm::dispatchOperation):
2060         (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue): Deleted.
2061         * crypto/CryptoAlgorithm.h:
2062         * crypto/SubtleCrypto.cpp:
2063         (WebCore::SubtleCrypto::encrypt):
2064         (WebCore::SubtleCrypto::decrypt):
2065         (WebCore::SubtleCrypto::sign):
2066         (WebCore::SubtleCrypto::verify):
2067         (WebCore::SubtleCrypto::deriveKey):
2068         (WebCore::SubtleCrypto::deriveBits):
2069         (WebCore::SubtleCrypto::importKey):
2070         (WebCore::SubtleCrypto::wrapKey):
2071         (WebCore::SubtleCrypto::unwrapKey):
2072         (WebCore::crossThreadCopyImportParams): Deleted.
2073         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2074         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2075         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2076         (WebCore::CryptoAlgorithmAES_CBC::importKey):
2077         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2078         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2079         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2080         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2081         (WebCore::CryptoAlgorithmAES_CFB::importKey):
2082         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2083         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2084         (WebCore::parametersAreValid):
2085         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2086         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2087         (WebCore::CryptoAlgorithmAES_CTR::importKey):
2088         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2089         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2090         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2091         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2092         (WebCore::CryptoAlgorithmAES_GCM::importKey):
2093         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2094         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2095         (WebCore::CryptoAlgorithmAES_KW::importKey):
2096         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2097         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2098         (WebCore::CryptoAlgorithmECDH::deriveBits):
2099         (WebCore::CryptoAlgorithmECDH::importKey):
2100         * crypto/algorithms/CryptoAlgorithmECDH.h:
2101         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2102         (WebCore::CryptoAlgorithmECDSA::sign):
2103         (WebCore::CryptoAlgorithmECDSA::verify):
2104         (WebCore::CryptoAlgorithmECDSA::importKey):
2105         * crypto/algorithms/CryptoAlgorithmECDSA.h:
2106         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2107         (WebCore::CryptoAlgorithmHKDF::deriveBits):
2108         (WebCore::CryptoAlgorithmHKDF::importKey):
2109         * crypto/algorithms/CryptoAlgorithmHKDF.h:
2110         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2111         (WebCore::CryptoAlgorithmHMAC::sign):
2112         (WebCore::CryptoAlgorithmHMAC::verify):
2113         (WebCore::CryptoAlgorithmHMAC::importKey):
2114         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2115         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2116         (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
2117         (WebCore::CryptoAlgorithmPBKDF2::importKey):
2118         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2119         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2120         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
2121         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
2122         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
2123         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2124         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2125         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
2126         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
2127         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
2128         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2129         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2130         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
2131         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
2132         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2133         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2134         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2135         (WebCore::CryptoAlgorithmRSA_PSS::sign):
2136         (WebCore::CryptoAlgorithmRSA_PSS::verify):
2137         (WebCore::CryptoAlgorithmRSA_PSS::importKey):
2138         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2139         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2140         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2141         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2142         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
2143         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2144         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2145         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2146         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2147         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2148         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2149         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2150         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2151         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2152         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2153         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2154         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2155         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2156         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2157         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2158         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
2159         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2160         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2161         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2162         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2163         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2164         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
2165         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2166         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2167         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
2168         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2169         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2170         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2171         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2172         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2173         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2174         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2175         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2176         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2177         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2178         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2179         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2180         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
2181         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2182         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2183         * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
2184         * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
2185         * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
2186         * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
2187         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2188         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2189         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2190         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2191         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2192         * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
2193         * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2194
2195 2018-07-16  Ryosuke Niwa  <rniwa@webkit.org>
2196
2197         Release assert in ~TimerBase is getting hit in WK1 apps which uses JSC API directly
2198         https://bugs.webkit.org/show_bug.cgi?id=187713
2199         <rdar://problem/41759548>
2200
2201         Reviewed by Simon Fraser.
2202
2203         Turn this into a debug assertion in WebKit1 on iOS since JSC API doesn't grab the web thread lock,
2204         which means that Timer can get destroyed without the web thread lock in the main thread.
2205
2206         * platform/Timer.cpp:
2207         (WebCore::TimerBase::~TimerBase):
2208         (WebCore::TimerBase::setNextFireTime):
2209
2210 2018-07-16  Simon Fraser  <simon.fraser@apple.com>
2211
2212         Add color filter for transforming colors in Dark Mode
2213         https://bugs.webkit.org/show_bug.cgi?id=187717
2214         rdar://problem/41146650
2215
2216         Reviewed by Dean Jackson.
2217         
2218         Add a new filter function for use in -apple-color-filter for transforming colors
2219         when in Dark Mode. The filter is called apple-invert-lightness(), and takes no parameters.
2220         It's based on a lightness invert in HSL space, with some adjustments to improve the contrast
2221         of some colors on dark backgrounds, so does a much better job that using invert() with hue-rotate().
2222
2223         Test: css3/color-filters/color-filter-apple-invert-lightness.html
2224
2225         * css/CSSComputedStyleDeclaration.cpp:
2226         (WebCore::ComputedStyleExtractor::valueForFilter):
2227         * css/CSSValueKeywords.in:
2228         * css/StyleResolver.cpp:
2229         (WebCore::filterOperationForType):
2230         (WebCore::StyleResolver::createFilterOperations):
2231         * css/parser/CSSPropertyParser.cpp:
2232         (WebCore::CSSPropertyParser::parseSingleValue):
2233         * css/parser/CSSPropertyParserHelpers.cpp:
2234         (WebCore::CSSPropertyParserHelpers::consumeFilterImage):
2235         (WebCore::CSSPropertyParserHelpers::isPixelFilterFunction):
2236         (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
2237         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2238         (WebCore::CSSPropertyParserHelpers::consumeFilter):
2239         (WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction): Deleted.
2240         * css/parser/CSSPropertyParserHelpers.h:
2241         * page/FrameView.cpp:
2242         (WebCore::FrameView::paintContents):
2243         * platform/graphics/Color.cpp:
2244         * platform/graphics/ColorUtilities.cpp:
2245         (WebCore::sRGBToLinearComponents):
2246         (WebCore::linearToSRGBComponents):
2247         (WebCore::sRGBToLinearColorComponentForLuminance):
2248         (WebCore::luminance):
2249         (WebCore::sRGBToHSL):
2250         (WebCore::calcHue):
2251         (WebCore::HSLToSRGB):
2252         (WebCore::ColorMatrix::ColorMatrix):
2253         * platform/graphics/ColorUtilities.h:
2254         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2255         (PlatformCAFilters::filterValueForOperation):
2256         (PlatformCAFilters::colorMatrixValueForFilter):
2257         * platform/graphics/filters/FEColorMatrix.cpp:
2258         * platform/graphics/filters/FilterOperation.cpp:
2259         (WebCore::InvertLightnessFilterOperation::operator== const):
2260         (WebCore::InvertLightnessFilterOperation::blend):
2261         (WebCore::InvertLightnessFilterOperation::transformColor const):
2262         (WebCore::operator<<):
2263         * platform/graphics/filters/FilterOperation.h:
2264         * rendering/FilterEffectRenderer.cpp:
2265         (WebCore::FilterEffectRenderer::build):
2266
2267 2018-07-16  Jiewen Tan  <jiewen_tan@apple.com>
2268
2269         Unreviewed, build fix for r233873.
2270
2271         * crypto/SubtleCrypto.cpp:
2272         (WebCore::crossThreadCopyImportParams):
2273
2274 2018-07-15  Jiewen Tan  <jiewen_tan@apple.com>
2275
2276         [WebCrypto] Crypto operations should copy their parameters before hoping to another thread
2277         https://bugs.webkit.org/show_bug.cgi?id=187501
2278         <rdar://problem/41438160>
2279
2280         Reviewed by Youenn Fablet.
2281
2282         This patch aims at making all captured variables in all crypto lambdas that need to be passed
2283         to a worker thread thread safe, which includes:
2284         1) changing ref counted objects to thread safe ref counted object.
2285         2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
2286
2287         In addition to above changes, this patch also does the following things:
2288         1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
2289         to make it clear that lambdas will be passed to a secondary thread.
2290         2) make CryptoAlgorithmParameters as const parameters for all methods.
2291
2292         Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
2293                http/wpt/crypto/aes-cbc-crash.any.html
2294                http/wpt/crypto/aes-cbc-crash.any.worker.html
2295                http/wpt/crypto/aes-ctr-crash.any.html
2296                http/wpt/crypto/aes-ctr-crash.any.worker.html
2297                http/wpt/crypto/aes-gcm-crash.any.html
2298                http/wpt/crypto/aes-gcm-crash.any.worker.html
2299                http/wpt/crypto/derive-hmac-key-crash.any.html
2300                http/wpt/crypto/derive-hmac-key-crash.any.worker.html
2301                http/wpt/crypto/ecdsa-crash.any.html
2302                http/wpt/crypto/ecdsa-crash.any.worker.html
2303                http/wpt/crypto/hkdf-crash.any.html
2304                http/wpt/crypto/hkdf-crash.any.worker.html
2305                http/wpt/crypto/pbkdf2-crash.any.html
2306                http/wpt/crypto/pbkdf2-crash.any.worker.html
2307                http/wpt/crypto/rsa-oaep-crash.any.html
2308                http/wpt/crypto/rsa-oaep-crash.any.worker.html
2309                http/wpt/crypto/rsa-pss-crash.any.html
2310                http/wpt/crypto/rsa-pss-crash.any.worker.html
2311                http/wpt/crypto/unwrap-ec-key-crash.any.html
2312                http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
2313                http/wpt/crypto/unwrap-rsa-key-crash.any.html
2314                http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
2315
2316         * crypto/CryptoAlgorithm.cpp:
2317         (WebCore::CryptoAlgorithm::encrypt):
2318         (WebCore::CryptoAlgorithm::decrypt):
2319         (WebCore::CryptoAlgorithm::sign):
2320         (WebCore::CryptoAlgorithm::verify):
2321         (WebCore::CryptoAlgorithm::deriveBits):
2322         (WebCore::CryptoAlgorithm::importKey):
2323         (WebCore::dispatchAlgorithmOperation):
2324         (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
2325         (WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
2326         * crypto/CryptoAlgorithm.h:
2327         * crypto/SubtleCrypto.cpp:
2328         (WebCore::crossThreadCopyImportParams):
2329         (WebCore::SubtleCrypto::encrypt):
2330         (WebCore::SubtleCrypto::decrypt):
2331         (WebCore::SubtleCrypto::sign):
2332         (WebCore::SubtleCrypto::verify):
2333         (WebCore::SubtleCrypto::deriveKey):
2334         (WebCore::SubtleCrypto::deriveBits):
2335         (WebCore::SubtleCrypto::importKey):
2336         (WebCore::SubtleCrypto::wrapKey):
2337         (WebCore::SubtleCrypto::unwrapKey):
2338         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2339         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2340         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2341         (WebCore::CryptoAlgorithmAES_CBC::importKey):
2342         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2343         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2344         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2345         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2346         (WebCore::CryptoAlgorithmAES_CFB::importKey):
2347         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2348         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2349         (WebCore::parametersAreValid):
2350         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2351         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2352         (WebCore::CryptoAlgorithmAES_CTR::importKey):
2353         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2354         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2355         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2356         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2357         (WebCore::CryptoAlgorithmAES_GCM::importKey):
2358         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2359         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2360         (WebCore::CryptoAlgorithmAES_KW::importKey):
2361         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2362         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2363         (WebCore::CryptoAlgorithmECDH::deriveBits):
2364         (WebCore::CryptoAlgorithmECDH::importKey):
2365         * crypto/algorithms/CryptoAlgorithmECDH.h:
2366         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2367         (WebCore::CryptoAlgorithmECDSA::sign):
2368         (WebCore::CryptoAlgorithmECDSA::verify):
2369         (WebCore::CryptoAlgorithmECDSA::importKey):
2370         * crypto/algorithms/CryptoAlgorithmECDSA.h:
2371         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2372         (WebCore::CryptoAlgorithmHKDF::deriveBits):
2373         (WebCore::CryptoAlgorithmHKDF::importKey):
2374         * crypto/algorithms/CryptoAlgorithmHKDF.h:
2375         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2376         (WebCore::CryptoAlgorithmHMAC::sign):
2377         (WebCore::CryptoAlgorithmHMAC::verify):
2378         (WebCore::CryptoAlgorithmHMAC::importKey):
2379         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2380         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2381         (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
2382         (WebCore::CryptoAlgorithmPBKDF2::importKey):
2383         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2384         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2385         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
2386         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
2387         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
2388         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2389         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2390         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
2391         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
2392         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
2393         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2394         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2395         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
2396         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
2397         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2398         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2399         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2400         (WebCore::CryptoAlgorithmRSA_PSS::sign):
2401         (WebCore::CryptoAlgorithmRSA_PSS::verify):
2402         (WebCore::CryptoAlgorithmRSA_PSS::importKey):
2403         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2404         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2405         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2406         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2407         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
2408         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2409         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2410         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2411         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2412         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2413         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2414         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2415         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2416         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2417         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2418         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2419         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2420         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2421         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2422         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2423         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
2424         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2425         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2426         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2427         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2428         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2429         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
2430         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2431         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2432         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
2433         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2434         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2435         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2436         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2437         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2438         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2439         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2440         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2441         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2442         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2443         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2444         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2445         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
2446         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2447         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2448         * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
2449         * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
2450         * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
2451         * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
2452         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2453         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2454         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2455         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2456         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2457         * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
2458         * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2459
2460 2018-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2461
2462         [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
2463         https://bugs.webkit.org/show_bug.cgi?id=187375
2464
2465         Reviewed by Simon Fraser.
2466
2467         An immediate-paint transaction should force all the images which are pending
2468         decoding to be repainted.
2469
2470         To do that, FrameView::paintControlTints() will be re-factored to a new
2471         generic function such that it takes PaintInvalidationReasons. The new function
2472         which is named 'traverseForPaintInvalidation' will traverse the render tree
2473         for a specific PaintInvalidationReasons.
2474
2475         invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
2476         the underlying image and repaint all the clients which are waiting for the
2477         decoding to finish.
2478
2479         * loader/cache/CachedImage.cpp:
2480         (WebCore::CachedImage::didRemoveClient):
2481         (WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
2482         (WebCore::CachedImage::addClientWaitingForAsyncDecoding):
2483         (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
2484         (WebCore::CachedImage::allClientsRemoved):
2485         (WebCore::CachedImage::clear):
2486         (WebCore::CachedImage::createImage):
2487         (WebCore::CachedImage::imageFrameAvailable):
2488         (WebCore::CachedImage::addPendingImageDrawingClient): Deleted.
2489         * loader/cache/CachedImage.h:
2490         * page/FrameView.cpp:
2491         (WebCore::FrameView::paintScrollCorner):
2492         (WebCore::FrameView::updateControlTints):
2493         (WebCore::FrameView::traverseForPaintInvalidation):
2494         (WebCore::FrameView::adjustPageHeightDeprecated):
2495         (WebCore::FrameView::paintControlTints): Deleted.
2496         * page/FrameView.h:
2497         * platform/ScrollView.cpp:
2498         (WebCore::ScrollView::paint):
2499         * platform/Scrollbar.cpp:
2500         (WebCore::Scrollbar::paint):
2501         * platform/graphics/BitmapImage.h:
2502         * platform/graphics/GraphicsContext.cpp:
2503         (WebCore::GraphicsContext::GraphicsContext):
2504         * platform/graphics/GraphicsContext.h:
2505         (WebCore::GraphicsContext::performingPaintInvalidation const):
2506         (WebCore::GraphicsContext::invalidatingControlTints const):
2507         (WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
2508         (WebCore::GraphicsContext::updatingControlTints const): Deleted.
2509         * rendering/RenderBoxModelObject.cpp:
2510         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2511         * rendering/RenderImage.cpp:
2512         (WebCore::RenderImage::paintReplaced):
2513         (WebCore::RenderImage::paintAreaElementFocusRing):
2514         (WebCore::RenderImage::paintIntoRect):
2515         * rendering/RenderLayer.cpp:
2516         (WebCore::RenderLayer::paintScrollCorner):
2517         (WebCore::RenderLayer::paintResizer):
2518         (WebCore::RenderLayer::paintLayer):
2519         * rendering/RenderScrollbar.cpp:
2520         (WebCore::RenderScrollbar::paint):
2521         * rendering/RenderTheme.cpp:
2522         (WebCore::RenderTheme::paint):
2523         * testing/Internals.cpp:
2524         (WebCore::Internals::invalidateControlTints):
2525         (WebCore::Internals::paintControlTints): Deleted.
2526         * testing/Internals.h:
2527         * testing/Internals.idl:
2528
2529 2018-07-16  Ryan Haddad  <ryanhaddad@apple.com>
2530
2531         Unreviewed attempt to fix the build.
2532
2533         * rendering/RenderThemeMac.mm:
2534
2535 2018-07-11  Dean Jackson  <dino@apple.com>
2536
2537         Allow removal of white backgrounds
2538         https://bugs.webkit.org/show_bug.cgi?id=187574
2539         <rdar://problem/41146792>
2540
2541         Reviewed by Simon Fraser.
2542
2543         Add a drawing mode that turns white backgrounds into transparent
2544         regions, such that a hosting app can see through to its window.
2545
2546         Test: css3/color-filters/punch-out-white-backgrounds.html
2547
2548         * page/Settings.yaml: New Setting.
2549
2550         * rendering/InlineFlowBox.cpp: Draw with a destination out blend mode
2551         if the background is white and we are punching out backgrounds, which means
2552         that it will erase the destination.
2553         (WebCore::InlineFlowBox::paintBoxDecorations):
2554         * rendering/RenderBox.cpp:
2555         (WebCore::RenderBox::paintBackground): Ditto.
2556         * rendering/RenderTableCell.cpp:
2557         (WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto.
2558
2559         * rendering/RenderBoxModelObject.cpp:
2560         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Save and restore
2561         the composition mode if necessary.
2562
2563 2018-07-16  David Fenton  <david_fenton@apple.com>
2564
2565         Unreviewed, rolling out r233867.
2566
2567         caused build failures on High Sierra, Sierra and iOS
2568
2569         Reverted changeset:
2570
2571         "[WebCrypto] Crypto operations should copy their parameters
2572         before hoping to another thread"
2573         https://bugs.webkit.org/show_bug.cgi?id=187501
2574         https://trac.webkit.org/changeset/233867
2575
2576 2018-07-15  Jiewen Tan  <jiewen_tan@apple.com>
2577
2578         [WebCrypto] Crypto operations should copy their parameters before hoping to another thread
2579         https://bugs.webkit.org/show_bug.cgi?id=187501
2580         <rdar://problem/41438160>
2581
2582         Reviewed by Youenn Fablet.
2583
2584         This patch aims at making all captured variables in all crypto lambdas that need to be passed
2585         to a worker thread thread safe, which includes:
2586         1) changing ref counted objects to thread safe ref counted object.
2587         2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
2588
2589         In addition to above changes, this patch also does the following things:
2590         1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
2591         to make it clear that lambdas will be passed to a secondary thread.
2592         2) make CryptoAlgorithmParameters as const parameters for all methods.
2593
2594         Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
2595                http/wpt/crypto/aes-cbc-crash.any.html
2596                http/wpt/crypto/aes-cbc-crash.any.worker.html
2597                http/wpt/crypto/aes-ctr-crash.any.html
2598                http/wpt/crypto/aes-ctr-crash.any.worker.html
2599                http/wpt/crypto/aes-gcm-crash.any.html
2600                http/wpt/crypto/aes-gcm-crash.any.worker.html
2601                http/wpt/crypto/derive-hmac-key-crash.any.html
2602                http/wpt/crypto/derive-hmac-key-crash.any.worker.html
2603                http/wpt/crypto/ecdsa-crash.any.html
2604                http/wpt/crypto/ecdsa-crash.any.worker.html
2605                http/wpt/crypto/hkdf-crash.any.html
2606                http/wpt/crypto/hkdf-crash.any.worker.html
2607                http/wpt/crypto/pbkdf2-crash.any.html
2608                http/wpt/crypto/pbkdf2-crash.any.worker.html
2609                http/wpt/crypto/rsa-oaep-crash.any.html
2610                http/wpt/crypto/rsa-oaep-crash.any.worker.html
2611                http/wpt/crypto/rsa-pss-crash.any.html
2612                http/wpt/crypto/rsa-pss-crash.any.worker.html
2613                http/wpt/crypto/unwrap-ec-key-crash.any.html
2614                http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
2615                http/wpt/crypto/unwrap-rsa-key-crash.any.html
2616                http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
2617
2618         * crypto/CryptoAlgorithm.cpp:
2619         (WebCore::CryptoAlgorithm::encrypt):
2620         (WebCore::CryptoAlgorithm::decrypt):
2621         (WebCore::CryptoAlgorithm::sign):
2622         (WebCore::CryptoAlgorithm::verify):
2623         (WebCore::CryptoAlgorithm::deriveBits):
2624         (WebCore::CryptoAlgorithm::importKey):
2625         (WebCore::dispatchAlgorithmOperation):
2626         (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
2627         (WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
2628         * crypto/CryptoAlgorithm.h:
2629         * crypto/SubtleCrypto.cpp:
2630         (WebCore::crossThreadCopyImportParams):
2631         (WebCore::SubtleCrypto::encrypt):
2632         (WebCore::SubtleCrypto::decrypt):
2633         (WebCore::SubtleCrypto::sign):
2634         (WebCore::SubtleCrypto::verify):
2635         (WebCore::SubtleCrypto::deriveKey):
2636         (WebCore::SubtleCrypto::deriveBits):
2637         (WebCore::SubtleCrypto::importKey):
2638         (WebCore::SubtleCrypto::wrapKey):
2639         (WebCore::SubtleCrypto::unwrapKey):
2640         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2641         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2642         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2643         (WebCore::CryptoAlgorithmAES_CBC::importKey):
2644         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2645         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2646         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2647         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2648         (WebCore::CryptoAlgorithmAES_CFB::importKey):
2649         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2650         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2651         (WebCore::parametersAreValid):
2652         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2653         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2654         (WebCore::CryptoAlgorithmAES_CTR::importKey):
2655         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2656         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2657         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2658         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2659         (WebCore::CryptoAlgorithmAES_GCM::importKey):
2660         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2661         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2662         (WebCore::CryptoAlgorithmAES_KW::importKey):
2663         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2664         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2665         (WebCore::CryptoAlgorithmECDH::deriveBits):
2666         (WebCore::CryptoAlgorithmECDH::importKey):
2667         * crypto/algorithms/CryptoAlgorithmECDH.h:
2668         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2669         (WebCore::CryptoAlgorithmECDSA::sign):
2670         (WebCore::CryptoAlgorithmECDSA::verify):
2671         (WebCore::CryptoAlgorithmECDSA::importKey):
2672         * crypto/algorithms/CryptoAlgorithmECDSA.h:
2673         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2674         (WebCore::CryptoAlgorithmHKDF::deriveBits):
2675         (WebCore::CryptoAlgorithmHKDF::importKey):
2676         * crypto/algorithms/CryptoAlgorithmHKDF.h:
2677         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2678         (WebCore::CryptoAlgorithmHMAC::sign):
2679         (WebCore::CryptoAlgorithmHMAC::verify):
2680         (WebCore::CryptoAlgorithmHMAC::importKey):
2681         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2682         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2683         (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
2684         (WebCore::CryptoAlgorithmPBKDF2::importKey):
2685         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2686         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2687         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
2688         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
2689         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
2690         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2691         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2692         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
2693         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
2694         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
2695         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2696         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2697         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
2698         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
2699         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2700         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2701         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2702         (WebCore::CryptoAlgorithmRSA_PSS::sign):
2703         (WebCore::CryptoAlgorithmRSA_PSS::verify):
2704         (WebCore::CryptoAlgorithmRSA_PSS::importKey):
2705         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2706         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2707         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2708         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2709         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
2710         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2711         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2712         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2713         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2714         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2715         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2716         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2717         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2718         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2719         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2720         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2721         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2722         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2723         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2724         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2725         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
2726         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2727         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2728         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2729         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2730         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2731         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
2732         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2733         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2734         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
2735         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2736         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2737         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
2738         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2739         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2740         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2741         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2742         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
2743         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2744         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2745         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2746         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2747         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
2748         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2749         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2750         * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
2751         * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
2752         * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
2753         * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
2754         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2755         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2756         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2757         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2758         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2759         * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
2760         * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2761
2762 2018-07-16  Aditya Keerthi  <akeerthi@apple.com>
2763
2764         [Datalist][macOS] Add suggestions UI for TextFieldInputTypes
2765         https://bugs.webkit.org/show_bug.cgi?id=186531
2766
2767         Reviewed by Tim Horton.
2768
2769         Tests: fast/forms/datalist/datalist-show-hide.html
2770                fast/forms/datalist/datalist-textinput-keydown.html
2771
2772         * html/TextFieldInputType.cpp:
2773         (WebCore::TextFieldInputType::handleKeydownEvent):
2774         (WebCore::TextFieldInputType::handleKeydownEventForSpinButton): The suggestions view takes precedence when handling arrow key events.
2775
2776 2018-07-16  Jeremy Jones  <jeremyj@apple.com>
2777
2778         Fullscreen requires active document.
2779         https://bugs.webkit.org/show_bug.cgi?id=186226
2780         rdar://problem/36187413
2781
2782         Reviewed by Jer Noble.
2783
2784         Test: media/no-fullscreen-when-hidden.html
2785
2786         This change guarantees the document to be visible for both element fullscreen and video fullscreen.
2787
2788         User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
2789         because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
2790         be hidden.
2791
2792         Document::hidden() can't be relied upon because it won't update while JavaScript spins.
2793
2794         This change adds a sync call to the UI process to get the current UI visibility state.
2795
2796         * dom/Document.cpp:
2797         (WebCore::Document::requestFullScreenForElement):
2798         * html/HTMLMediaElement.cpp:
2799         (WebCore::HTMLMediaElement::enterFullscreen):
2800         * page/ChromeClient.h:
2801
2802 2018-07-16  Alex Christensen  <achristensen@webkit.org>
2803
2804         Reduce size of NetworkLoadMetrics and therefore ResourceResponse
2805         https://bugs.webkit.org/show_bug.cgi?id=187671
2806
2807         Reviewed by Darin Adler.
2808
2809         * inspector/agents/InspectorNetworkAgent.cpp:
2810         (WebCore::toProtocol):
2811         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
2812         * platform/network/NetworkLoadMetrics.h:
2813         (WebCore::NetworkLoadMetrics::isolatedCopy const):
2814         (WebCore::NetworkLoadMetrics::reset):
2815         (WebCore::NetworkLoadMetrics::clearNonTimingData):
2816
2817 2018-07-16  Chris Dumez  <cdumez@apple.com>
2818
2819         Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread
2820         https://bugs.webkit.org/show_bug.cgi?id=187702
2821
2822         Reviewed by Youenn Fablet.
2823
2824         Make sure LibWebRTCMediaEndpoint is always constructed and destructed on the main thread since
2825         it has a Timer data member and it would not be safe otherwise. LibWebRTCMediaEndpoint is
2826         ThreadSafeRefCounted and frequently passed to other threads.
2827
2828         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2829         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
2830         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2831
2832 2018-07-16  Sihui Liu  <sihui_liu@apple.com>
2833
2834         IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
2835         https://bugs.webkit.org/show_bug.cgi?id=187631
2836         <rdar://problem/42164227>
2837
2838         Reviewed by Brady Eidson.
2839
2840         When asked to delete database for an origin, we deleted the databases whose mainFrameOrigin 
2841         is that origin. Given that the origin may create IndexedDB from subframes, we should delete 
2842         databases whose openingOrigin is that origin too.
2843
2844         Covered by modified API test: WebKit.WebsiteDataStoreCustomPaths. 
2845
2846         * Modules/indexeddb/server/IDBServer.cpp:
2847         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
2848
2849 2018-07-16  Simon Fraser  <simon.fraser@apple.com>
2850
2851         Shrink some font-related classes and enums
2852         https://bugs.webkit.org/show_bug.cgi?id=187686
2853
2854         Reviewed by Myles Maxfield.
2855         
2856         Use enum class for enums in TextFlags.h and make them one byte big.
2857
2858         Re-order members of Font to shrink it from 360 to 328 bytes.
2859
2860         * css/CSSPrimitiveValueMappings.h:
2861         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2862         (WebCore::CSSPrimitiveValue::operator FontSmoothingMode const):
2863         (WebCore::CSSPrimitiveValue::operator FontSmallCaps const):
2864         (WebCore::CSSPrimitiveValue::operator TextRenderingMode const):
2865         * platform/graphics/Font.cpp:
2866         (WebCore::Font::Font):
2867         (WebCore::Font::verticalRightOrientationFont const):
2868         * platform/graphics/Font.h:
2869         * platform/graphics/FontCascade.cpp:
2870         (WebCore::offsetToMiddleOfGlyph):
2871         * platform/graphics/FontCascade.h:
2872         (WebCore::FontCascade::advancedTextRenderingMode const):
2873         * platform/graphics/FontCascadeFonts.cpp:
2874         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
2875         (WebCore::FontCascadeFonts::glyphDataForVariant):
2876         (WebCore::glyphPageFromFontRanges):
2877         * platform/graphics/FontDescription.cpp:
2878         (WebCore::FontCascadeDescription::FontCascadeDescription):
2879         * platform/graphics/FontDescription.h:
2880         (WebCore::FontDescription::setTextRenderingMode):
2881         (WebCore::FontDescription::setOrientation):
2882         (WebCore::FontDescription::setWidthVariant):
2883         (WebCore::FontCascadeDescription::setFontSmoothing):
2884         (WebCore::FontCascadeDescription::initialSmallCaps):
2885         (WebCore::FontCascadeDescription::initialFontSmoothing):
2886         (WebCore::FontCascadeDescription::initialTextRenderingMode):
2887         * platform/graphics/FontPlatformData.h:
2888         (WebCore::FontPlatformData::isForTextCombine const):
2889         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2890         (WebCore::preparePlatformFont):
2891         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2892         (WebCore::showLetterpressedGlyphsWithAdvances):
2893         (WebCore::showGlyphsWithAdvances):
2894         (WebCore::FontCascade::drawGlyphs):
2895         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
2896         * platform/graphics/cocoa/FontCocoa.mm:
2897         (WebCore::Font::platformInit):
2898         (WebCore::Font::platformBoundsForGlyph const):
2899         (WebCore::Font::platformWidthForGlyph const):
2900         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2901         (WebCore::FontPlatformData::hash const):
2902         (WebCore::mapFontWidthVariantToCTFeatureSelector):
2903         (WebCore::FontPlatformData::ctFont const):
2904         (WebCore::FontPlatformData::description const):
2905         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2906         (WebCore::FontPlatformData::buildScaledFont):
2907         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2908         (WebCore::Font::platformInit):
2909         (WebCore::Font::platformWidthForGlyph const):
2910         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2911         (WebCore::fontFeatures):
2912         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2913         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
2914         (WebCore::Font::getCFStringAttributes const):
2915         * platform/graphics/win/FontCGWin.cpp:
2916         (WebCore::FontCascade::drawGlyphs):
2917         * platform/graphics/win/FontCascadeDirect2D.cpp:
2918         (WebCore::FontCascade::drawGlyphs):
2919         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
2920         (WebCore::GlyphPage::fill):
2921         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
2922         (WebCore::Font::platformInit):
2923         (WebCore::Font::platformBoundsForGlyph const):
2924         (WebCore::Font::platformWidthForGlyph const):
2925         * platform/text/TextFlags.h:
2926         * rendering/RenderCombineText.cpp:
2927         (WebCore::RenderCombineText::combineTextIfNeeded):
2928         * rendering/RenderLayer.cpp:
2929         (WebCore::RenderLayer::calculateClipRects const):
2930         * rendering/TextPainter.cpp:
2931         (WebCore::TextPainter::paintTextWithShadows):
2932         * rendering/TextPainter.h:
2933         * rendering/style/RenderStyle.cpp:
2934         (WebCore::RenderStyle::fontAndGlyphOrientation):
2935         * rendering/svg/RenderSVGInlineText.cpp:
2936         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
2937
2938 2018-07-16  Sergio Villar Senin  <svillar@igalia.com>
2939
2940         [WebVR] Add support for connect/disconnect and mount/unmount device events
2941         https://bugs.webkit.org/show_bug.cgi?id=187343
2942
2943         Reviewed by Žan Doberšek.
2944
2945         WebVR specs define a series of events as part of the Window Interface Extension. We're
2946         adding support for the connect/disconnect and mount/unmount events both at the module level
2947         and the platform level using OpenVR.
2948
2949         In order to do that we need to keep lists of VRPlatformDisplays at platform level and
2950         VRDisplays at bindings level. We then update those lists accordingly to detect potential
2951         additions/removals, and emit the corresponding signals. A new client interface
2952         VRPlatformDisplayClient was also defined so that VRPlatformDisplay implementations could
2953         notify their clients (typically a VRDisplay).
2954
2955         Last but not least, NavigatorWebVR was updated so it supplements Navigator instead of
2956         supplementing Page.
2957
2958         * Modules/webvr/NavigatorWebVR.cpp: Supplement Navigator not Page.
2959         (WebCore::NavigatorWebVR::getVRDisplays): Keep a list of VRDisplays and update them
2960         conveniently, also emitting the required events under certain conditions (like device
2961         disconnection).
2962         (WebCore::NavigatorWebVR::supplementName): New method.
2963         (WebCore::NavigatorWebVR::from): Ditto.
2964         * Modules/webvr/NavigatorWebVR.h: Supplement Navigator not Page.
2965         * Modules/webvr/VRDisplay.cpp:
2966         (WebCore::VRDisplay::create): Moved suspendIfNeeded() to constructor.
2967         (WebCore::VRDisplay::VRDisplay): Set itself as VRPlatformDisplay client.
2968         (WebCore::VRDisplay::~VRDisplay): Unset as  VRPlatformDisplay client.
2969         (WebCore::VRDisplay::VRPlatformDisplayConnected): Dispatch event on DOM window.
2970         (WebCore::VRDisplay::VRPlatformDisplayDisconnected): Ditto.
2971         (WebCore::VRDisplay::VRPlatformDisplayMounted): Ditto.
2972         (WebCore::VRDisplay::VRPlatformDisplayUnmounted): Ditto.
2973         * Modules/webvr/VRDisplay.h: Extend from VRPlatformDisplayClient.
2974         (WebCore::VRDisplay::document):
2975         * Modules/webvr/VRDisplayEvent.cpp: Updated Copyright.
2976         * Modules/webvr/VRDisplayEvent.h: Ditto.
2977         * Sources.txt: Added the two new files.
2978         * WebCore.xcodeproj/project.pbxproj: Ditto.
2979         * platform/vr/VRManager.cpp:
2980         (WebCore::VRManager::getVRDisplays): Keep a list of VRPlatformDisplays and update them conveniently,
2981         also emitting the required events under certain conditions (like device disconnection).
2982         * platform/vr/VRManager.h:
2983         * platform/vr/VRPlatformDisplay.cpp: New file with common implementations for VRPlatformDisplays.
2984         (WebCore::VRPlatformDisplay::setClient):
2985         (WebCore::VRPlatformDisplay::notifyVRPlatformDisplayEvent):
2986         * platform/vr/VRPlatformDisplay.h: Added a generic method to notify about different
2987         events. Added the client pointer.
2988         * platform/vr/VRPlatformDisplayClient.h: New file. VRPlatformDisplay implementations will
2989         call the client methods in the event of some circumstances happening.
2990         (WebCore::VRPlatformDisplayClient::VRPlatformDisplayConnected):
2991         (WebCore::VRPlatformDisplayClient::VRPlatformDisplayDisconnected):
2992         (WebCore::VRPlatformDisplayClient::VRPlatformDisplayMounted):
2993         (WebCore::VRPlatformDisplayClient::VRPlatformDisplayUnmounted):
2994         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
2995         (WebCore::VRPlatformDisplayOpenVR::updateDisplayInfo): Poll the device for new events to
2996         detect connection/disconnections or device activations/deactivations (HMD
2997         mounted/unmounted).
2998         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2999
3000 2018-07-16  Zan Dobersek  <zdobersek@igalia.com>
3001
3002         [Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
3003         https://bugs.webkit.org/show_bug.cgi?id=187693
3004
3005         Reviewed by Carlos Garcia Campos.
3006
3007         Add the Nicosia::PlatformLayer class. This will be the base platform
3008         layer class from which different derivatives will be created, addressing
3009         different use cases. The generic PlatformLayer type alias will point to
3010         this class in the future.
3011
3012         First class deriving from Nicosia::PlatformLayer is
3013         Nicosia::CompositionLayer, purpose of which will be to mirror the state
3014         that's stored in the platform-specific GraphicsLayer derivative. It will
3015         also allow making thread-safe updates to that state.
3016
3017         CoordinatedGraphicsLayer implementation now spawns a CompositionLayer
3018         object and tracks state changes in a separate
3019         CompositionLayer::LayerState::Delta object. During flushing, the changed
3020         state is applied to the layer's pending state before the delta is nulled
3021         out. The updated state isn't used anywhere yet, but future changes will
3022         implement committing this state into the rendering pipeline.
3023
3024         There's bits of state not yet being managed by CompositionLayer, e.g.
3025         debug visuals, filters and animations. These will be addressed later.
3026
3027         The m_solidColor member variable is added to CoordinatedGraphicsLayer in
3028         order to properly store the solid color value. Normally this would be
3029         contained by the parent GraphicsLayer class, but no such member variable
3030         exists there.
3031
3032         * platform/TextureMapper.cmake:
3033         * platform/graphics/nicosia/NicosiaPlatformLayer.cpp: Added.
3034         (Nicosia::PlatformLayer::PlatformLayer):
3035         (Nicosia::CompositionLayer::CompositionLayer):
3036         * platform/graphics/nicosia/NicosiaPlatformLayer.h: Added.
3037         (Nicosia::PlatformLayer::isCompositionLayer const):
3038         (Nicosia::PlatformLayer::id const):
3039         (Nicosia::CompositionLayer::create):
3040         (Nicosia::CompositionLayer::LayerState::Flags::Flags):
3041         (Nicosia::CompositionLayer::updateState):
3042         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3043         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3044         (WebCore::CoordinatedGraphicsLayer::setPosition):
3045         (WebCore::CoordinatedGraphicsLayer::setAnchorPoint):
3046         (WebCore::CoordinatedGraphicsLayer::setSize):
3047         (WebCore::CoordinatedGraphicsLayer::setTransform):
3048         (WebCore::CoordinatedGraphicsLayer::setChildrenTransform):
3049         (WebCore::CoordinatedGraphicsLayer::setPreserves3D):
3050         (WebCore::CoordinatedGraphicsLayer::setMasksToBounds):
3051         (WebCore::CoordinatedGraphicsLayer::setDrawsContent):
3052         (WebCore::CoordinatedGraphicsLayer::setContentsVisible):
3053         (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
3054         (WebCore::CoordinatedGraphicsLayer::setBackfaceVisibility):
3055         (WebCore::CoordinatedGraphicsLayer::setOpacity):
3056         (WebCore::CoordinatedGraphicsLayer::setContentsRect):
3057         (WebCore::CoordinatedGraphicsLayer::setContentsTileSize):
3058         (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
3059         (WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor):
3060         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
3061         (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
3062         (WebCore::CoordinatedGraphicsLayer::syncChildren):
3063         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3064         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3065
3066 2018-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3067
3068         [iOS apps on macOS] Playing embedded Twitter videos in the News app crashes the web process
3069         https://bugs.webkit.org/show_bug.cgi?id=187690
3070         <rdar://problem/41869703>
3071
3072         Reviewed by Tim Horton.
3073
3074         Work around unexpected behavior when soft-linking AVFoundation. After using `dlopen_preflight` to check for the
3075         existence of a library prior to loading the library using `dlopen`, `dlsym` subsequently returns null for some
3076         symbols that would otherwise be available. This causes us to RELEASE_ASSERT later down the road when we try to
3077         load AVAudioSessionModeDefault in AudioSessionIOS.mm.
3078
3079         To fix this for now, simply check for the library directly instead of using the more lightweight preflight
3080         check. See clone: <rdar://problem/42224780> for more detail.
3081
3082         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
3083         (WebCore::AVFoundationMIMETypeCache::isAvailable const):
3084
3085 2018-07-14  Simon Fraser  <simon.fraser@apple.com>
3086
3087         Shrink StyleFillData, StyleStrokeData and StyleMiscData
3088         https://bugs.webkit.org/show_bug.cgi?id=187681
3089
3090         Reviewed by Anders Carlsson.
3091
3092         Shrink these data structures by making more enum classes one byte in size, and
3093         re-ordering. StyleFillData goes from 56 to 48, StyleStrokeData from 80 to 72,
3094         StyleMiscData from 40 to 32 bytes.
3095
3096         * rendering/style/SVGRenderStyleDefs.cpp:
3097         (WebCore::StyleFillData::StyleFillData):
3098         (WebCore::StyleFillData::operator== const):
3099         (WebCore::StyleStrokeData::StyleStrokeData):
3100         (WebCore::StyleStrokeData::operator== const):
3101         (WebCore::StyleStopData::operator== const):
3102         (WebCore::StyleMiscData::StyleMiscData):
3103         * rendering/style/SVGRenderStyleDefs.h:
3104
3105 2018-07-14  Simon Fraser  <simon.fraser@apple.com>
3106
3107         Shrink CachedResource and subclasses
3108         https://bugs.webkit.org/show_bug.cgi?id=187546
3109
3110         Reviewed by Daniel Bates.
3111
3112         Shrink CachedResource down from 1384 to 1336 bytes, CachedImage from 1480 to
3113         1424 bytes, and CachedFont a little.
3114         
3115         This saves about 23KB on cnn.com.
3116
3117         * loader/ResourceLoaderOptions.h:
3118         * loader/cache/CachedFont.h:
3119         * loader/cache/CachedImage.h:
3120         * loader/cache/CachedResource.cpp:
3121         (WebCore::CachedResource::CachedResource):
3122         * loader/cache/CachedResource.h:
3123         * platform/network/CacheValidation.h:
3124         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
3125         * platform/network/NetworkLoadMetrics.h:
3126         * platform/network/ParsedContentRange.h:
3127         * platform/network/ResourceRequestBase.h:
3128         * platform/network/ResourceResponseBase.h:
3129
3130 2018-07-14  Simon Fraser  <simon.fraser@apple.com>
3131
3132         Shrink some style-related classes and enums
3133         https://bugs.webkit.org/show_bug.cgi?id=187680
3134
3135         Reviewed by Antti Koivisto.
3136         
3137         Make all the enum classes in RenderStyleConstants be one byte big (all have less
3138         than 256 values).
3139         
3140         Shrink DocumentRuleSet from 384 to 368 bytes by re-ordering, which also helps shrink
3141         StyleResolver from 1024 to 952 bytes.
3142         
3143         Shrink BorderValue by re-ordering (now that the layout of Color has changed) which
3144         shrinks BorderData from 168 to 136 bytes.
3145         
3146         Convert a couple of other enums to enum class so that they can have explicit size.
3147
3148         * css/DocumentRuleSets.h:
3149         * css/MediaQueryMatcher.cpp:
3150         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle const):
3151         * css/StyleMedia.cpp:
3152         (WebCore::StyleMedia::matchMedium const):
3153         * css/StyleResolver.cpp:
3154         (WebCore::StyleResolver::StyleResolver):
3155         (WebCore::StyleResolver::State::State):
3156         (WebCore::StyleResolver::styleForElement):
3157         (WebCore::StyleResolver::cascadedPropertiesForRollback):
3158         (WebCore::StyleResolver::applyProperty):
3159         (WebCore::cascadeLevelForIndex):
3160         * css/StyleResolver.h:
3161         * rendering/style/BorderValue.h:
3162         * rendering/style/RenderStyle.cpp:
3163         * rendering/style/RenderStyleConstants.h:
3164         * style/StyleTreeResolver.cpp:
3165         (WebCore::Style::TreeResolver::styleForElement):
3166         * svg/SVGElementRareData.h:
3167         (WebCore::SVGElementRareData::overrideComputedStyle):
3168
3169 2018-07-14  Kocsen Chung  <kocsen_chung@apple.com>
3170
3171         Ensure WebKit stack is ad-hoc signed
3172         https://bugs.webkit.org/show_bug.cgi?id=187667
3173
3174         Reviewed by Alexey Proskuryakov.
3175
3176         * Configurations/Base.xcconfig:
3177
3178 2018-07-14  Dirk Schulze  <krit@webkit.org>
3179
3180         [css-masking] Fully support -webkit-clip-path on SVG elements
3181         https://bugs.webkit.org/show_bug.cgi?id=185829
3182
3183         Reviewed by Simon Fraser.
3184
3185         -webkit-clip-path contributes to SVG elements with boxes, shapes and now with
3186         element references to <clipPath> elements as well. Make sure that all types
3187         contribute to hit-testing of the SVG element as well as they should.
3188
3189         Tests: svg/clip-path/webkit-clip-path-after-expected.svg
3190                svg/clip-path/webkit-clip-path-after.svg
3191                svg/clip-path/webkit-clip-path-before-expected.svg
3192                svg/clip-path/webkit-clip-path-before.svg
3193                svg/dynamic-updates/SVGClipPath-prefixed-influences-hitTesting.html
3194                svg/dynamic-updates/SVGClipPath-prefixed-path-influences-hitTesting.html
3195                svg/dynamic-updates/SVGClipPathElement-prefixed-css-transform-influences-hitTesting.html
3196                svg/dynamic-updates/SVGClipPathElement-prefixed-transform-influences-hitTesting.html
3197
3198         * rendering/svg/SVGRenderSupport.cpp: Share code as much as possible.
3199         (WebCore::clipPathReferenceBox):
3200         (WebCore::isPointInCSSClippingArea): Take -webkit-clip-path into account.
3201         (WebCore::SVGRenderSupport::clipContextToCSSClippingArea):
3202         (WebCore::SVGRenderSupport::pointInClippingArea):
3203         * rendering/svg/SVGRenderSupport.h:
3204         * rendering/svg/SVGRenderingContext.cpp: Clip to -webkit-clip-path boxes, shapes and references.
3205         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
3206         * rendering/svg/SVGResources.cpp: Add -webkit-clip-path references to cached resources. Mimic SVG clip-path.
3207         (WebCore::SVGResources::buildCachedResources):
3208
3209 2018-07-13  Simon Fraser  <simon.fraser@apple.com>
3210
3211         Avoid fetching visitedDependentColor() so many times in editing code
3212         https://bugs.webkit.org/show_bug.cgi?id=187676
3213
3214         Reviewed by Zalan Bujtas.
3215         
3216         editingAttributedStringFromRange called style.visitedDependentColor() twice for each property,
3217         and fontAttributesForSelectionStart() called it two or three times. Use a local Color variable
3218         to avoid so many calls. Also replace a call to alpha() with isVisible() which makes the usage more clear.
3219
3220         No behavior change.
3221
3222         * editing/cocoa/EditorCocoa.mm:
3223         (WebCore::Editor::fontAttributesForSelectionStart const):
3224         * editing/cocoa/HTMLConverter.mm:
3225         (WebCore::editingAttributedStringFromRange):
3226
3227 2018-07-13  Youenn Fablet  <youenn@apple.com>
3228
3229         Support connecting a MediaStreamAudioDestinationNode to RTCPeerConnection
3230         https://bugs.webkit.org/show_bug.cgi?id=187627
3231         <rdar://problem/35334400>
3232
3233         Reviewed by Jer Noble.
3234
3235         When MediaStreamAudioSource is called to read new audio samples,
3236         convert these samples to a WebAudioBufferList and call RealtimeMediaSource::audioSamplesAvailable.
3237         This makes its observers to get the audio data.
3238
3239         Test: webrtc/peer-connection-createMediaStreamDestination.html
3240
3241         * Modules/mediastream/MediaStream.cpp:
3242         (WebCore::MediaStream::create): Minor refactoring.
3243         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
3244         (WebCore::createMediaStream):
3245         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
3246         (WebCore::MediaStreamAudioDestinationNode::process):
3247         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
3248         * Modules/webaudio/MediaStreamAudioSource.cpp:
3249         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource):
3250         (WebCore::MediaStreamAudioSource::consumeAudio):
3251         * Modules/webaudio/MediaStreamAudioSource.h:
3252         * Modules/webaudio/MediaStreamAudioSourceCocoa.cpp: Added.
3253         (WebCore::streamDescription):
3254         (WebCore::MediaStreamAudioSource::consumeAudio):
3255         * WebCore.xcodeproj/project.pbxproj:
3256         * platform/audio/AudioDestinationConsumer.h: Removed.
3257         * platform/mediastream/MediaStreamPrivate.cpp:
3258         (WebCore::MediaStreamPrivate::create):
3259         * platform/mediastream/MediaStreamPrivate.h:
3260
3261 2018-07-13  Christopher Reid  <chris.reid@sony.com>
3262
3263         [WinCairo] Enable WebGL when Accelerated Compositing is disabled
3264         https://bugs.webkit.org/show_bug.cgi?id=187664
3265
3266         Reviewed by Fujii Hironori.
3267
3268         AC was disabled for WinCairo in r233725 but it can still run WebGL without AC.
3269
3270         * html/HTMLCanvasElement.cpp:
3271
3272 2018-07-13  Chris Dumez  <cdumez@apple.com>
3273
3274         Crash under ApplicationCacheGroup::didFailLoadingEntry()
3275         https://bugs.webkit.org/show_bug.cgi?id=187661
3276         <rdar://problem/42179755>
3277
3278         Reviewed by Youenn Fablet.
3279
3280         If ApplicationCacheResourceLoader::create() fails synchronously with
3281         ApplicationCacheResourceLoader::Error::CannotCreateResource error, then
3282         m_entryLoader will be null when didFailLoadingEntry() is called. However,
3283         didFailLoadingEntry() fails to null check m_entryLoader before using it.
3284
3285         * loader/appcache/ApplicationCacheGroup.cpp:
3286         (WebCore::ApplicationCacheGroup::didFailLoadingEntry):
3287         (WebCore::ApplicationCacheGroup::startLoadingEntry):
3288         * loader/appcache/ApplicationCacheGroup.h:
3289
3290 2018-07-13  Alex Christensen  <achristensen@webkit.org>
3291
3292         Add release assertion to check thread in TimerBase::setNextFireTime
3293         https://bugs.webkit.org/show_bug.cgi?id=187666
3294
3295         Reviewed by Ryosuke Niwa.
3296
3297         This should give us insight into what is causing <rdar://problem/33352721>
3298         
3299         * platform/Timer.cpp:
3300         (WebCore::TimerBase::setNextFireTime):
3301
3302 2018-07-13  Ryosuke Niwa  <rniwa@webkit.org>
3303
3304         [iOS] [WK1] Crash inside IOSurfacePool::platformGarbageCollectNow() in WebThread
3305         https://bugs.webkit.org/show_bug.cgi?id=187635
3306         <rdar://problem/34297065>
3307
3308         Reviewed by Simon Fraser.
3309
3310         r167717 added code to trigger a CA commit in the web process via platformGarbageCollectNow() in order to free IOSurface-related memory.
3311         However, that code is also running in the web thread in apps using WebKit1, causing unwanted UIView layout on the web thread.
3312
3313         Fix by not triggering this CA commit if it's called on the web thread.
3314
3315         * platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
3316         (WebCore::IOSurfacePool::platformGarbageCollectNow):
3317
3318 2018-07-13  Antoine Quint  <graouts@apple.com>
3319
3320         Dark Mode: document markers are difficult to see
3321         https://bugs.webkit.org/show_bug.cgi?id=187632
3322         <rdar://problem/41099719>
3323
3324         Reviewed by Simon Fraser.
3325
3326         We update the way we draw the document markers for macOS and use more constrasting colors in dark mode.
3327         Paving the way for future improvements, we move the drawLineForDocumentMarker() method from GraphicsContext
3328         to RenderTheme and implement a first version in RenderThemeMac. The circles used for the underline are now
3329         drawn directly with Core Graphics and we no longer use an image resource. To allow both GraphicsContext
3330         and RenderTheme to have different versions of the drawLineForDocumentMarker() method, the DocumentMarkerLineStyle
3331         enum is now an "enum class".
3332
3333         No new test due to webkit.org/b/105616, webkit.org/b/187655 was raised to track the creation of new tests
3334         when it becomes possible again.
3335
3336         * platform/graphics/GraphicsContext.h:
3337         * platform/graphics/GraphicsContextImpl.h:
3338         * platform/graphics/cairo/CairoOperations.cpp:
3339         (WebCore::Cairo::drawLineForDocumentMarker):
3340         * platform/graphics/cairo/CairoOperations.h: